Skip to content
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

Support specifying requests timeout #566

Closed
rectalogic opened this issue Sep 10, 2018 · 0 comments
Closed

Support specifying requests timeout #566

rectalogic opened this issue Sep 10, 2018 · 0 comments
Assignees
Milestone

Comments

@rectalogic
Copy link
Contributor

By default requests does not use timeouts, so it can hang forever. Production code using requests should almost always specify a timeout.
http://docs.python-requests.org/en/master/user/advanced/#timeouts

I can subclass oic.oic.Client to forward a timeout for most of pyoidc requests usage:

class Client(oic.oic.Client):
    def http_request(self, *args, **kwargs):
        # Set requests timeout for all http connections pyoidc makes
        kwargs["timeout"] = (3.05, 10)
        return super(Client, self).http_request(*args, **kwargs)

But pyoidc fetches keys without specifying any timeout or using the above Client to make the request, see KeyBundle.do_remote
https://github.com/OpenIDC/pyoidc/blob/master/src/oic/utils/keyio.py#L168

@tpazderka tpazderka added this to the 0.15.0 milestone Sep 11, 2018
tpazderka added a commit that referenced this issue Sep 11, 2018
This serves as a timeout for http connections through requests.

Close #566
@tpazderka tpazderka self-assigned this Sep 11, 2018
andrewkrug pushed a commit to mozilla-iam/pyoidc that referenced this issue Jun 6, 2019
This serves as a timeout for http connections through requests.

Close CZ-NIC#566
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants