Fix build system to work with Github Enterprise
This commit is contained in:
parent
d91829dc3c
commit
b7a489813a
3 changed files with 12 additions and 7 deletions
|
@ -150,7 +150,9 @@ def raise_unsupported():
|
||||||
class GithubBuildTrigger(BuildTrigger):
|
class GithubBuildTrigger(BuildTrigger):
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _get_client(auth_token):
|
def _get_client(auth_token):
|
||||||
return Github(auth_token, client_id=github_trigger.client_id(),
|
return Github(auth_token,
|
||||||
|
base_url=github_trigger.api_endpoint(),
|
||||||
|
client_id=github_trigger.client_id(),
|
||||||
client_secret=github_trigger.client_secret())
|
client_secret=github_trigger.client_secret())
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
|
|
@ -1729,7 +1729,7 @@ quayApp = angular.module('quay', quayDependencies, function($provide, cfpLoading
|
||||||
|
|
||||||
keyService['githubEndpoint'] = oauth['GITHUB_LOGIN_CONFIG']['GITHUB_ENDPOINT'];
|
keyService['githubEndpoint'] = oauth['GITHUB_LOGIN_CONFIG']['GITHUB_ENDPOINT'];
|
||||||
|
|
||||||
keyService['githubTriggerAuthorizeUrl'] = oauth['GITHUB_LOGIN_CONFIG']['AUTHORIZE_ENDPOINT'];
|
keyService['githubTriggerAuthorizeUrl'] = oauth['GITHUB_TRIGGER_CONFIG']['AUTHORIZE_ENDPOINT'];
|
||||||
|
|
||||||
keyService['githubLoginScope'] = 'user:email';
|
keyService['githubLoginScope'] = 'user:email';
|
||||||
keyService['googleLoginScope'] = 'openid email';
|
keyService['googleLoginScope'] = 'openid email';
|
||||||
|
|
|
@ -52,6 +52,9 @@ class GithubOAuthConfig(OAuthConfig):
|
||||||
def _api_endpoint(self):
|
def _api_endpoint(self):
|
||||||
return self.config.get('API_ENDPOINT', self._get_url(self._endpoint(), '/api/v3/'))
|
return self.config.get('API_ENDPOINT', self._get_url(self._endpoint(), '/api/v3/'))
|
||||||
|
|
||||||
|
def api_endpoint(self):
|
||||||
|
return self._api_endpoint()[0:-1]
|
||||||
|
|
||||||
def user_endpoint(self):
|
def user_endpoint(self):
|
||||||
api_endpoint = self._api_endpoint()
|
api_endpoint = self._api_endpoint()
|
||||||
return self._get_url(api_endpoint, 'user')
|
return self._get_url(api_endpoint, 'user')
|
||||||
|
|
Reference in a new issue