Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix missing docparams in services/auth/ #839

Merged
merged 1 commit into from
Aug 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading