pub struct AuthState {
pub oidc_client: OidcClient,
pub resource_server: ResourceServerClient,
pub client_config: OidcClientConfig,
pub config: AuthConfig,
pub pkce_manager: PkceCookieManager,
pub session_manager: Arc<WebSessionManager>,
}Expand description
Shared authentication state, stored in ServerState.
Fields§
§oidc_client: OidcClientOIDC client for login flow (authorization code + PKCE)
resource_server: ResourceServerClientResource server client for JWT validation (lazy-initialized)
client_config: OidcClientConfigOIDC client configuration
config: AuthConfigAuth configuration
pkce_manager: PkceCookieManagerStateless PKCE cookie manager
session_manager: Arc<WebSessionManager>Web session manager (cookie session_id → server-side token with auto-refresh)
Implementations§
Source§impl AuthState
impl AuthState
Sourcepub fn new(config: AuthConfig) -> Self
pub fn new(config: AuthConfig) -> Self
Create new auth state from configuration.
Sourcepub fn is_dev_mode(&self) -> bool
pub fn is_dev_mode(&self) -> bool
Check if development mode is enabled.
Sourcepub async fn validate_token(&self, token: &str) -> Result<JwtClaims>
pub async fn validate_token(&self, token: &str) -> Result<JwtClaims>
Validate a JWT token using PEP’s ResourceServerClient.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for AuthState
impl !UnwindSafe for AuthState
impl Freeze for AuthState
impl Send for AuthState
impl Sync for AuthState
impl Unpin for AuthState
impl UnsafeUnpin for AuthState
Blanket Implementations§
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