// This file is @generated by prost-build. #[derive(serde::Serialize, serde::Deserialize)] #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct ServerIdentity { /// Stable UUID stored inside this database #[prost(string, tag = "1")] pub instance_id: ::prost::alloc::string::String, } #[derive(serde::Serialize, serde::Deserialize)] #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct GetServerIdentityRequest {} #[derive(serde::Serialize, serde::Deserialize)] #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct RegisterRequest { #[prost(string, tag = "1")] pub username: ::prost::alloc::string::String, #[prost(string, tag = "2")] pub email: ::prost::alloc::string::String, #[prost(string, tag = "3")] pub password: ::prost::alloc::string::String, #[prost(string, tag = "4")] pub password_confirmation: ::prost::alloc::string::String, /// IANA timezone, for example Europe/Bratislava #[prost(string, tag = "5")] pub timezone: ::prost::alloc::string::String, /// ISO 3166-1 alpha-2 country used for national phone numbers, for example SK #[prost(string, tag = "6")] pub phone_country: ::prost::alloc::string::String, } #[derive(serde::Serialize, serde::Deserialize)] #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct AuthResponse { /// UUID in string format #[prost(string, tag = "1")] pub id: ::prost::alloc::string::String, /// Registered username #[prost(string, tag = "2")] pub username: ::prost::alloc::string::String, /// Registered email (if provided) #[prost(string, tag = "3")] pub email: ::prost::alloc::string::String, /// Always 'guest' for a self-registration #[prost(string, tag = "4")] pub role: ::prost::alloc::string::String, } #[derive(serde::Serialize, serde::Deserialize)] #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct ChangePasswordRequest { #[prost(string, tag = "1")] pub current_password: ::prost::alloc::string::String, #[prost(string, tag = "2")] pub new_password: ::prost::alloc::string::String, #[prost(string, tag = "3")] pub new_password_confirmation: ::prost::alloc::string::String, } #[derive(serde::Serialize, serde::Deserialize)] #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct PasswordOperationResponse {} #[derive(serde::Serialize, serde::Deserialize)] #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct LoginRequest { /// Can be username or email #[prost(string, tag = "1")] pub identifier: ::prost::alloc::string::String, #[prost(string, tag = "2")] pub password: ::prost::alloc::string::String, } #[derive(serde::Serialize, serde::Deserialize)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct LoginResponse { /// JWT token #[prost(string, tag = "1")] pub access_token: ::prost::alloc::string::String, /// Usually "Bearer" #[prost(string, tag = "2")] pub token_type: ::prost::alloc::string::String, /// Expiration in seconds (86400 for 24 hours) #[prost(int32, tag = "3")] pub expires_in: i32, /// User's UUID in string format #[prost(string, tag = "4")] pub user_id: ::prost::alloc::string::String, /// User's role #[prost(string, tag = "5")] pub role: ::prost::alloc::string::String, #[prost(string, tag = "6")] pub username: ::prost::alloc::string::String, #[prost(message, optional, tag = "7")] pub authorization: ::core::option::Option, #[prost(string, tag = "8")] pub timezone: ::prost::alloc::string::String, #[prost(string, tag = "9")] pub phone_country: ::prost::alloc::string::String, } #[derive(serde::Serialize, serde::Deserialize)] #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct SetTimezoneRequest { /// IANA timezone, for example Europe/Bratislava #[prost(string, tag = "1")] pub timezone: ::prost::alloc::string::String, } #[derive(serde::Serialize, serde::Deserialize)] #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct UserPreferences { #[prost(string, tag = "1")] pub timezone: ::prost::alloc::string::String, } #[derive(serde::Serialize, serde::Deserialize)] #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct LogoutRequest {} #[derive(serde::Serialize, serde::Deserialize)] #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct LogoutResponse {} #[derive(serde::Serialize, serde::Deserialize)] #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct RevokeUserSessionsRequest { #[prost(string, tag = "1")] pub username: ::prost::alloc::string::String, } #[derive(serde::Serialize, serde::Deserialize)] #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct RevokeUserSessionsResponse {} #[derive(serde::Serialize, serde::Deserialize)] #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct GetAuthorizationRequest {} #[derive(serde::Serialize, serde::Deserialize)] #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct Permission { /// Canonical object string, one of: /// struct: structural area, never grantable at runtime /// data:/ one root table and its whole template family /// data:/\* every table in a profile, present and future /// data:\* every table everywhere /// journal: one profile's accounting journal /// journal:\* every profile's journal #[prost(string, tag = "1")] pub object: ::prost::alloc::string::String, /// manage for structural areas; read/insert/update/delete on the data plane. #[prost(string, tag = "2")] pub action: ::prost::alloc::string::String, } #[derive(serde::Serialize, serde::Deserialize)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct AuthorizationSnapshot { #[prost(string, tag = "1")] pub role: ::prost::alloc::string::String, /// Every permission the role holds, inherited ones included. #[prost(message, repeated, tag = "2")] pub permissions: ::prost::alloc::vec::Vec, } #[derive(serde::Serialize, serde::Deserialize)] #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct Role { #[prost(string, tag = "1")] pub name: ::prost::alloc::string::String, /// 'structural' (designs the system, never writes data) or 'data'. #[prost(string, tag = "2")] pub kind: ::prost::alloc::string::String, #[prost(bool, tag = "3")] pub built_in: bool, /// Role this one inherits every grant from; empty when it has no parent. #[prost(string, tag = "4")] pub parent: ::prost::alloc::string::String, } #[derive(serde::Serialize, serde::Deserialize)] #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct ListRolesRequest {} #[derive(serde::Serialize, serde::Deserialize)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ListRolesResponse { #[prost(message, repeated, tag = "1")] pub roles: ::prost::alloc::vec::Vec, } #[derive(serde::Serialize, serde::Deserialize)] #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct AddRoleRequest { #[prost(string, tag = "1")] pub name: ::prost::alloc::string::String, /// Optional data role to inherit from. Must rank below the caller. #[prost(string, tag = "2")] pub parent: ::prost::alloc::string::String, } #[derive(serde::Serialize, serde::Deserialize)] #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct RemoveRoleRequest { #[prost(string, tag = "1")] pub name: ::prost::alloc::string::String, } #[derive(serde::Serialize, serde::Deserialize)] #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct GrantPermissionRequest { #[prost(string, tag = "1")] pub role: ::prost::alloc::string::String, #[prost(string, tag = "2")] pub object: ::prost::alloc::string::String, #[prost(string, tag = "3")] pub action: ::prost::alloc::string::String, } #[derive(serde::Serialize, serde::Deserialize)] #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct RevokePermissionRequest { #[prost(string, tag = "1")] pub role: ::prost::alloc::string::String, #[prost(string, tag = "2")] pub object: ::prost::alloc::string::String, #[prost(string, tag = "3")] pub action: ::prost::alloc::string::String, } #[derive(serde::Serialize, serde::Deserialize)] #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct ListRolePermissionsRequest { #[prost(string, tag = "1")] pub role: ::prost::alloc::string::String, } #[derive(serde::Serialize, serde::Deserialize)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RolePermissions { #[prost(string, tag = "1")] pub role: ::prost::alloc::string::String, /// Grants stored against this role alone, without inherited ones. #[prost(message, repeated, tag = "2")] pub permissions: ::prost::alloc::vec::Vec, /// Everything the role can actually do, inheritance resolved. #[prost(message, repeated, tag = "3")] pub effective_permissions: ::prost::alloc::vec::Vec, } #[derive(serde::Serialize, serde::Deserialize)] #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct ListGrantableObjectsRequest { /// The role being edited. The response contains only actions that may be /// granted to this role by the caller. #[prost(string, tag = "1")] pub target_role: ::prost::alloc::string::String, } #[derive(serde::Serialize, serde::Deserialize)] #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct GrantableObject { /// Canonical value accepted by GrantPermission, for example /// data:acme/invoices. #[prost(string, tag = "1")] pub object: ::prost::alloc::string::String, /// Empty only for the data:\* and journal:\* global wildcards. #[prost(string, tag = "2")] pub profile: ::prost::alloc::string::String, /// Set only for a table-family root. #[prost(string, tag = "3")] pub table: ::prost::alloc::string::String, /// One of global_data, global_journal, profile, journal, table, or diagnostics. #[prost(string, tag = "4")] pub kind: ::prost::alloc::string::String, /// Actions the caller may grant to target_role for this object. #[prost(string, repeated, tag = "5")] pub allowed_actions: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } #[derive(serde::Serialize, serde::Deserialize)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ListGrantableObjectsResponse { #[prost(message, repeated, tag = "1")] pub objects: ::prost::alloc::vec::Vec, } #[derive(serde::Serialize, serde::Deserialize)] #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct InternalError { #[prost(string, tag = "1")] pub reference_id: ::prost::alloc::string::String, #[prost(string, tag = "2")] pub user_id: ::prost::alloc::string::String, #[prost(string, tag = "3")] pub username: ::prost::alloc::string::String, #[prost(string, tag = "4")] pub grpc_method: ::prost::alloc::string::String, #[prost(string, tag = "5")] pub detail: ::prost::alloc::string::String, #[prost(int64, tag = "6")] pub occurred_at_unix_milliseconds: i64, } #[derive(serde::Serialize, serde::Deserialize)] #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct ListInternalErrorsRequest { /// Every non-empty text/UUID field is an optional filter. Username and method /// use case-insensitive substring matching. #[prost(string, tag = "1")] pub reference_id: ::prost::alloc::string::String, #[prost(string, tag = "2")] pub user_id: ::prost::alloc::string::String, #[prost(string, tag = "3")] pub username: ::prost::alloc::string::String, #[prost(string, tag = "4")] pub grpc_method: ::prost::alloc::string::String, #[prost(int64, tag = "5")] pub occurred_from_unix_seconds: i64, #[prost(int64, tag = "6")] pub occurred_to_unix_seconds: i64, #[prost(enumeration = "InternalErrorSort", tag = "7")] pub sort: i32, /// Unspecified sort always means newest first. For an explicit sort, false is /// ascending and true is descending. #[prost(bool, tag = "8")] pub descending: bool, /// Defaults to 100 and is capped at 500. #[prost(uint32, tag = "9")] pub limit: u32, #[prost(uint64, tag = "10")] pub offset: u64, } #[derive(serde::Serialize, serde::Deserialize)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ListInternalErrorsResponse { #[prost(message, repeated, tag = "1")] pub errors: ::prost::alloc::vec::Vec, #[prost(uint64, tag = "2")] pub total_count: u64, } #[derive(serde::Serialize, serde::Deserialize)] #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct GetInternalErrorRequest { #[prost(string, tag = "1")] pub reference_id: ::prost::alloc::string::String, } #[derive(serde::Serialize, serde::Deserialize)] #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct AssignUserRoleRequest { #[prost(string, tag = "1")] pub username: ::prost::alloc::string::String, #[prost(string, tag = "2")] pub role: ::prost::alloc::string::String, } #[derive(serde::Serialize, serde::Deserialize)] #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct ResetUserPasswordRequest { #[prost(string, tag = "1")] pub username: ::prost::alloc::string::String, #[prost(string, tag = "2")] pub new_password: ::prost::alloc::string::String, #[prost(string, tag = "3")] pub new_password_confirmation: ::prost::alloc::string::String, } #[derive(serde::Serialize, serde::Deserialize)] #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct UserSummary { #[prost(string, tag = "1")] pub id: ::prost::alloc::string::String, #[prost(string, tag = "2")] pub username: ::prost::alloc::string::String, #[prost(string, tag = "3")] pub email: ::prost::alloc::string::String, #[prost(string, tag = "4")] pub role: ::prost::alloc::string::String, } #[derive(serde::Serialize, serde::Deserialize)] #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct ListUsersRequest {} #[derive(serde::Serialize, serde::Deserialize)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ListUsersResponse { #[prost(message, repeated, tag = "1")] pub users: ::prost::alloc::vec::Vec, } #[derive(serde::Serialize, serde::Deserialize)] #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] pub enum InternalErrorSort { Unspecified = 0, OccurredAt = 1, ReferenceId = 2, Username = 3, GrpcMethod = 4, } impl InternalErrorSort { /// String value of the enum field names used in the ProtoBuf definition. /// /// The values are not transformed in any way and thus are considered stable /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { Self::Unspecified => "INTERNAL_ERROR_SORT_UNSPECIFIED", Self::OccurredAt => "INTERNAL_ERROR_SORT_OCCURRED_AT", Self::ReferenceId => "INTERNAL_ERROR_SORT_REFERENCE_ID", Self::Username => "INTERNAL_ERROR_SORT_USERNAME", Self::GrpcMethod => "INTERNAL_ERROR_SORT_GRPC_METHOD", } } /// Creates an enum from field names used in the ProtoBuf definition. pub fn from_str_name(value: &str) -> ::core::option::Option { match value { "INTERNAL_ERROR_SORT_UNSPECIFIED" => Some(Self::Unspecified), "INTERNAL_ERROR_SORT_OCCURRED_AT" => Some(Self::OccurredAt), "INTERNAL_ERROR_SORT_REFERENCE_ID" => Some(Self::ReferenceId), "INTERNAL_ERROR_SORT_USERNAME" => Some(Self::Username), "INTERNAL_ERROR_SORT_GRPC_METHOD" => Some(Self::GrpcMethod), _ => None, } } } /// Generated client implementations. pub mod auth_service_client { #![allow( unused_variables, dead_code, missing_docs, clippy::wildcard_imports, clippy::let_unit_value, )] use tonic::codegen::*; use tonic::codegen::http::Uri; #[derive(Debug, Clone)] pub struct AuthServiceClient { inner: tonic::client::Grpc, } impl AuthServiceClient { /// Attempt to create a new client by connecting to a given endpoint. pub async fn connect(dst: D) -> Result where D: TryInto, D::Error: Into, { let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; Ok(Self::new(conn)) } } impl AuthServiceClient where T: tonic::client::GrpcService, T::Error: Into, T::ResponseBody: Body + std::marker::Send + 'static, ::Error: Into + std::marker::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( inner: T, interceptor: F, ) -> AuthServiceClient> where F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< http::Request, Response = http::Response< >::ResponseBody, >, >, , >>::Error: Into + std::marker::Send + std::marker::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 } /// Limits the maximum size of a decoded message. /// /// Default: `4MB` #[must_use] pub fn max_decoding_message_size(mut self, limit: usize) -> Self { self.inner = self.inner.max_decoding_message_size(limit); self } /// Limits the maximum size of an encoded message. /// /// Default: `usize::MAX` #[must_use] pub fn max_encoding_message_size(mut self, limit: usize) -> Self { self.inner = self.inner.max_encoding_message_size(limit); self } /// Identifies the logical database before the client selects a saved token. /// This endpoint is deliberately unauthenticated. pub async fn get_server_identity( &mut self, request: impl tonic::IntoRequest, ) -> std::result::Result, tonic::Status> { self.inner .ready() .await .map_err(|e| { tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/komp_ac.auth.AuthService/GetServerIdentity", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new("komp_ac.auth.AuthService", "GetServerIdentity"), ); self.inner.unary(req, path, codec).await } pub async fn register( &mut self, request: impl tonic::IntoRequest, ) -> std::result::Result, tonic::Status> { self.inner .ready() .await .map_err(|e| { tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/komp_ac.auth.AuthService/Register", ); let mut req = request.into_request(); req.extensions_mut() .insert(GrpcMethod::new("komp_ac.auth.AuthService", "Register")); self.inner.unary(req, path, codec).await } pub async fn login( &mut self, request: impl tonic::IntoRequest, ) -> std::result::Result, tonic::Status> { self.inner .ready() .await .map_err(|e| { tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/komp_ac.auth.AuthService/Login", ); let mut req = request.into_request(); req.extensions_mut() .insert(GrpcMethod::new("komp_ac.auth.AuthService", "Login")); self.inner.unary(req, path, codec).await } /// Changes the authenticated user's password after verifying the current one. pub async fn change_password( &mut self, request: impl tonic::IntoRequest, ) -> std::result::Result< tonic::Response, tonic::Status, > { self.inner .ready() .await .map_err(|e| { tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/komp_ac.auth.AuthService/ChangePassword", ); let mut req = request.into_request(); req.extensions_mut() .insert(GrpcMethod::new("komp_ac.auth.AuthService", "ChangePassword")); self.inner.unary(req, path, codec).await } pub async fn get_authorization( &mut self, request: impl tonic::IntoRequest, ) -> std::result::Result< tonic::Response, tonic::Status, > { self.inner .ready() .await .map_err(|e| { tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/komp_ac.auth.AuthService/GetAuthorization", ); let mut req = request.into_request(); req.extensions_mut() .insert(GrpcMethod::new("komp_ac.auth.AuthService", "GetAuthorization")); self.inner.unary(req, path, codec).await } pub async fn set_timezone( &mut self, request: impl tonic::IntoRequest, ) -> std::result::Result< tonic::Response, tonic::Status, > { self.inner .ready() .await .map_err(|e| { tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/komp_ac.auth.AuthService/SetTimezone", ); let mut req = request.into_request(); req.extensions_mut() .insert(GrpcMethod::new("komp_ac.auth.AuthService", "SetTimezone")); self.inner.unary(req, path, codec).await } /// Ends the caller's own sessions. Every token issued to them before this /// call, on every device, stops being accepted -- including the one used to /// make the call, so the caller must log in again afterwards. Discarding a /// token client-side is not a logout; this is. pub async fn logout( &mut self, request: impl tonic::IntoRequest, ) -> std::result::Result, tonic::Status> { self.inner .ready() .await .map_err(|e| { tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/komp_ac.auth.AuthService/Logout", ); let mut req = request.into_request(); req.extensions_mut() .insert(GrpcMethod::new("komp_ac.auth.AuthService", "Logout")); self.inner.unary(req, path, codec).await } /// Ends every session of another user, for a leaked token or a departing /// account. Requires the struct:user area, and the target must rank strictly /// below the caller. pub async fn revoke_user_sessions( &mut self, request: impl tonic::IntoRequest, ) -> std::result::Result< tonic::Response, tonic::Status, > { self.inner .ready() .await .map_err(|e| { tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/komp_ac.auth.AuthService/RevokeUserSessions", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new("komp_ac.auth.AuthService", "RevokeUserSessions"), ); self.inner.unary(req, path, codec).await } /// Role administration. Every call requires the struct:role area, and every /// target role must rank strictly below the caller's own role. pub async fn list_roles( &mut self, request: impl tonic::IntoRequest, ) -> std::result::Result< tonic::Response, tonic::Status, > { self.inner .ready() .await .map_err(|e| { tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/komp_ac.auth.AuthService/ListRoles", ); let mut req = request.into_request(); req.extensions_mut() .insert(GrpcMethod::new("komp_ac.auth.AuthService", "ListRoles")); self.inner.unary(req, path, codec).await } pub async fn add_role( &mut self, request: impl tonic::IntoRequest, ) -> std::result::Result, tonic::Status> { self.inner .ready() .await .map_err(|e| { tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/komp_ac.auth.AuthService/AddRole", ); let mut req = request.into_request(); req.extensions_mut() .insert(GrpcMethod::new("komp_ac.auth.AuthService", "AddRole")); self.inner.unary(req, path, codec).await } pub async fn remove_role( &mut self, request: impl tonic::IntoRequest, ) -> std::result::Result, tonic::Status> { self.inner .ready() .await .map_err(|e| { tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/komp_ac.auth.AuthService/RemoveRole", ); let mut req = request.into_request(); req.extensions_mut() .insert(GrpcMethod::new("komp_ac.auth.AuthService", "RemoveRole")); self.inner.unary(req, path, codec).await } /// Grant administration on the data plane. pub async fn grant_permission( &mut self, request: impl tonic::IntoRequest, ) -> std::result::Result< tonic::Response, tonic::Status, > { self.inner .ready() .await .map_err(|e| { tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/komp_ac.auth.AuthService/GrantPermission", ); let mut req = request.into_request(); req.extensions_mut() .insert(GrpcMethod::new("komp_ac.auth.AuthService", "GrantPermission")); self.inner.unary(req, path, codec).await } pub async fn revoke_permission( &mut self, request: impl tonic::IntoRequest, ) -> std::result::Result< tonic::Response, tonic::Status, > { self.inner .ready() .await .map_err(|e| { tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/komp_ac.auth.AuthService/RevokePermission", ); let mut req = request.into_request(); req.extensions_mut() .insert(GrpcMethod::new("komp_ac.auth.AuthService", "RevokePermission")); self.inner.unary(req, path, codec).await } pub async fn list_role_permissions( &mut self, request: impl tonic::IntoRequest, ) -> std::result::Result< tonic::Response, tonic::Status, > { self.inner .ready() .await .map_err(|e| { tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/komp_ac.auth.AuthService/ListRolePermissions", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new("komp_ac.auth.AuthService", "ListRolePermissions"), ); self.inner.unary(req, path, codec).await } pub async fn list_grantable_objects( &mut self, request: impl tonic::IntoRequest, ) -> std::result::Result< tonic::Response, tonic::Status, > { self.inner .ready() .await .map_err(|e| { tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/komp_ac.auth.AuthService/ListGrantableObjects", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new("komp_ac.auth.AuthService", "ListGrantableObjects"), ); self.inner.unary(req, path, codec).await } /// Diagnostic browsing is admin-only; authenticated UUID lookup follows role restrictions. pub async fn list_internal_errors( &mut self, request: impl tonic::IntoRequest, ) -> std::result::Result< tonic::Response, tonic::Status, > { self.inner .ready() .await .map_err(|e| { tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/komp_ac.auth.AuthService/ListInternalErrors", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new("komp_ac.auth.AuthService", "ListInternalErrors"), ); self.inner.unary(req, path, codec).await } pub async fn get_internal_error( &mut self, request: impl tonic::IntoRequest, ) -> std::result::Result, tonic::Status> { self.inner .ready() .await .map_err(|e| { tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/komp_ac.auth.AuthService/GetInternalError", ); let mut req = request.into_request(); req.extensions_mut() .insert(GrpcMethod::new("komp_ac.auth.AuthService", "GetInternalError")); self.inner.unary(req, path, codec).await } /// User administration. pub async fn assign_user_role( &mut self, request: impl tonic::IntoRequest, ) -> std::result::Result, tonic::Status> { self.inner .ready() .await .map_err(|e| { tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/komp_ac.auth.AuthService/AssignUserRole", ); let mut req = request.into_request(); req.extensions_mut() .insert(GrpcMethod::new("komp_ac.auth.AuthService", "AssignUserRole")); self.inner.unary(req, path, codec).await } /// Resets a lower-ranked user's password. pub async fn reset_user_password( &mut self, request: impl tonic::IntoRequest, ) -> std::result::Result< tonic::Response, tonic::Status, > { self.inner .ready() .await .map_err(|e| { tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/komp_ac.auth.AuthService/ResetUserPassword", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new("komp_ac.auth.AuthService", "ResetUserPassword"), ); self.inner.unary(req, path, codec).await } pub async fn list_users( &mut self, request: impl tonic::IntoRequest, ) -> std::result::Result< tonic::Response, tonic::Status, > { self.inner .ready() .await .map_err(|e| { tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/komp_ac.auth.AuthService/ListUsers", ); let mut req = request.into_request(); req.extensions_mut() .insert(GrpcMethod::new("komp_ac.auth.AuthService", "ListUsers")); self.inner.unary(req, path, codec).await } } } /// Generated server implementations. pub mod auth_service_server { #![allow( unused_variables, dead_code, missing_docs, clippy::wildcard_imports, clippy::let_unit_value, )] use tonic::codegen::*; /// Generated trait containing gRPC methods that should be implemented for use with AuthServiceServer. #[async_trait] pub trait AuthService: std::marker::Send + std::marker::Sync + 'static { /// Identifies the logical database before the client selects a saved token. /// This endpoint is deliberately unauthenticated. async fn get_server_identity( &self, request: tonic::Request, ) -> std::result::Result, tonic::Status>; async fn register( &self, request: tonic::Request, ) -> std::result::Result, tonic::Status>; async fn login( &self, request: tonic::Request, ) -> std::result::Result, tonic::Status>; /// Changes the authenticated user's password after verifying the current one. async fn change_password( &self, request: tonic::Request, ) -> std::result::Result< tonic::Response, tonic::Status, >; async fn get_authorization( &self, request: tonic::Request, ) -> std::result::Result< tonic::Response, tonic::Status, >; async fn set_timezone( &self, request: tonic::Request, ) -> std::result::Result, tonic::Status>; /// Ends the caller's own sessions. Every token issued to them before this /// call, on every device, stops being accepted -- including the one used to /// make the call, so the caller must log in again afterwards. Discarding a /// token client-side is not a logout; this is. async fn logout( &self, request: tonic::Request, ) -> std::result::Result, tonic::Status>; /// Ends every session of another user, for a leaked token or a departing /// account. Requires the struct:user area, and the target must rank strictly /// below the caller. async fn revoke_user_sessions( &self, request: tonic::Request, ) -> std::result::Result< tonic::Response, tonic::Status, >; /// Role administration. Every call requires the struct:role area, and every /// target role must rank strictly below the caller's own role. async fn list_roles( &self, request: tonic::Request, ) -> std::result::Result< tonic::Response, tonic::Status, >; async fn add_role( &self, request: tonic::Request, ) -> std::result::Result, tonic::Status>; async fn remove_role( &self, request: tonic::Request, ) -> std::result::Result, tonic::Status>; /// Grant administration on the data plane. async fn grant_permission( &self, request: tonic::Request, ) -> std::result::Result, tonic::Status>; async fn revoke_permission( &self, request: tonic::Request, ) -> std::result::Result, tonic::Status>; async fn list_role_permissions( &self, request: tonic::Request, ) -> std::result::Result, tonic::Status>; async fn list_grantable_objects( &self, request: tonic::Request, ) -> std::result::Result< tonic::Response, tonic::Status, >; /// Diagnostic browsing is admin-only; authenticated UUID lookup follows role restrictions. async fn list_internal_errors( &self, request: tonic::Request, ) -> std::result::Result< tonic::Response, tonic::Status, >; async fn get_internal_error( &self, request: tonic::Request, ) -> std::result::Result, tonic::Status>; /// User administration. async fn assign_user_role( &self, request: tonic::Request, ) -> std::result::Result, tonic::Status>; /// Resets a lower-ranked user's password. async fn reset_user_password( &self, request: tonic::Request, ) -> std::result::Result< tonic::Response, tonic::Status, >; async fn list_users( &self, request: tonic::Request, ) -> std::result::Result< tonic::Response, tonic::Status, >; } #[derive(Debug)] pub struct AuthServiceServer { inner: Arc, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, max_decoding_message_size: Option, max_encoding_message_size: Option, } impl AuthServiceServer { pub fn new(inner: T) -> Self { Self::from_arc(Arc::new(inner)) } pub fn from_arc(inner: Arc) -> Self { Self { inner, accept_compression_encodings: Default::default(), send_compression_encodings: Default::default(), max_decoding_message_size: None, max_encoding_message_size: None, } } pub fn with_interceptor( inner: T, interceptor: F, ) -> InterceptedService where F: tonic::service::Interceptor, { InterceptedService::new(Self::new(inner), interceptor) } /// Enable decompressing requests with the given encoding. #[must_use] pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { self.accept_compression_encodings.enable(encoding); self } /// Compress responses with the given encoding, if the client supports it. #[must_use] pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { self.send_compression_encodings.enable(encoding); self } /// Limits the maximum size of a decoded message. /// /// Default: `4MB` #[must_use] pub fn max_decoding_message_size(mut self, limit: usize) -> Self { self.max_decoding_message_size = Some(limit); self } /// Limits the maximum size of an encoded message. /// /// Default: `usize::MAX` #[must_use] pub fn max_encoding_message_size(mut self, limit: usize) -> Self { self.max_encoding_message_size = Some(limit); self } } impl tonic::codegen::Service> for AuthServiceServer where T: AuthService, B: Body + std::marker::Send + 'static, B::Error: Into + std::marker::Send + 'static, { type Response = http::Response; type Error = std::convert::Infallible; type Future = BoxFuture; fn poll_ready( &mut self, _cx: &mut Context<'_>, ) -> Poll> { Poll::Ready(Ok(())) } fn call(&mut self, req: http::Request) -> Self::Future { match req.uri().path() { "/komp_ac.auth.AuthService/GetServerIdentity" => { #[allow(non_camel_case_types)] struct GetServerIdentitySvc(pub Arc); impl< T: AuthService, > tonic::server::UnaryService for GetServerIdentitySvc { type Response = super::ServerIdentity; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { ::get_server_identity(&inner, request) .await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; let max_decoding_message_size = self.max_decoding_message_size; let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { let method = GetServerIdentitySvc(inner); let codec = tonic_prost::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( accept_compression_encodings, send_compression_encodings, ) .apply_max_message_size_config( max_decoding_message_size, max_encoding_message_size, ); let res = grpc.unary(method, req).await; Ok(res) }; Box::pin(fut) } "/komp_ac.auth.AuthService/Register" => { #[allow(non_camel_case_types)] struct RegisterSvc(pub Arc); impl< T: AuthService, > tonic::server::UnaryService for RegisterSvc { type Response = super::AuthResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { ::register(&inner, request).await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; let max_decoding_message_size = self.max_decoding_message_size; let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { let method = RegisterSvc(inner); let codec = tonic_prost::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( accept_compression_encodings, send_compression_encodings, ) .apply_max_message_size_config( max_decoding_message_size, max_encoding_message_size, ); let res = grpc.unary(method, req).await; Ok(res) }; Box::pin(fut) } "/komp_ac.auth.AuthService/Login" => { #[allow(non_camel_case_types)] struct LoginSvc(pub Arc); impl tonic::server::UnaryService for LoginSvc { type Response = super::LoginResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { ::login(&inner, request).await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; let max_decoding_message_size = self.max_decoding_message_size; let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { let method = LoginSvc(inner); let codec = tonic_prost::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( accept_compression_encodings, send_compression_encodings, ) .apply_max_message_size_config( max_decoding_message_size, max_encoding_message_size, ); let res = grpc.unary(method, req).await; Ok(res) }; Box::pin(fut) } "/komp_ac.auth.AuthService/ChangePassword" => { #[allow(non_camel_case_types)] struct ChangePasswordSvc(pub Arc); impl< T: AuthService, > tonic::server::UnaryService for ChangePasswordSvc { type Response = super::PasswordOperationResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { ::change_password(&inner, request).await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; let max_decoding_message_size = self.max_decoding_message_size; let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { let method = ChangePasswordSvc(inner); let codec = tonic_prost::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( accept_compression_encodings, send_compression_encodings, ) .apply_max_message_size_config( max_decoding_message_size, max_encoding_message_size, ); let res = grpc.unary(method, req).await; Ok(res) }; Box::pin(fut) } "/komp_ac.auth.AuthService/GetAuthorization" => { #[allow(non_camel_case_types)] struct GetAuthorizationSvc(pub Arc); impl< T: AuthService, > tonic::server::UnaryService for GetAuthorizationSvc { type Response = super::AuthorizationSnapshot; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { ::get_authorization(&inner, request).await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; let max_decoding_message_size = self.max_decoding_message_size; let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { let method = GetAuthorizationSvc(inner); let codec = tonic_prost::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( accept_compression_encodings, send_compression_encodings, ) .apply_max_message_size_config( max_decoding_message_size, max_encoding_message_size, ); let res = grpc.unary(method, req).await; Ok(res) }; Box::pin(fut) } "/komp_ac.auth.AuthService/SetTimezone" => { #[allow(non_camel_case_types)] struct SetTimezoneSvc(pub Arc); impl< T: AuthService, > tonic::server::UnaryService for SetTimezoneSvc { type Response = super::UserPreferences; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { ::set_timezone(&inner, request).await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; let max_decoding_message_size = self.max_decoding_message_size; let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { let method = SetTimezoneSvc(inner); let codec = tonic_prost::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( accept_compression_encodings, send_compression_encodings, ) .apply_max_message_size_config( max_decoding_message_size, max_encoding_message_size, ); let res = grpc.unary(method, req).await; Ok(res) }; Box::pin(fut) } "/komp_ac.auth.AuthService/Logout" => { #[allow(non_camel_case_types)] struct LogoutSvc(pub Arc); impl< T: AuthService, > tonic::server::UnaryService for LogoutSvc { type Response = super::LogoutResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { ::logout(&inner, request).await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; let max_decoding_message_size = self.max_decoding_message_size; let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { let method = LogoutSvc(inner); let codec = tonic_prost::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( accept_compression_encodings, send_compression_encodings, ) .apply_max_message_size_config( max_decoding_message_size, max_encoding_message_size, ); let res = grpc.unary(method, req).await; Ok(res) }; Box::pin(fut) } "/komp_ac.auth.AuthService/RevokeUserSessions" => { #[allow(non_camel_case_types)] struct RevokeUserSessionsSvc(pub Arc); impl< T: AuthService, > tonic::server::UnaryService for RevokeUserSessionsSvc { type Response = super::RevokeUserSessionsResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { ::revoke_user_sessions(&inner, request) .await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; let max_decoding_message_size = self.max_decoding_message_size; let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { let method = RevokeUserSessionsSvc(inner); let codec = tonic_prost::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( accept_compression_encodings, send_compression_encodings, ) .apply_max_message_size_config( max_decoding_message_size, max_encoding_message_size, ); let res = grpc.unary(method, req).await; Ok(res) }; Box::pin(fut) } "/komp_ac.auth.AuthService/ListRoles" => { #[allow(non_camel_case_types)] struct ListRolesSvc(pub Arc); impl< T: AuthService, > tonic::server::UnaryService for ListRolesSvc { type Response = super::ListRolesResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { ::list_roles(&inner, request).await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; let max_decoding_message_size = self.max_decoding_message_size; let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { let method = ListRolesSvc(inner); let codec = tonic_prost::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( accept_compression_encodings, send_compression_encodings, ) .apply_max_message_size_config( max_decoding_message_size, max_encoding_message_size, ); let res = grpc.unary(method, req).await; Ok(res) }; Box::pin(fut) } "/komp_ac.auth.AuthService/AddRole" => { #[allow(non_camel_case_types)] struct AddRoleSvc(pub Arc); impl< T: AuthService, > tonic::server::UnaryService for AddRoleSvc { type Response = super::Role; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { ::add_role(&inner, request).await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; let max_decoding_message_size = self.max_decoding_message_size; let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { let method = AddRoleSvc(inner); let codec = tonic_prost::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( accept_compression_encodings, send_compression_encodings, ) .apply_max_message_size_config( max_decoding_message_size, max_encoding_message_size, ); let res = grpc.unary(method, req).await; Ok(res) }; Box::pin(fut) } "/komp_ac.auth.AuthService/RemoveRole" => { #[allow(non_camel_case_types)] struct RemoveRoleSvc(pub Arc); impl< T: AuthService, > tonic::server::UnaryService for RemoveRoleSvc { type Response = super::Role; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { ::remove_role(&inner, request).await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; let max_decoding_message_size = self.max_decoding_message_size; let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { let method = RemoveRoleSvc(inner); let codec = tonic_prost::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( accept_compression_encodings, send_compression_encodings, ) .apply_max_message_size_config( max_decoding_message_size, max_encoding_message_size, ); let res = grpc.unary(method, req).await; Ok(res) }; Box::pin(fut) } "/komp_ac.auth.AuthService/GrantPermission" => { #[allow(non_camel_case_types)] struct GrantPermissionSvc(pub Arc); impl< T: AuthService, > tonic::server::UnaryService for GrantPermissionSvc { type Response = super::RolePermissions; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { ::grant_permission(&inner, request).await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; let max_decoding_message_size = self.max_decoding_message_size; let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { let method = GrantPermissionSvc(inner); let codec = tonic_prost::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( accept_compression_encodings, send_compression_encodings, ) .apply_max_message_size_config( max_decoding_message_size, max_encoding_message_size, ); let res = grpc.unary(method, req).await; Ok(res) }; Box::pin(fut) } "/komp_ac.auth.AuthService/RevokePermission" => { #[allow(non_camel_case_types)] struct RevokePermissionSvc(pub Arc); impl< T: AuthService, > tonic::server::UnaryService for RevokePermissionSvc { type Response = super::RolePermissions; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { ::revoke_permission(&inner, request).await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; let max_decoding_message_size = self.max_decoding_message_size; let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { let method = RevokePermissionSvc(inner); let codec = tonic_prost::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( accept_compression_encodings, send_compression_encodings, ) .apply_max_message_size_config( max_decoding_message_size, max_encoding_message_size, ); let res = grpc.unary(method, req).await; Ok(res) }; Box::pin(fut) } "/komp_ac.auth.AuthService/ListRolePermissions" => { #[allow(non_camel_case_types)] struct ListRolePermissionsSvc(pub Arc); impl< T: AuthService, > tonic::server::UnaryService for ListRolePermissionsSvc { type Response = super::RolePermissions; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { ::list_role_permissions(&inner, request) .await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; let max_decoding_message_size = self.max_decoding_message_size; let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { let method = ListRolePermissionsSvc(inner); let codec = tonic_prost::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( accept_compression_encodings, send_compression_encodings, ) .apply_max_message_size_config( max_decoding_message_size, max_encoding_message_size, ); let res = grpc.unary(method, req).await; Ok(res) }; Box::pin(fut) } "/komp_ac.auth.AuthService/ListGrantableObjects" => { #[allow(non_camel_case_types)] struct ListGrantableObjectsSvc(pub Arc); impl< T: AuthService, > tonic::server::UnaryService for ListGrantableObjectsSvc { type Response = super::ListGrantableObjectsResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { ::list_grantable_objects(&inner, request) .await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; let max_decoding_message_size = self.max_decoding_message_size; let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { let method = ListGrantableObjectsSvc(inner); let codec = tonic_prost::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( accept_compression_encodings, send_compression_encodings, ) .apply_max_message_size_config( max_decoding_message_size, max_encoding_message_size, ); let res = grpc.unary(method, req).await; Ok(res) }; Box::pin(fut) } "/komp_ac.auth.AuthService/ListInternalErrors" => { #[allow(non_camel_case_types)] struct ListInternalErrorsSvc(pub Arc); impl< T: AuthService, > tonic::server::UnaryService for ListInternalErrorsSvc { type Response = super::ListInternalErrorsResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { ::list_internal_errors(&inner, request) .await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; let max_decoding_message_size = self.max_decoding_message_size; let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { let method = ListInternalErrorsSvc(inner); let codec = tonic_prost::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( accept_compression_encodings, send_compression_encodings, ) .apply_max_message_size_config( max_decoding_message_size, max_encoding_message_size, ); let res = grpc.unary(method, req).await; Ok(res) }; Box::pin(fut) } "/komp_ac.auth.AuthService/GetInternalError" => { #[allow(non_camel_case_types)] struct GetInternalErrorSvc(pub Arc); impl< T: AuthService, > tonic::server::UnaryService for GetInternalErrorSvc { type Response = super::InternalError; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { ::get_internal_error(&inner, request) .await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; let max_decoding_message_size = self.max_decoding_message_size; let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { let method = GetInternalErrorSvc(inner); let codec = tonic_prost::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( accept_compression_encodings, send_compression_encodings, ) .apply_max_message_size_config( max_decoding_message_size, max_encoding_message_size, ); let res = grpc.unary(method, req).await; Ok(res) }; Box::pin(fut) } "/komp_ac.auth.AuthService/AssignUserRole" => { #[allow(non_camel_case_types)] struct AssignUserRoleSvc(pub Arc); impl< T: AuthService, > tonic::server::UnaryService for AssignUserRoleSvc { type Response = super::UserSummary; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { ::assign_user_role(&inner, request).await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; let max_decoding_message_size = self.max_decoding_message_size; let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { let method = AssignUserRoleSvc(inner); let codec = tonic_prost::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( accept_compression_encodings, send_compression_encodings, ) .apply_max_message_size_config( max_decoding_message_size, max_encoding_message_size, ); let res = grpc.unary(method, req).await; Ok(res) }; Box::pin(fut) } "/komp_ac.auth.AuthService/ResetUserPassword" => { #[allow(non_camel_case_types)] struct ResetUserPasswordSvc(pub Arc); impl< T: AuthService, > tonic::server::UnaryService for ResetUserPasswordSvc { type Response = super::PasswordOperationResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { ::reset_user_password(&inner, request) .await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; let max_decoding_message_size = self.max_decoding_message_size; let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { let method = ResetUserPasswordSvc(inner); let codec = tonic_prost::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( accept_compression_encodings, send_compression_encodings, ) .apply_max_message_size_config( max_decoding_message_size, max_encoding_message_size, ); let res = grpc.unary(method, req).await; Ok(res) }; Box::pin(fut) } "/komp_ac.auth.AuthService/ListUsers" => { #[allow(non_camel_case_types)] struct ListUsersSvc(pub Arc); impl< T: AuthService, > tonic::server::UnaryService for ListUsersSvc { type Response = super::ListUsersResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { ::list_users(&inner, request).await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; let max_decoding_message_size = self.max_decoding_message_size; let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { let method = ListUsersSvc(inner); let codec = tonic_prost::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( accept_compression_encodings, send_compression_encodings, ) .apply_max_message_size_config( max_decoding_message_size, max_encoding_message_size, ); let res = grpc.unary(method, req).await; Ok(res) }; Box::pin(fut) } _ => { Box::pin(async move { let mut response = http::Response::new( tonic::body::Body::default(), ); let headers = response.headers_mut(); headers .insert( tonic::Status::GRPC_STATUS, (tonic::Code::Unimplemented as i32).into(), ); headers .insert( http::header::CONTENT_TYPE, tonic::metadata::GRPC_CONTENT_TYPE, ); Ok(response) }) } } } } impl Clone for AuthServiceServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { inner, accept_compression_encodings: self.accept_compression_encodings, send_compression_encodings: self.send_compression_encodings, max_decoding_message_size: self.max_decoding_message_size, max_encoding_message_size: self.max_encoding_message_size, } } } /// Generated gRPC service name pub const SERVICE_NAME: &str = "komp_ac.auth.AuthService"; impl tonic::server::NamedService for AuthServiceServer { const NAME: &'static str = SERVICE_NAME; } }