Skip to content

Commit

Permalink
renamed github mixin methods
Browse files Browse the repository at this point in the history
  • Loading branch information
zcqian committed Dec 25, 2021
1 parent 3d2d7cd commit 0afa3e4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions biothings/web/auth/oauth_mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class GithubOAuth2Mixin(OAuth2Mixin):
'user': urllib.parse.urljoin(_GITHUB_API_URL_BASE, 'user')
}

async def get_oauth2_token(
async def github_get_oauth2_token(
self,
client_id: str,
client_secret: str,
Expand Down Expand Up @@ -55,7 +55,7 @@ async def get_oauth2_token(
ret = json_decode(response.body)
return ret

async def get_authenticated_user(self, token: Union[dict, str]) -> dict:
async def github_get_authenticated_user(self, token: Union[dict, str]) -> dict:
"""
Get Github User Info
Expand Down Expand Up @@ -87,11 +87,11 @@ async def get_authenticated_user(self, token: Union[dict, str]) -> dict:
RuntimeError: when using an invalid token or unsupported token type
Example:
>>> token = await self.get_oauth2_token(
>>> token = await self.github_get_oauth2_token(
>>> 'SOME_CLIENT_ID', 'SOME_CLIENT_SECRET',
>>> 'THE_CODE_GITHUB_PROVIDED_IN_THE_REDIRECT'
>>> )
>>> user = await self.get_authenticated_user(token)
>>> user = await self.github_get_authenticated_user(token)
>>> print(user['login'], user['id'])
zcqian 7196478
Expand Down

0 comments on commit 0afa3e4

Please sign in to comment.