-
Notifications
You must be signed in to change notification settings - Fork 309
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
Remove one-time token behavior of JWT Credentials #117
Conversation
@@ -260,13 +254,15 @@ class Credentials(credentials.Signing, | |||
JSON file:: | |||
|
|||
credentials = jwt.Credentials.from_service_account_file( | |||
'service-account.json') | |||
'service-account.json', | |||
audience='https://speech.googleapis.com') |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@@ -289,7 +288,7 @@ class Credentials(credentials.Signing, | |||
audience='https://vision.googleapis.com') | |||
""" | |||
|
|||
def __init__(self, signer, issuer=None, subject=None, audience=None, | |||
def __init__(self, signer, issuer, subject, audience, |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
google/auth/jwt.py
Outdated
kwargs.setdefault('issuer', info['client_email']) | ||
return cls( | ||
signer, | ||
**kwargs) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
audience (str): the `aud` claim. If not specified, a new | ||
JWT will be generated for every request and will use | ||
the request URI as the audience. | ||
audience (str): the `aud` claim. If unspecified the current |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@@ -452,15 +433,8 @@ def refresh(self, request): | |||
# (pylint doesn't correctly recognize overridden methods.) | |||
self.token, self.expiry = self._make_jwt() | |||
|
|||
@_helpers.copy_docstring(credentials.Signing) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@@ -472,32 +446,3 @@ def signer_email(self): | |||
@_helpers.copy_docstring(credentials.Signing) | |||
def signer(self): | |||
return self._signer | |||
|
|||
def before_request(self, request, method, url, headers): |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@@ -223,13 +223,18 @@ def to_jwt_credentials(self): | |||
jwt_creds = jwt.Credentials.from_service_account_file( | |||
'service_account.json') | |||
|
|||
Args: | |||
audience (str): the `aud` claim. The intended audience for the |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
We good? |
@dhermes if you're good & travis is good then I'm good. |
Seems you gotta fix CI but LGTM otherwise |
Resolves #114