pub trait CodeChallengeMethodExt {
// Required method
fn compute_challenge<'a>(
&self,
verifier: &'a str,
) -> Result<Cow<'a, str>, CodeChallengeError>;
// Provided method
fn verify(
&self,
challenge: &str,
verifier: &str,
) -> Result<(), CodeChallengeError>
where Self: Sized { ... }
}
Expand description
Helper trait to compute and verify code challenges.
Required Methods§
fn compute_challenge<'a>(
&self,
verifier: &'a str,
) -> Result<Cow<'a, str>, CodeChallengeError>
fn compute_challenge<'a>( &self, verifier: &'a str, ) -> Result<Cow<'a, str>, CodeChallengeError>
Compute the challenge for a given verifier
§Errors
Returns an error if the verifier did not adhere to the rules defined by the RFC in terms of length and allowed characters
Provided Methods§
fn verify(
&self,
challenge: &str,
verifier: &str,
) -> Result<(), CodeChallengeError>where
Self: Sized,
fn verify(
&self,
challenge: &str,
verifier: &str,
) -> Result<(), CodeChallengeError>where
Self: Sized,
Verify that a given verifier is valid for the given challenge
§Errors
Returns an error if the verifier did not match the challenge, or if the verifier did not adhere to the rules defined by the RFC in terms of length and allowed characters