googleapis / googleapis/google-cloud-rust

Consider a mechanism to override credentials on a per-call basis

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

Description

Sometimes applications want to use a single client but use different credentials in the client. For example, they may be a middle-tier service that receives an OAuth token and passes it through, or it may service many tenants with the credentials stored in secret manager, or it service many tenants with the [3LO](https://developer.atlassian.com/cloud/confluence/oauth-2-3lo-apps/) flow.

In any case, the overhead of initializing the client (including HTTP + SSL handshake) is too hight for such middle-tier services.

>> This is bad in scenarios where different clients (with different Auth for example) need to be created in short succession.
>
> That is an interesting use-case. With that said, I do not think we will want to expose `reqwest::Client` in the public API. We may change the implementation to use `hyper` or `tonic` in the future. Instead, we may consider a mechanism to override the credentials during a single call.
>
> Version 0.24 had this feature. It was apparently removed as part of the re-structuring.
>
> It was a bigger change, we took over the `google-cloud-storage` crate name, the old crate (with updates) now lives at:
>
> https://crates.io/crates/gcloud-storage/
>
>

_Originally posted by @coryan in [#3471](https://github.com/googleapis/google-cloud-rust/issues/3471#issuecomment-3373700426)_

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.