Skip to content

Commit 2153a6d

Browse files
authored
Merge pull request #29 from linyows/support-slug
Support slug for github team API
2 parents c1d888e + 16b2108 commit 2153a6d

File tree

4 files changed

+18
-2
lines changed

4 files changed

+18
-2
lines changed

debian/changelog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
octopass (0.5.0-1) bionic; urgency=medium
2+
3+
* Support slug for GitHub team API
4+
5+
-- linyows <linyows@gmail.com> Thu, 02 Oct 2018 14:40:00 +0900
16
octopass (0.4.1-1) xenial; urgency=medium
27

38
* Page size changes to 100 from 30 on Github organization API

octopass.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,11 @@ int octopass_github_team_id(char *team_name, char *data)
465465
const json_int_t id = json_integer_value(json_object_get(team, "id"));
466466
return id;
467467
}
468+
const char *slug = json_string_value(json_object_get(team, "slug"));
469+
if (name != NULL && strcmp(team_name, slug) == 0) {
470+
const json_int_t id = json_integer_value(json_object_get(team, "id"));
471+
return id;
472+
}
468473
}
469474

470475
return -1;
@@ -520,6 +525,7 @@ int octopass_team_id(struct config *con)
520525

521526
int id = octopass_github_team_id(con->team, res.data);
522527
free(res.data);
528+
523529
return id;
524530
}
525531

@@ -545,6 +551,9 @@ int octopass_team_members(struct config *con, struct response *res)
545551
{
546552
int team_id = octopass_team_id(con);
547553
if (team_id == -1) {
554+
if (con->syslog) {
555+
syslog(LOG_INFO, "team not found: %s", con->team);
556+
}
548557
return -1;
549558
}
550559

octopass.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
#include <sys/stat.h>
3535
#include <regex.h>
3636

37-
#define OCTOPASS_VERSION "0.4.1"
37+
#define OCTOPASS_VERSION "0.5.0"
3838
#define OCTOPASS_VERSION_WITH_NAME "octopass/" OCTOPASS_VERSION
3939
#ifndef OCTOPASS_CONFIG_FILE
4040
#define OCTOPASS_CONFIG_FILE "/etc/octopass.conf"

rpm/octopass.spec

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Summary: Management linux user and authentication with team or collaborator on Github.
22
Name: octopass
3-
Version: 0.4.1
3+
Version: 0.5.0
44
Release: 1
55
License: GPLv3
66
URL: https://github.com/linyows/octopass
@@ -56,6 +56,8 @@ install -m 644 octopass.conf.example %{buildroot}%{_sysconfdir}/octopass.conf.ex
5656
/etc/octopass.conf.example
5757

5858
%changelog
59+
* Thu Oct 02 2018 linyows <linyows@gmail.com> - 0.5.0-1
60+
- Support slug for GitHub team API
5961
* Mon Apr 02 2018 linyows <linyows@gmail.com> - 0.4.1-1
6062
- Page size changes to 100 from 30 on Github organization API
6163
* Mon Sep 25 2017 linyows <linyows@gmail.com> - 0.4.0-1

0 commit comments

Comments
 (0)