Skip to content

Commit

Permalink
fix: verify aud
Browse files Browse the repository at this point in the history
  • Loading branch information
chris13524 committed Jan 29, 2024
1 parent 00b4e1f commit ad5b8c3
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/services/public_http_server/handlers/relay_webhook/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ use {
},
},
serde_json::json,
std::{sync::Arc, time::Instant},
std::{collections::HashSet, sync::Arc, time::Instant},
thiserror::Error,
tracing::{error, info, instrument, warn},
};
Expand Down Expand Up @@ -95,11 +95,9 @@ pub async fn handler(
let claims = WatchEventClaims::try_from_str(&payload.event_auth)
.map_err(|e| Error::ClientError(ClientError::ParseWatchEvent(e)))?;

// TODO verify audience
// let aud = HashSet::new();
// claims
// .verify_basic(&aud, None)
// .map_err(|e| Error::ClientError(ClientError::VerifyWatchEvent(e)))?;
claims
.verify_basic(&HashSet::from([state.config.notify_url.to_string()]), None)
.map_err(|e| Error::ClientError(ClientError::VerifyWatchEvent(e)))?;

// TODO verify issuer
// if claims.basic.iss != state.config.relay_identity {
Expand Down

0 comments on commit ad5b8c3

Please sign in to comment.