casdoor_sdk_rust/provider/
models.rs

1use std::collections::HashMap;
2
3use serde::{Deserialize, Serialize};
4
5use crate::Model;
6
7#[derive(Debug, Clone, Serialize, Deserialize, Default, PartialEq, Eq)]
8#[serde(rename_all = "camelCase", default)]
9pub struct Provider {
10    owner: String,
11    name: String,
12    created_time: String,
13
14    display_name: String,
15    category: String,
16    type_: String,
17    sub_type: String,
18    method: String,
19    client_id: String,
20    client_secret: String,
21    client_id2: String,
22    client_secret2: String,
23    cert: String,
24    custom_auth_url: String,
25    custom_token_url: String,
26    custom_user_info_url: String,
27    custom_logo: String,
28    scopes: String,
29    user_mapping: HashMap<String, String>,
30
31    host: String,
32    port: i32,
33    disable_ssl: bool, // If the provider type is WeChat, DisableSsl means EnableQRCode
34    title: String,
35    content: String, // If provider type is WeChat, Content means QRCode string by Base64 encoding
36    receiver: String,
37
38    region_id: String,
39    sign_name: String,
40    template_code: String,
41    app_id: String,
42
43    endpoint: String,
44    intranet_endpoint: String,
45    domain: String,
46    bucket: String,
47    path_prefix: String,
48
49    metadata: String,
50    idp: String,
51    issuer_url: String,
52    enable_sign_authn_request: bool,
53
54    provider_url: String,
55}
56
57impl Model for Provider {
58    fn ident() -> &'static str {
59        "provider"
60    }
61    fn plural_ident() -> &'static str {
62        "providers"
63    }
64    fn support_update_columns() -> bool {
65        false
66    }
67    fn owner(&self) -> &str {
68        &self.owner
69    }
70    fn name(&self) -> &str {
71        &self.name
72    }
73}