src
@ -7,12 +7,6 @@ use std::collections::HashMap;
|
||||
#[derive(Clone, Debug, serde::Serialize, serde::Deserialize, Eq, PartialEq)]
|
||||
pub struct ClientID(pub String);
|
||||
|
||||
#[derive(Debug, Copy, Clone, Eq, PartialEq)]
|
||||
pub enum AuthenticationFlow {
|
||||
AuthorizationCode,
|
||||
Implicit,
|
||||
}
|
||||
|
||||
pub type AdditionalClaims = HashMap<String, Value>;
|
||||
|
||||
#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)]
|
||||
@ -61,12 +55,9 @@ impl PartialEq for Client {
|
||||
impl Eq for Client {}
|
||||
|
||||
impl Client {
|
||||
/// Get the client authentication flow
|
||||
pub fn auth_flow(&self) -> AuthenticationFlow {
|
||||
match self.secret {
|
||||
None => AuthenticationFlow::Implicit,
|
||||
Some(_) => AuthenticationFlow::AuthorizationCode,
|
||||
}
|
||||
/// Check if the client has a secret defined
|
||||
pub fn has_secret(&self) -> bool {
|
||||
self.secret.is_some()
|
||||
}
|
||||
|
||||
/// Process a single claim value
|
||||
|
Reference in New Issue
Block a user