latchset / custodia

An API to manage secrets storage and retrieval
GNU General Public License v3.0
85 stars 27 forks source link

custodia client and CLI have no timeout option #208

Closed tiran closed 7 years ago

tiran commented 7 years ago

Custodia uses Python's requests library to perform HTTP requests. By default requests does not time out, https://requests.readthedocs.io/en/master/user/advanced/#timeouts

Most requests to external servers should have a timeout attached, in case the server is not responding in a timely manner. By default, requests do not time out unless a timeout value is set explicitly. Without a timeout, your code may hang for minutes or more.

This is a problem in case a connection is blocked by a firewall. A systemd socket with a failing service does behave similiar when the service has restart enabled. I noticed the problem today while I was working on new Fedora packages.

Proposed solution: