Skip to content

Commit

Permalink
Keep the old GitHubAuth v3 API behavior intact
Browse files Browse the repository at this point in the history
  • Loading branch information
s0undt3ch committed Jun 30, 2017
1 parent 69b71cc commit 390dc1a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions master/buildbot/newsfragments/github-oauth.bugfix
@@ -0,0 +1 @@
Keep the old :py:class:`~buildbot.www.oauth2.GitHubAuth` v3 API behavior intact.
8 changes: 4 additions & 4 deletions master/buildbot/www/oauth2.py
Expand Up @@ -248,9 +248,9 @@ def __init__(self,
config.error(
'Retrieving team membership information using GitHubAuth is only '
'possible using GitHub api v4.')
self.resourceEndpoint = '{0}/api/v3'.format(self.serverURL)
self.apiResourceEndpoint = '{0}/api/v3'.format(self.serverURL)
else:
self.resourceEndpoint = '{0}/graphql'.format(self.serverURL)
self.apiResourceEndpoint = '{0}/graphql'.format(self.serverURL)
if getTeamsMembership:
self.getUserTeamsGraphqlTplC = jinja2.Template(
self.getUserTeamsGraphqlTpl.strip())
Expand All @@ -262,9 +262,9 @@ def post(self, session, query):
log.info('{klass} GraphQL POST Request: {endpoint} -> '
'DATA:\n----\n{data}\n----',
klass=self.__class__.__name__,
endpoint=self.resourceEndpoint,
endpoint=self.apiResourceEndpoint,
data=query)
ret = session.post(self.resourceEndpoint, json={'query': query})
ret = session.post(self.apiResourceEndpoint, json={'query': query})
return ret.json()

def getUserInfoFromOAuthClient(self, c):
Expand Down

0 comments on commit 390dc1a

Please sign in to comment.