Skip to content
This repository was archived by the owner on Mar 6, 2026. It is now read-only.

Add google.auth.jwt#7

Merged
theacodes merged 5 commits intomasterfrom
jwt
Oct 6, 2016
Merged

Add google.auth.jwt#7
theacodes merged 5 commits intomasterfrom
jwt

Conversation

@theacodes
Copy link
Copy Markdown
Contributor

No description provided.

@theacodes theacodes added this to the 1.0.0 milestone Oct 4, 2016
Comment thread google/auth/_helpers.py Outdated
import six


def now():

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

Comment thread google/auth/_helpers.py Outdated


def now():
"""Gets the current UTC datetime."""

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

Comment thread google/auth/_helpers.py

def datetime_to_secs(value):
"""Convert a datetime object to the number of seconds since the UNIX epoch.
"""

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

Comment thread google/auth/jwt.py Outdated


_DEFAULT_TOKEN_LIFETIME_SECS = 3600 # 1 hour in sections
CLOCK_SKEW_SECS = 300 # 5 minutes in seconds

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

Comment thread google/auth/jwt.py
"""Make a signed JWT.

Args:
signer (google.auth.crypt.Signer): The signer used to sign the JWT.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

Comment thread google/auth/jwt.py Outdated
token (Union[str, bytes]): The encoded JWT.

Returns:
Tuple(str, str, str, str): header, payload, signed_setion, and

This comment was marked as spam.

This comment was marked as spam.

Comment thread google/auth/jwt.py Outdated
certs = [certs[key_id]]
# If there's no key id in the header, check against all of the certs.
else:
certs = certs.values()

This comment was marked as spam.

This comment was marked as spam.

Comment thread tests/test_jwt.py
@@ -0,0 +1,175 @@
# Copyright 2014 Google Inc.

This comment was marked as spam.

This comment was marked as spam.

Comment thread tests/test_jwt.py
PUBLIC_CERT_BYTES = fh.read()

with open(os.path.join(DATA_DIR, 'other_cert.pem'), 'rb') as fh:
OTHER_CERT_BYTES = fh.read()

This comment was marked as spam.

This comment was marked as spam.

Comment thread tests/test_jwt.py
OTHER_CERT_BYTES = fh.read()


@pytest.fixture

This comment was marked as spam.

This comment was marked as spam.

@dhermes
Copy link
Copy Markdown
Contributor

dhermes commented Oct 6, 2016

LGTM?

@theacodes
Copy link
Copy Markdown
Contributor Author

Thanks for reviewing, @dhermes. :)

@theacodes theacodes merged commit 5824ad8 into master Oct 6, 2016
@theacodes theacodes deleted the jwt branch October 6, 2016 16:27
@theacodes theacodes mentioned this pull request Oct 21, 2016
12 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants