Skip to content

Commit

Permalink
fix clippy errors
Browse files Browse the repository at this point in the history
  • Loading branch information
aumetra committed Dec 13, 2024
1 parent ef555b7 commit 8fa1a9c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/komainu/src/authorize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ where
let client_scopes = client
.scopes
.iter()
.map(|scope| scope.borrow())
.map(Borrow::borrow)
.collect::<HashSet<_>>();

if !request_scopes.is_subset(&client_scopes) {
Expand All @@ -74,7 +74,7 @@ where

let pkce_payload = if let Some(challenge) = query.get("code_challenge") {
let method = if let Some(method) = query.get("challenge_code_method") {
PkceMethod::from_str(*method).map_err(Error::query)?
PkceMethod::from_str(method).map_err(Error::query)?
} else {
PkceMethod::default()
};
Expand Down
3 changes: 1 addition & 2 deletions lib/komainu/src/flow/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ impl PkcePayload<'_> {
#[inline]
fn verify_s256(&self, code_verifier: &str) -> Result<()> {
let decoded = base64_simd::URL_SAFE
.decode_to_vec(code_verifier)
.decode_to_vec(self.challenge.as_bytes())
.inspect_err(|error| debug!(?error, "failed to decode pkce payload"))
.map_err(Error::body)?;

Expand All @@ -58,7 +58,6 @@ impl PkcePayload<'_> {
#[inline]
fn verify_none(&self, code_verifier: &str) -> Result<()> {
let challenge_bytes = self.challenge.as_bytes();

if challenge_bytes.ct_eq(code_verifier.as_bytes()).into() {
Ok(())
} else {
Expand Down

0 comments on commit 8fa1a9c

Please sign in to comment.