pub struct ValidationUtils;Expand description
Common token exchange validation utilities
Implementations§
Source§impl ValidationUtils
impl ValidationUtils
Sourcepub fn validate_grant_type(grant_type: &str) -> Result<()>
pub fn validate_grant_type(grant_type: &str) -> Result<()>
Validate RFC 8693 grant type
Sourcepub fn validate_token_type(
token_type: &str,
supported_types: &[String],
) -> Result<()>
pub fn validate_token_type( token_type: &str, supported_types: &[String], ) -> Result<()>
Validate token type against supported types
Sourcepub fn extract_subject(metadata: &HashMap<String, Value>) -> Option<String>
pub fn extract_subject(metadata: &HashMap<String, Value>) -> Option<String>
Extract subject from token metadata
Sourcepub fn extract_scopes(
metadata: &HashMap<String, Value>,
scope_string: Option<&str>,
) -> Vec<String>
pub fn extract_scopes( metadata: &HashMap<String, Value>, scope_string: Option<&str>, ) -> Vec<String>
Extract scopes from token metadata or scope string
Sourcepub fn validate_delegation_depth(
current_depth: usize,
max_depth: usize,
) -> Result<()>
pub fn validate_delegation_depth( current_depth: usize, max_depth: usize, ) -> Result<()>
Validate delegation chain depth
Sourcepub fn normalize_token_type(token_type: &str) -> String
pub fn normalize_token_type(token_type: &str) -> String
Normalize token type URN
Sourcepub fn is_jwt_token_type(token_type: &str) -> bool
pub fn is_jwt_token_type(token_type: &str) -> bool
Check if token type is JWT-based
Auto Trait Implementations§
impl Freeze for ValidationUtils
impl RefUnwindSafe for ValidationUtils
impl Send for ValidationUtils
impl Sync for ValidationUtils
impl Unpin for ValidationUtils
impl UnwindSafe for ValidationUtils
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more