pub struct FapiManager { /* private fields */ }Expand description
FAPI 2.0 Security Profile Manager
Implementations§
Source§impl FapiManager
impl FapiManager
Sourcepub fn new(
config: FapiConfig,
dpop_manager: Arc<DpopManager>,
mtls_manager: Arc<MutualTlsManager>,
par_manager: Arc<PARManager>,
private_key_jwt_manager: Arc<PrivateKeyJwtManager>,
jwt_validator: Arc<SecureJwtValidator>,
) -> Self
pub fn new( config: FapiConfig, dpop_manager: Arc<DpopManager>, mtls_manager: Arc<MutualTlsManager>, par_manager: Arc<PARManager>, private_key_jwt_manager: Arc<PrivateKeyJwtManager>, jwt_validator: Arc<SecureJwtValidator>, ) -> Self
Create a new FAPI manager
Validate FAPI 2.0 authorization request
Sourcepub async fn authenticate_client_jwt(
&self,
client_assertion: &str,
) -> Result<String>
pub async fn authenticate_client_jwt( &self, client_assertion: &str, ) -> Result<String>
Authenticate client using private key JWT (RFC 7523)
Sourcepub async fn validate_token_request(
&self,
client_assertion: Option<&str>,
client_cert: Option<&str>,
dpop_proof: Option<&str>,
authorization_code: &str,
) -> Result<String>
pub async fn validate_token_request( &self, client_assertion: Option<&str>, client_cert: Option<&str>, dpop_proof: Option<&str>, authorization_code: &str, ) -> Result<String>
Validate FAPI token request with enhanced security
Generate FAPI 2.0 authorization response (JARM)
Sourcepub async fn generate_token_response(
&self,
client_id: &str,
user_id: &str,
scopes: Vec<String>,
cert_thumbprint: Option<String>,
dpop_jkt: Option<String>,
) -> Result<FapiTokenResponse>
pub async fn generate_token_response( &self, client_id: &str, user_id: &str, scopes: Vec<String>, cert_thumbprint: Option<String>, dpop_jkt: Option<String>, ) -> Result<FapiTokenResponse>
Generate FAPI 2.0 token response
Sourcepub async fn create_session(
&self,
client_id: &str,
user_id: &str,
scopes: Vec<String>,
dpop_proof: Option<String>,
cert_thumbprint: Option<String>,
request_jti: Option<String>,
) -> Result<String>
pub async fn create_session( &self, client_id: &str, user_id: &str, scopes: Vec<String>, dpop_proof: Option<String>, cert_thumbprint: Option<String>, request_jti: Option<String>, ) -> Result<String>
Create FAPI session
Sourcepub async fn get_session(&self, session_id: &str) -> Result<Option<FapiSession>>
pub async fn get_session(&self, session_id: &str) -> Result<Option<FapiSession>>
Get FAPI session
Sourcepub async fn validate_session(&self, session_id: &str) -> Result<FapiSession>
pub async fn validate_session(&self, session_id: &str) -> Result<FapiSession>
Validate FAPI session
Sourcepub async fn remove_session(&self, session_id: &str) -> Result<()>
pub async fn remove_session(&self, session_id: &str) -> Result<()>
Remove FAPI session
Sourcepub async fn audit_log(&self, event: &str, details: &Value) -> Result<()>
pub async fn audit_log(&self, event: &str, details: &Value) -> Result<()>
Audit log entry for FAPI compliance
Sourcepub fn check_compliance(&self) -> Vec<FapiComplianceViolation>
pub fn check_compliance(&self) -> Vec<FapiComplianceViolation>
Validate FAPI 2.0 compliance of the current configuration.
Returns a list of compliance violations. An empty list means the configuration is fully FAPI 2.0 compliant.
Sourcepub fn is_compliant(&self) -> bool
pub fn is_compliant(&self) -> bool
Returns true if the configuration is fully FAPI 2.0 compliant (no critical violations).
Sourcepub async fn validate_sender_constrained_token(
&self,
access_token: &str,
dpop_proof: Option<&str>,
client_cert: Option<&str>,
http_method: &str,
http_uri: &str,
) -> Result<Value>
pub async fn validate_sender_constrained_token( &self, access_token: &str, dpop_proof: Option<&str>, client_cert: Option<&str>, http_method: &str, http_uri: &str, ) -> Result<Value>
Validate a sender-constrained access token at a resource server.
Verifies that the token’s cnf claim matches the presented proof
(DPoP proof JKT or mTLS certificate thumbprint).
Validate a Rich Authorization Request (RFC 9396) authorization_details parameter.
Trait Implementations§
Source§impl Clone for FapiManager
impl Clone for FapiManager
Source§fn clone(&self) -> FapiManager
fn clone(&self) -> FapiManager
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for FapiManager
impl !RefUnwindSafe for FapiManager
impl Send for FapiManager
impl Sync for FapiManager
impl Unpin for FapiManager
impl UnsafeUnpin for FapiManager
impl !UnwindSafe for FapiManager
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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