cross server client

This commit is contained in:
Priec
2026-09-03 10:42:36 +02:00
parent 0d20546787
commit 0db358c075
6 changed files with 109 additions and 5 deletions

View File

@@ -1,7 +1,8 @@
use anyhow::{Context, Result};
use common::proto::komp_ac::auth::{
AddRoleRequest, AssignUserRoleRequest, AuthResponse, AuthorizationSnapshot,
ChangePasswordRequest, GetAuthorizationRequest, GetInternalErrorRequest, GrantPermissionRequest,
ChangePasswordRequest, GetAuthorizationRequest, GetInternalErrorRequest,
GetServerIdentityRequest, GrantPermissionRequest,
GrantableObject, InternalError, ListGrantableObjectsRequest, ListInternalErrorsRequest,
ListInternalErrorsResponse, ListRolePermissionsRequest, ListRolesRequest,
ListUsersRequest, LoginRequest, LoginResponse, LogoutRequest, PasswordOperationResponse,
@@ -58,6 +59,15 @@ impl AuthClient {
})
}
pub async fn get_server_identity(&mut self) -> Result<String> {
Ok(self
.client
.get_server_identity(Request::new(GetServerIdentityRequest {}))
.await?
.into_inner()
.instance_id)
}
pub async fn login(&mut self, identifier: String, password: String) -> Result<LoginResponse> {
Ok(self
.client