Skip to content

Commit

Permalink
TokenExchangeCredential is more upfront about its parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
chlowell committed Aug 5, 2021
1 parent b6b4a57 commit ce4c730
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@


class TokenFileMixin(object):
def __init__(self, token_file_path, **kwargs): # pylint:disable=unused-argument
def __init__(self, token_file_path, **_):
# type: (str, **Any) -> None
super(TokenFileMixin, self).__init__()
self._jwt = ""
Expand All @@ -31,8 +31,12 @@ def get_service_account_token(self):


class TokenExchangeCredential(ClientAssertionCredential, TokenFileMixin):
def __init__(self, token_file_path, **kwargs):
# type: (str, **Any) -> None
def __init__(self, tenant_id, client_id, token_file_path, **kwargs):
# type: (str, str, str, **Any) -> None
super(TokenExchangeCredential, self).__init__(
get_assertion=self.get_service_account_token, token_file_path=token_file_path, **kwargs
tenant_id=tenant_id,
client_id=client_id,
get_assertion=self.get_service_account_token,
token_file_path=token_file_path,
**kwargs
)
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,11 @@


class TokenExchangeCredential(ClientAssertionCredential, TokenFileMixin):
def __init__(self, token_file_path: str, **kwargs: "Any") -> None:
super().__init__(get_assertion=self.get_service_account_token, token_file_path=token_file_path, **kwargs)
def __init__(self, tenant_id: str, client_id: str, token_file_path: str, **kwargs: "Any") -> None:
super().__init__(
tenant_id=tenant_id,
client_id=client_id,
get_assertion=self.get_service_account_token,
token_file_path=token_file_path,
**kwargs
)

0 comments on commit ce4c730

Please sign in to comment.