From 6f912f5ecf56ef296633bfc5b3bafd15035d39f3 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Tue, 13 Jun 2023 22:10:19 +0300 Subject: fix(ops/yandex-cloud-rs): add `Bearer` prefix to auth token Change-Id: I27d23de0598e3ca926a85cba3022f2dfff25f6be Reviewed-on: https://cl.tvl.fyi/c/depot/+/8762 Tested-by: BuildkiteCI Reviewed-by: tazjin --- ops/yandex-cloud-rs/src/lib.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'ops') 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 Interceptor for AuthInterceptor { &mut self, mut request: tonic::Request<()>, ) -> Result, tonic::Status> { - let token: MetadataValue = - self.token_provider.get_token().try_into().map_err(|_| { + let token: MetadataValue = format!("Bearer {}", self.token_provider.get_token()) + .try_into() + .map_err(|_| { tonic::Status::invalid_argument("authorization token contained invalid characters") })?; -- cgit 1.4.1