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

Credentials accept tenant_id argument to get_token #19602

Merged
merged 19 commits into from
Jul 8, 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
Prev Previous commit
Next Next commit
actually these credentials should tolerate unexpected kwargs
  • Loading branch information
chlowell committed Jul 7, 2021
commit f726cd30cef278bcd61cc36daaaab018298d7926
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ class AzureCliCredential(AsyncContextManager):
acquire tokens only from the tenant of the Azure CLI's active subscription.
"""

def __init__(self, *, allow_multitenant_authentication=False) -> None:
self._allow_multitenant = allow_multitenant_authentication
def __init__(self, **kwargs: "Any") -> None:
self._allow_multitenant = kwargs.get("allow_multitenant_authentication", False)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we kwargs.pop here and in the sync version?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need, kwargs isn't used again. I should use keyword-only syntax here though.


@log_get_token_async
async def get_token(self, *scopes: str, **kwargs: "Any") -> "AccessToken":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ class AzurePowerShellCredential(AsyncContextManager):
will acquire tokens only from the tenant of Azure PowerShell's active subscription.
"""

def __init__(self, *, allow_multitenant_authentication=False) -> None:
self._allow_multitenant = allow_multitenant_authentication
def __init__(self, **kwargs: "Any") -> None:
self._allow_multitenant = kwargs.get("allow_multitenant_authentication", False)

@log_get_token_async
async def get_token(
Expand Down