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

update type of scopes for ClientCredentialsAuthorizer #498

Merged
merged 3 commits into from
Dec 1, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
1 change: 1 addition & 0 deletions changelog.d/20211201_145304_aaschaer_scopes_type.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* ClientCredentialsAuthorizer now accepts Union[str, Iterable[str]] as the type for scopes
aaschaer marked this conversation as resolved.
Show resolved Hide resolved
6 changes: 3 additions & 3 deletions src/globus_sdk/authorizers/client_credentials.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import logging
from typing import Any, Callable, Dict, Optional
from typing import Any, Callable, Dict, Iterable, Optional, Union

from globus_sdk.services.auth import ConfidentialAppAuthClient, OAuthTokenResponse

Expand Down Expand Up @@ -36,7 +36,7 @@ class ClientCredentialsAuthorizer(RenewingAuthorizer):
access tokens that will be used for the Authorization header. These scopes must
all be for the same resource server, or else the token response will have
multiple access tokens.
:type scopes: str
:type scopes: str, or iterable of str
:param access_token: Initial Access Token to use, only used if ``expires_at`` is
also set. Must be requested with the same set of scopes passed to this
authorizer.
Expand All @@ -58,7 +58,7 @@ class ClientCredentialsAuthorizer(RenewingAuthorizer):
def __init__(
self,
confidential_client: ConfidentialAppAuthClient,
scopes: str,
scopes: Union[str, Iterable[str]],
*,
access_token: Optional[str] = None,
expires_at: Optional[int] = None,
Expand Down