Skip to content

make_iap_request.py does not have any timeout #1812

Closed
@TrevorEdwards

Description

@TrevorEdwards

In which file did you encounter the issue?

https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/iap/make_iap_request.py

Did you change the file? If so, how?

Nope

Describe the issue

resp = requests.request(
method, url,
headers={'Authorization': 'Bearer {}'.format(
google_open_id_connect_token)}, **kwargs)
doesn't have any timeout, even though it is recommended for production code by the requests library http://docs.python-requests.org/en/master/user/quickstart/#timeouts.

We could make timeout an optional argument to the function, maybe with a default of 60 seconds based on https://cloud.google.com/appengine/articles/deadlineexceedederrors ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions