Implement Serialize, Deserialize and TryFromMultipart for Username/Password
Enable the axum feature to use it
This commit is contained in:
parent
2d1f3a985f
commit
4eb3ac6350
3 changed files with 68 additions and 7 deletions
|
|
@ -5,7 +5,7 @@ use std::collections::HashMap;
|
|||
|
||||
use crate::Username;
|
||||
|
||||
#[derive(Clone, Debug, Default, Serialize, Deserialize, PartialEq, Eq)]
|
||||
#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize)]
|
||||
pub struct SSOWatConfig {
|
||||
domains: Vec<String>,
|
||||
permissions: HashMap<PermissionName, Permission>,
|
||||
|
|
@ -32,7 +32,7 @@ impl SSOWatConfig {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq, Hash)]
|
||||
#[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
pub struct Permission {
|
||||
auth_header: bool,
|
||||
label: String,
|
||||
|
|
@ -43,7 +43,7 @@ pub struct Permission {
|
|||
users: Vec<Username>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Default, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
||||
#[derive(Clone, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, Deserialize)]
|
||||
pub struct PermissionName {
|
||||
#[serde(flatten)]
|
||||
name: String,
|
||||
|
|
|
|||
Loading…
Reference in a new issue