shorter urljoin
This commit is contained in:
parent
b370626010
commit
d0b9f76be6
|
@ -1,5 +1,5 @@
|
||||||
from buildbot.www.oauth2 import OAuth2Auth
|
from buildbot.www.oauth2 import OAuth2Auth
|
||||||
import urllib.parse
|
from urllib.parse import urljoin
|
||||||
|
|
||||||
class GiteaAuth(OAuth2Auth):
|
class GiteaAuth(OAuth2Auth):
|
||||||
name = 'Gitea'
|
name = 'Gitea'
|
||||||
|
@ -8,8 +8,8 @@ class GiteaAuth(OAuth2Auth):
|
||||||
def __init__(self, endpoint, client_id, client_secret):
|
def __init__(self, endpoint, client_id, client_secret):
|
||||||
super(__class__, self).__init__(client_id, client_secret)
|
super(__class__, self).__init__(client_id, client_secret)
|
||||||
self.resourceEndpoint = endpoint
|
self.resourceEndpoint = endpoint
|
||||||
self.authUri = urllib.parse.urljoin(endpoint, 'login/oauth/authorize')
|
self.authUri = urljoin(endpoint, 'login/oauth/authorize')
|
||||||
self.tokenUri = urllib.parse.urljoin(endpoint, 'login/oauth/access_token')
|
self.tokenUri = urljoin(endpoint, 'login/oauth/access_token')
|
||||||
|
|
||||||
def getUserInfoFromOAuthClient(self, c):
|
def getUserInfoFromOAuthClient(self, c):
|
||||||
return self.get(c, '/api/v1/user')
|
return self.get(c, '/api/v1/user')
|
Loading…
Reference in New Issue
Block a user