Skip to content

Commit f11abec

Browse files
committed
Rename obtain_token_with_refresh_token(...) to ...by...(...)
1 parent f3860e3 commit f11abec

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

oauth2cli/oauth2.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ def _obtain_token( # The verb "obtain" is influenced by OAUTH2 RFC 6749
133133
"Token response is not in json format: %s", resp.text)
134134
raise
135135

136-
def obtain_token_with_refresh_token(self, refresh_token, scope=None, **kwargs):
136+
def obtain_token_by_refresh_token(self, refresh_token, scope=None, **kwargs):
137137
"""Obtain an access token via a refresh token.
138138
139139
:param refresh_token: The refresh token issued to the client
@@ -354,7 +354,7 @@ def _obtain_token(self, grant_type, params=None, data=None, *args, **kwargs):
354354
})
355355
return resp
356356

357-
def obtain_token_with_refresh_token(self, token_item, scope=None,
357+
def obtain_token_by_refresh_token(self, token_item, scope=None,
358358
rt_getter=lambda token_item: token_item["refresh_token"],
359359
**kwargs):
360360
# type: (Union[str, dict], Union[str, list, set, tuple], Callable) -> dict
@@ -369,10 +369,10 @@ def obtain_token_with_refresh_token(self, token_item, scope=None,
369369
"""
370370
if isinstance(token_item, str):
371371
# Satisfy the L of SOLID, although we expect caller uses a dict
372-
return super(Client, self).obtain_token_with_refresh_token(
372+
return super(Client, self).obtain_token_by_refresh_token(
373373
token_item, scope=scope, **kwargs)
374374
if isinstance(token_item, dict):
375-
resp = super(Client, self).obtain_token_with_refresh_token(
375+
resp = super(Client, self).obtain_token_by_refresh_token(
376376
rt_getter(token_item), scope=scope, **kwargs)
377377
if resp.get('error') == 'invalid_grant':
378378
self.on_removing_rt(token_item) # Discard old RT

0 commit comments

Comments
 (0)