You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm building an async client based on httpx for a service that uses request signing. Signatures must fall within a specific timestamp or risk 401 response. This is not a problem for low volume requests, but high volume requests run the risk of failing authentication due to sufficient clock skew (i.e., the request was signed >5min before it hit the network, as it was sitting in the connection pool waiting to be processed).
I thought a way around this might be using event hooks, and at first they seemed to work well. Though in at least one high volume test, I ran into a bunch of 401s. The docs aren't clear exactly when the request hook is processed, so I'm not sure what to make of it.
Are request hooks a good way to handle this? Any other thoughts appreciated!
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I'm building an async client based on
httpx
for a service that uses request signing. Signatures must fall within a specific timestamp or risk 401 response. This is not a problem for low volume requests, but high volume requests run the risk of failing authentication due to sufficient clock skew (i.e., the request was signed >5min before it hit the network, as it was sitting in the connection pool waiting to be processed).I thought a way around this might be using event hooks, and at first they seemed to work well. Though in at least one high volume test, I ran into a bunch of 401s. The docs aren't clear exactly when the request hook is processed, so I'm not sure what to make of it.
Are request hooks a good way to handle this? Any other thoughts appreciated!
Beta Was this translation helpful? Give feedback.
All reactions