pub async fn authenticate_request(
req: &mut ServiceRequest,
data: &MiddlewareData
) -> Result<(), SignatureError>
Expand description
authenticate_request is a function that verifies the signature of an incoming request. Intended to allow for manual handling of authentication, or for use with other middleware.
Arguments
req
- mutable reference to the incoming requestdata
- reference to theMiddlewareData
struct
Note: This function does not add the AuthenticationInfo
struct to the request extensions.
Additionally, this function does not reject requests if the signature is invalid.
Instead, it returns a Result
with an Error
if the signature is invalid.