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

Remove one-time token behavior of JWT Credentials #117

Merged
merged 4 commits into from
Feb 23, 2017

Conversation

theacodes
Copy link
Contributor

Resolves #114

@@ -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.

@@ -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.

This comment was marked as spam.

This comment was marked as spam.

kwargs.setdefault('issuer', info['client_email'])
return cls(
signer,
**kwargs)

This comment was marked as spam.

This comment was marked as spam.

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.

This comment was marked as spam.

This comment was marked as spam.

@@ -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.

@@ -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.

@@ -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.

@dhermes
Copy link
Contributor

dhermes commented Feb 23, 2017

We good?

@theacodes
Copy link
Contributor Author

@dhermes if you're good & travis is good then I'm good.

@dhermes
Copy link
Contributor

dhermes commented Feb 23, 2017

Seems you gotta fix CI but LGTM otherwise

@theacodes theacodes merged commit ab08689 into master Feb 23, 2017
@theacodes theacodes deleted the jwt-credential-audience branch February 23, 2017 17:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants