-
Notifications
You must be signed in to change notification settings - Fork 315
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
feat: support for configurable token lifetime #1079
Conversation
Add an integration test where the requested lifetime < 3600s (so no exemption needed). |
|
@@ -353,6 +353,7 @@ def __init__( | |||
token_url, | |||
credential_source=None, | |||
service_account_impersonation_url=None, | |||
service_account_impersonation_options={}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry I missed this earlier, it seems you have hit a weird edge case. This will create a shared dictionary in all calls, this is not your intent correct?
https://docs.python-guide.org/writing/gotchas/#mutable-default-arguments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here is an example in a Python3 shell:
❯ python
Python 3.10.4 (main, Jul 19 2022, 20:41:22) [GCC 11.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> def foo(x, y, d={}):
... d[x] = y
... return d
...
>>> foo('x', 'y')
{'x': 'y'}
>>> foo('z', 'g')
{'x': 'y', 'z': 'g'}
>>>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed to follow up with a fix for this
No description provided.