googleapis / googleapis/google-cloud-rust

Support deadlines on `Credential::get_token()`

Open
#988 0 comments 0 reactions 0 assignees View on GitHub
auth priority: p3 type: feature request
Dominant language
Rust
Stars
955
Forks
144
Avg merge
1d 5h
Merged PRs (30d)
279

Description

The gax layer has the concept of an operation deadline. i.e. make this client call, and we promise it will not take longer than T.

This eventually gets passed into the `reqwest` layer.

https://github.com/googleapis/google-cloud-rust/blob/6dc1eedc0d59089cc2150fc658c37c5f3136cfbb/src/gax/src/http_client/mod.rs#L187C31-L187C38

The gax retry loop calls into auth to get a token. Auth does not have a concept of deadlines. Auth calls may take longer than the configured deadline in gax.

gax could implement a watchdog to cut off auth calls, but it seems cleaner for auth to be able to cut off a request at a given deadline by setting a timeout in the `reqwest` layer. Auth needs to expose an API for this, and implement it.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.