-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into fix-secalert
- Loading branch information
Showing
76 changed files
with
4,408 additions
and
203 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
[package] | ||
publish = true | ||
name = "ydb-grpc" | ||
version = "0.0.13" | ||
version = "0.0.14" | ||
authors = ["rekby <[email protected]>"] | ||
edition = "2021" | ||
license = "Apache-2.0" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#[derive(serde::Serialize, serde::Deserialize)] | ||
#[derive(Clone, PartialEq, ::prost::Message)] | ||
pub struct LoginRequest { | ||
#[prost(message, optional, tag = "1")] | ||
pub operation_params: ::core::option::Option<super::operations::OperationParams>, | ||
#[prost(string, tag = "2")] | ||
pub user: ::prost::alloc::string::String, | ||
#[prost(string, tag = "3")] | ||
pub password: ::prost::alloc::string::String, | ||
} | ||
#[derive(serde::Serialize, serde::Deserialize)] | ||
#[derive(Clone, PartialEq, ::prost::Message)] | ||
pub struct LoginResponse { | ||
/// After successfull completion must contain LoginResult. | ||
#[prost(message, optional, tag = "1")] | ||
pub operation: ::core::option::Option<super::operations::Operation>, | ||
} | ||
#[derive(serde::Serialize, serde::Deserialize)] | ||
#[derive(Clone, PartialEq, ::prost::Message)] | ||
pub struct LoginResult { | ||
#[prost(string, tag = "1")] | ||
pub token: ::prost::alloc::string::String, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
/// Generated client implementations. | ||
pub mod auth_service_client { | ||
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] | ||
use tonic::codegen::*; | ||
use tonic::codegen::http::Uri; | ||
#[derive(Debug, Clone)] | ||
pub struct AuthServiceClient<T> { | ||
inner: tonic::client::Grpc<T>, | ||
} | ||
impl AuthServiceClient<tonic::transport::Channel> { | ||
/// Attempt to create a new client by connecting to a given endpoint. | ||
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error> | ||
where | ||
D: std::convert::TryInto<tonic::transport::Endpoint>, | ||
D::Error: Into<StdError>, | ||
{ | ||
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; | ||
Ok(Self::new(conn)) | ||
} | ||
} | ||
impl<T> AuthServiceClient<T> | ||
where | ||
T: tonic::client::GrpcService<tonic::body::BoxBody>, | ||
T::Error: Into<StdError>, | ||
T::ResponseBody: Body<Data = Bytes> + Send + 'static, | ||
<T::ResponseBody as Body>::Error: Into<StdError> + Send, | ||
{ | ||
pub fn new(inner: T) -> Self { | ||
let inner = tonic::client::Grpc::new(inner); | ||
Self { inner } | ||
} | ||
pub fn with_origin(inner: T, origin: Uri) -> Self { | ||
let inner = tonic::client::Grpc::with_origin(inner, origin); | ||
Self { inner } | ||
} | ||
pub fn with_interceptor<F>( | ||
inner: T, | ||
interceptor: F, | ||
) -> AuthServiceClient<InterceptedService<T, F>> | ||
where | ||
F: tonic::service::Interceptor, | ||
T::ResponseBody: Default, | ||
T: tonic::codegen::Service< | ||
http::Request<tonic::body::BoxBody>, | ||
Response = http::Response< | ||
<T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody, | ||
>, | ||
>, | ||
<T as tonic::codegen::Service< | ||
http::Request<tonic::body::BoxBody>, | ||
>>::Error: Into<StdError> + Send + Sync, | ||
{ | ||
AuthServiceClient::new(InterceptedService::new(inner, interceptor)) | ||
} | ||
/// Compress requests with the given encoding. | ||
/// This requires the server to support it otherwise it might respond with an | ||
/// error. | ||
#[must_use] | ||
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { | ||
self.inner = self.inner.send_compressed(encoding); | ||
self | ||
} | ||
/// Enable decompressing responses. | ||
#[must_use] | ||
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { | ||
self.inner = self.inner.accept_compressed(encoding); | ||
self | ||
} | ||
/// Perform login using built-in auth system | ||
pub async fn login( | ||
&mut self, | ||
request: impl tonic::IntoRequest<super::super::LoginRequest>, | ||
) -> Result<tonic::Response<super::super::LoginResponse>, tonic::Status> { | ||
self.inner | ||
.ready() | ||
.await | ||
.map_err(|e| { | ||
tonic::Status::new( | ||
tonic::Code::Unknown, | ||
format!("Service was not ready: {}", e.into()), | ||
) | ||
})?; | ||
let codec = tonic::codec::ProstCodec::default(); | ||
let path = http::uri::PathAndQuery::from_static( | ||
"/Ydb.Auth.V1.AuthService/Login", | ||
); | ||
self.inner.unary(request.into_request(), path, codec).await | ||
} | ||
} | ||
} |
Oops, something went wrong.