about summary refs log tree commit diff
path: root/ops/yandex-cloud-rs/src/lib.rs
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2023-06-13T19·10+0300
committertazjin <tazjin@tvl.su>2023-06-14T10·06+0000
commit6f912f5ecf56ef296633bfc5b3bafd15035d39f3 (patch)
tree74e49152d28184434e785da5055606f01b27c1e3 /ops/yandex-cloud-rs/src/lib.rs
parent597d1a0aa28602e31e746408145101363296e731 (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/lib.rs')
-rw-r--r--ops/yandex-cloud-rs/src/lib.rs5
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")
             })?;