Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add google.auth.jwt #7

Merged
merged 5 commits into from
Oct 6, 2016
Merged

Add google.auth.jwt #7

merged 5 commits into from
Oct 6, 2016

Conversation

theacodes
Copy link
Contributor

No description provided.

@theacodes theacodes added this to the 1.0.0 milestone Oct 4, 2016
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.

import six


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.


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.



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

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

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.

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.

@@ -0,0 +1,175 @@
# Copyright 2014 Google Inc.

This comment was marked as spam.

This comment was marked as spam.

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.

OTHER_CERT_BYTES = fh.read()


@pytest.fixture

This comment was marked as spam.

This comment was marked as spam.

@dhermes
Copy link
Contributor

dhermes commented Oct 6, 2016

LGTM?

@theacodes
Copy link
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
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants