Struct actix_jwt_auth_middleware::Authority
source · pub struct Authority<Claims, Algorithm, RefreshAuthorizer, Args>where
Algorithm: Algorithm,
Algorithm::SigningKey: Clone,
Algorithm::VerifyingKey: Clone,{ /* private fields */ }
Expand description
Handles the authorization of requests for the middleware as well as refreshing the access
/refresh
token.
Please referee to the AuthorityBuilder
for a detailed description of options available on this struct.
Implementations§
source§impl<Claims, Algorithm, RefreshAuthorizer, Args> Authority<Claims, Algorithm, RefreshAuthorizer, Args>where
Claims: Serialize + DeserializeOwned + Clone + 'static,
Algorithm: Algorithm + Clone,
Algorithm::SigningKey: Clone,
Algorithm::VerifyingKey: Clone,
RefreshAuthorizer: Handler<Args, Output = Result<(), Error>> + Clone,
Args: FromRequest + Clone,
impl<Claims, Algorithm, RefreshAuthorizer, Args> Authority<Claims, Algorithm, RefreshAuthorizer, Args>where
Claims: Serialize + DeserializeOwned + Clone + 'static,
Algorithm: Algorithm + Clone,
Algorithm::SigningKey: Clone,
Algorithm::VerifyingKey: Clone,
RefreshAuthorizer: Handler<Args, Output = Result<(), Error>> + Clone,
Args: FromRequest + Clone,
sourcepub fn new() -> AuthorityBuilder<Claims, Algorithm, RefreshAuthorizer, Args>
pub fn new() -> AuthorityBuilder<Claims, Algorithm, RefreshAuthorizer, Args>
Returns a new AuthorityBuilder
Returns a Clone of the cookie_signer
field on the Authority.
sourcepub async fn verify_service_request(
&self,
req: ServiceRequest
) -> AuthResult<(ServiceRequest, Option<TokenUpdate>)>
pub async fn verify_service_request(
&self,
req: ServiceRequest
) -> AuthResult<(ServiceRequest, Option<TokenUpdate>)>
Use by the [crate::AuthenticationMiddleware
]
in oder to verify an incoming request and ether hand it of to protected services
or deny the request by return a wrapped AuthError
.