using unified system

This commit is contained in:
Filipriec
2026-08-30 07:49:19 +02:00
parent 80d61760a2
commit 408187cb57
30 changed files with 2754 additions and 225 deletions

View File

@@ -1,4 +1,5 @@
// This file is @generated by prost-build.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct RegisterRequest {
#[prost(string, tag = "1")]
@@ -16,6 +17,7 @@ pub struct RegisterRequest {
#[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
@@ -31,6 +33,7 @@ pub struct AuthResponse {
#[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")]
@@ -40,8 +43,10 @@ pub struct ChangePasswordRequest {
#[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
@@ -50,6 +55,7 @@ pub struct LoginRequest {
#[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
@@ -76,30 +82,38 @@ pub struct LoginResponse {
#[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:
@@ -115,6 +129,7 @@ pub struct Permission {
#[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")]
@@ -123,6 +138,7 @@ pub struct AuthorizationSnapshot {
#[prost(message, repeated, tag = "2")]
pub permissions: ::prost::alloc::vec::Vec<Permission>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Role {
#[prost(string, tag = "1")]
@@ -136,13 +152,16 @@ pub struct Role {
#[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<Role>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct AddRoleRequest {
#[prost(string, tag = "1")]
@@ -151,11 +170,13 @@ pub struct AddRoleRequest {
#[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")]
@@ -165,6 +186,7 @@ pub struct GrantPermissionRequest {
#[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")]
@@ -174,11 +196,13 @@ pub struct RevokePermissionRequest {
#[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")]
@@ -190,6 +214,7 @@ pub struct RolePermissions {
#[prost(message, repeated, tag = "3")]
pub effective_permissions: ::prost::alloc::vec::Vec<Permission>,
}
#[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
@@ -197,6 +222,7 @@ pub struct ListGrantableObjectsRequest {
#[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
@@ -216,11 +242,13 @@ pub struct GrantableObject {
#[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<GrantableObject>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct AssignUserRoleRequest {
#[prost(string, tag = "1")]
@@ -228,6 +256,7 @@ pub struct AssignUserRoleRequest {
#[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")]
@@ -237,6 +266,7 @@ pub struct ResetUserPasswordRequest {
#[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")]
@@ -248,8 +278,10 @@ pub struct UserSummary {
#[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")]