mirror of
https://git.proxmox.com/git/proxmox
synced 2025-07-26 04:38:10 +00:00
cleanup: move BasicRealmInfo to pbs-api-types
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
This commit is contained in:
parent
842a39af35
commit
346e422237
@ -442,3 +442,44 @@ pub enum RRDTimeFrame {
|
|||||||
/// Decade (10 years)
|
/// Decade (10 years)
|
||||||
Decade,
|
Decade,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[api]
|
||||||
|
#[derive(Deserialize, Serialize, PartialEq, Eq)]
|
||||||
|
#[serde(rename_all = "lowercase")]
|
||||||
|
/// type of the realm
|
||||||
|
pub enum RealmType {
|
||||||
|
/// The PAM realm
|
||||||
|
Pam,
|
||||||
|
/// The PBS realm
|
||||||
|
Pbs,
|
||||||
|
/// An OpenID Connect realm
|
||||||
|
OpenId,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[api(
|
||||||
|
properties: {
|
||||||
|
realm: {
|
||||||
|
schema: REALM_ID_SCHEMA,
|
||||||
|
},
|
||||||
|
"type": {
|
||||||
|
type: RealmType,
|
||||||
|
},
|
||||||
|
comment: {
|
||||||
|
optional: true,
|
||||||
|
schema: SINGLE_LINE_COMMENT_SCHEMA,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
)]
|
||||||
|
#[derive(Deserialize, Serialize)]
|
||||||
|
#[serde(rename_all = "kebab-case")]
|
||||||
|
/// Basic Information about a realm
|
||||||
|
pub struct BasicRealmInfo {
|
||||||
|
pub realm: String,
|
||||||
|
#[serde(rename = "type")]
|
||||||
|
pub ty: RealmType,
|
||||||
|
/// True if it is the default realm
|
||||||
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
|
pub default: Option<bool>,
|
||||||
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
|
pub comment: Option<String>,
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user