cross server client
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user