chore: import MCTF services

- Added all seven issued service trees without omissions.
- Preserved the supplied runtime configuration, binaries, and assets.
This commit is contained in:
TakuyaYagam1 committed 2026-11-29 12:25:29 +03:00
commit 13f936bee9
1222 files changed
+21280

No files matched your search

+99
View File
@@ -0,0 +1,99 @@
use chrono::NaiveDateTime;
use serde::{Deserialize, Serialize};
use uuid::Uuid;
use crate::models::Role;
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct AuthRequest {
pub username: String,
pub password: String,
}
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct AuthResponse {
pub token: String,
}
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct CheckAuthRequest {
pub token: String,
}
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct MeResponse {
pub username: String,
pub workspace_id: Option<Uuid>,
}
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct NewAuthPolicy {
pub name: String,
pub content: String,
}
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct ChangePasswordRequest {
pub current_password: String,
pub new_password: String,
}
#[derive(Deserialize, Serialize)]
pub struct NewFile {
name: String,
content: String,
}
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
pub struct FileResponse {
pub id: Uuid,
pub name: String,
pub size: i64,
pub is_public: bool,
pub owner: String,
pub created_at: NaiveDateTime,
#[serde(default)]
pub shared: bool,
}
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct WorkspaceParticipantResponse {
pub id: Uuid,
pub username: String,
pub role: Role,
}
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct MyWorkspaceResponse {
pub id: Uuid,
pub name: String,
pub description: Option<String>,
pub participants: Vec<WorkspaceParticipantResponse>,
pub auth_policy: Option<String>,
}
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct NewWorkspace {
pub name: String,
pub description: Option<String>,
}
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct WorkspaceResponse {
pub id: Uuid,
pub name: String,
pub description: Option<String>,
}
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct AddUserRequest {
pub username: String,
}
#[derive(Deserialize, Serialize)]
pub struct NewSession {
pub user_id: Uuid,
pub cookie: String,
pub expires_at: NaiveDateTime,
}