Skip to main content

wekan_cli/command_result/
auth.rs

1use serde::Serialize;
2
3#[derive(Clone, Copy, Debug, Eq, PartialEq, Serialize)]
4#[serde(rename_all = "snake_case")]
5pub enum LogoutScope {
6    CurrentToken,
7    AllTokens,
8    LocalOnly,
9}
10
11#[derive(Debug, Eq, PartialEq, Serialize)]
12pub struct LogoutSuccess {
13    pub server: String,
14    pub profile: String,
15    pub logout_scope: LogoutScope,
16    pub remote_logout_completed: bool,
17    pub credential_stored: bool,
18    pub local_credential_removed: bool,
19}
20
21#[derive(Debug, Eq, PartialEq, Serialize)]
22pub struct AuthSuccess {
23    pub server: String,
24    pub profile: String,
25    pub user_id: String,
26    pub token_expires: String,
27    pub credential_stored: bool,
28    pub profile_created: bool,
29    pub profile_active: bool,
30}
31
32#[derive(Debug, Eq, PartialEq, Serialize)]
33pub struct AuthStatusSuccess {
34    pub server: String,
35    pub profile: String,
36    pub authenticated: bool,
37    pub token_expires: String,
38    pub credential_stored: bool,
39    pub user: AuthStatusUser,
40}
41
42#[derive(Debug, Eq, PartialEq, Serialize)]
43pub struct AuthStatusUser {
44    pub user_id: String,
45    pub username: Option<String>,
46    pub full_name: Option<String>,
47    pub is_admin: Option<bool>,
48    pub emails: Vec<AuthStatusEmail>,
49}
50
51#[derive(Debug, Eq, PartialEq, Serialize)]
52pub struct AuthStatusEmail {
53    pub address: Option<String>,
54    pub verified: Option<bool>,
55}