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 <tazjin@tvl.su>
This commit is contained in:
Vincent Ambo 2023-06-13 22:10:19 +03:00 committed by tazjin
parent 597d1a0aa2
commit 6f912f5ecf

View file

@ -80,8 +80,9 @@ impl<T: TokenProvider> Interceptor for AuthInterceptor<T> {
&mut self, &mut self,
mut request: tonic::Request<()>, mut request: tonic::Request<()>,
) -> Result<tonic::Request<()>, tonic::Status> { ) -> Result<tonic::Request<()>, tonic::Status> {
let token: MetadataValue<Ascii> = let token: MetadataValue<Ascii> = format!("Bearer {}", self.token_provider.get_token())
self.token_provider.get_token().try_into().map_err(|_| { .try_into()
.map_err(|_| {
tonic::Status::invalid_argument("authorization token contained invalid characters") tonic::Status::invalid_argument("authorization token contained invalid characters")
})?; })?;