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