casdoor_sdk_rust/cert/
models.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
use serde::{Deserialize, Serialize};

use crate::Model;

#[derive(Debug, Clone, Serialize, Deserialize, Default, PartialEq, Eq)]
#[serde(rename_all = "camelCase", default)]
pub struct Cert {
    owner: String,
    name: String,
    created_time: String,

    display_name: String,
    scope: String,
    type_: String,
    crypto_algorithm: String,
    bit_size: i32,
    expire_in_years: i32,

    certificate: String,
    private_key: String,
    authority_public_key: String,
    authority_root_public_key: String,
}

impl Model for Cert {
    fn ident() -> &'static str {
        "cert"
    }
    fn plural_ident() -> &'static str {
        "certs"
    }
    fn support_update_columns() -> bool {
        false
    }
    fn owner(&self) -> &str {
        &self.owner
    }
    fn name(&self) -> &str {
        &self.name
    }
}