-
Notifications
You must be signed in to change notification settings - Fork 346
Closed
Labels
🚨This issue needs some love.This issue needs some love.priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.Important issue which blocks shipping the next release. Will be fixed prior to next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Description
Environment details
- OS: Linux
- Python version: 3.8.2
- pip version: 20.0.2
google-authversion: 1.12.0
Steps to reproduce
- Create an ID token using the GCE metadata server:
from google.auth import compute_engine import google.auth.transport.requests request = google.auth.transport.requests.Request() target_audience = 'https://example.com' creds = compute_engine.IDTokenCredentials(request, target_audience, use_metadata_identity_endpoint=True)
- Try to use the credentials to authorize a request:
from google.auth.transport.requests import AuthorizedSession session = AuthorizedSession(credentials) response = session.get('https://example.com')
This results in an error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.8/site-packages/google/auth/credentials.py", line 66, in expired
skewed_expiry = self.expiry - _helpers.CLOCK_SKEW
TypeError: unsupported operand type(s) for -: 'int' and 'datetime.timedelta'
I think the issue is on this line. payload["exp"] should (apparently) be getting parsed into a datetime.timedelta
Metadata
Metadata
Assignees
Labels
🚨This issue needs some love.This issue needs some love.priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.Important issue which blocks shipping the next release. Will be fixed prior to next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.