Skip to content

Commit

Permalink
hack: disable validation
Browse files Browse the repository at this point in the history
  • Loading branch information
Danny Browning committed Jul 23, 2024
1 parent f54e29f commit e5dda9c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions api/src/auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,9 @@ async fn verify_capability(cacao: &Capability) -> Result<(), String> {
serde_json::to_string(&cacao.payload).map_err(|e| e.to_string())?.as_bytes()
);
let sig = format!("{header}.{payload}.{}", URL_SAFE_NO_PAD.encode(cacao.signature.signature.as_bytes()));
println!("Did={:?}", jwk.key_id);
let (_header, _data) = decode_verify(&sig, &jwk).map_err(|e| e.to_string())?;
if let Err(e) = decode_verify(&sig, &jwk) {
println!("Validation failed: {}\n Sig={sig}", e);
}

Ok(())
}
Expand All @@ -122,7 +123,6 @@ async fn read_authentication(data: &str) -> Result<Authentication, String> {
if cid == root {
verify_capability(&cacao).await?;
}

cacaos.insert(cid, cacao);
}
Err(e) => {
Expand Down

0 comments on commit e5dda9c

Please sign in to comment.