Skip to content

Commit

Permalink
Merge pull request #839 from sirosen/missing-docparam-cleanup-auth
Browse files Browse the repository at this point in the history
Fix missing docparams in services/auth/
  • Loading branch information
sirosen authored Aug 28, 2023
2 parents 334bc51 + 689275b commit 5d79f75
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 4 deletions.
5 changes: 5 additions & 0 deletions src/globus_sdk/services/auth/client/native_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,11 @@ def oauth2_refresh_token(
its client ID as a parameter in the POST body.
It needs this specialization because it cannot authenticate the refresh
grant call with client credentials, as is normal.
:param refresh_token: The refresh token to use to get a new access token
:type refresh_token: str
:param body_params: Extra parameters to include in the POST body
:type body_params: dict, optional
"""
log.info("Executing token refresh without client credentials")
form_data = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,9 @@ def exchange_code_for_tokens(self, auth_code: str) -> OAuthTokenResponse:
The second step of the Authorization Code flow, exchange an
authorization code for access tokens (and refresh tokens if specified)
:param auth_code: The short-lived code to exchange for tokens
:type auth_code: str
:rtype: :class:`OAuthTokenResponse <.OAuthTokenResponse>`
"""
logger.debug(
Expand Down
4 changes: 4 additions & 0 deletions src/globus_sdk/services/auth/flow_managers/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ def get_authorize_url(self, query_params: dict[str, t.Any] | None = None) -> str
The authorize_url may be (usually is) parameterized over attributes of
the specific flow manager instance which is generating it.
:param query_params: Any additional parameters to be passed through
as query params on the URL.
:type query_params: dict, optional
:rtype: ``string``
"""

Expand Down
3 changes: 3 additions & 0 deletions src/globus_sdk/services/auth/flow_managers/native_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,9 @@ def exchange_code_for_tokens(self, auth_code: str) -> OAuthTokenResponse:
The second step of the Native App flow, exchange an authorization code
for access tokens (and refresh tokens if specified).
:param auth_code: The short-lived code to exchange for tokens
:type auth_code: str
:rtype: :class:`OAuthTokenResponse <.OAuthTokenResponse>`
"""
logger.debug(
Expand Down
11 changes: 7 additions & 4 deletions src/globus_sdk/services/auth/identity_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@


def is_username(val: str) -> bool:
"""
If the value parses as a UUID, then it's an ID, not a username.
If it does not parse as such, then it must be a username.
"""
# If the value parses as a UUID, then it's an ID, not a username.
# If it does not parse as such, then it must be a username.
try:
uuid.UUID(val)
return False
Expand Down Expand Up @@ -232,6 +230,11 @@ def add(self, identity_id: str) -> bool:
def get(self, key: str, default: t.Any | None = None) -> t.Any:
"""
A dict-like get() method which accepts a default value.
:param key: The username or ID to look up
:type key: str
:param default: The default value to return if the key is not found
:type default: any, optional
"""
try:
return self[key]
Expand Down

0 comments on commit 5d79f75

Please sign in to comment.