diff options
author | Vincent Ambo <mail@tazj.in> | 2023-06-13T19·10+0300 |
---|---|---|
committer | tazjin <tazjin@tvl.su> | 2023-06-14T10·06+0000 |
commit | 6f912f5ecf56ef296633bfc5b3bafd15035d39f3 (patch) | |
tree | 74e49152d28184434e785da5055606f01b27c1e3 /ops/yandex-cloud-rs/src | |
parent | 597d1a0aa28602e31e746408145101363296e731 (diff) |
fix(ops/yandex-cloud-rs): add `Bearer` prefix to auth token r/6287
Change-Id: I27d23de0598e3ca926a85cba3022f2dfff25f6be Reviewed-on: https://cl.tvl.fyi/c/depot/+/8762 Tested-by: BuildkiteCI Reviewed-by: tazjin <tazjin@tvl.su>
Diffstat (limited to 'ops/yandex-cloud-rs/src')
-rw-r--r-- | ops/yandex-cloud-rs/src/lib.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/ops/yandex-cloud-rs/src/lib.rs b/ops/yandex-cloud-rs/src/lib.rs index 6b1425bc9e98..4693cc60ef31 100644 --- a/ops/yandex-cloud-rs/src/lib.rs +++ b/ops/yandex-cloud-rs/src/lib.rs @@ -80,8 +80,9 @@ impl<T: TokenProvider> Interceptor for AuthInterceptor<T> { &mut self, mut request: tonic::Request<()>, ) -> Result<tonic::Request<()>, tonic::Status> { - let token: MetadataValue<Ascii> = - self.token_provider.get_token().try_into().map_err(|_| { + let token: MetadataValue<Ascii> = format!("Bearer {}", self.token_provider.get_token()) + .try_into() + .map_err(|_| { tonic::Status::invalid_argument("authorization token contained invalid characters") })?; |