Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion crates/trusted-server-adapter-axum/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,8 @@ fn named_route_handler(
handle_first_party_proxy(&state.settings, &services, &ec.context, req).await
}
NamedRouteHandler::FirstPartyClick => {
handle_first_party_click(&state.settings, &services, req).await
let ec = state.identity.read_request(&services, &req)?;
handle_first_party_click(&state.settings, &services, &ec.context, req).await
}
NamedRouteHandler::FirstPartySign => {
handle_first_party_proxy_sign(&state.settings, &services, req).await
Expand Down
3 changes: 2 additions & 1 deletion crates/trusted-server-adapter-cloudflare/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,8 @@ fn router_builder(state: &Arc<AppState>) -> RouterBuilder {
.get(
"/first-party/click",
make_handler(Arc::clone(&state), |s, services, req| async move {
handle_first_party_click(&s.settings, &services, req).await
let ec_context = build_ec_context(&s.settings, &services, &req);
handle_first_party_click(&s.settings, &services, &ec_context, req).await
}),
)
.get(
Expand Down
2 changes: 1 addition & 1 deletion crates/trusted-server-adapter-fastly/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -768,7 +768,7 @@ async fn run_named_route(
handle_first_party_proxy(&state.settings, services, &ec.ec_context, req).await
}
NamedRouteHandler::FirstPartyClick => {
handle_first_party_click(&state.settings, services, req).await
handle_first_party_click(&state.settings, services, &ec.ec_context, req).await
}
NamedRouteHandler::FirstPartySign => {
handle_first_party_proxy_sign(&state.settings, services, req).await
Expand Down
3 changes: 2 additions & 1 deletion crates/trusted-server-adapter-spin/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -726,8 +726,9 @@ fn router_builder(state: &Arc<AppState>) -> RouterBuilder {
async move {
let services = s.services_for_request(&ctx)?;
let req = ctx.into_request()?;
let ec_context = build_ec_context(&s.settings, &services, &req);
Ok::<Response, EdgeError>(
handle_first_party_click(&s.settings, &services, req)
handle_first_party_click(&s.settings, &services, &ec_context, req)
.await
.unwrap_or_else(|e| http_error(&e)),
)
Expand Down
6 changes: 5 additions & 1 deletion crates/trusted-server-core/src/consent/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,11 @@ pub(crate) fn allows_eid_persistence(ctx: &ConsentContext) -> bool {
}
}

/// Decide whether current-request consent permits creative proxy EC disclosure.
/// Decide whether current-request consent permits disclosing the EC ID to a third party.
///
/// Used by creative proxy fetches and first-party click redirects. Requires
/// unexpired consent, no GPC signal in any jurisdiction, EC creation consent
/// and EID persistence consent, including TCF Purposes 1 and 4 where applicable.
#[must_use]
pub(crate) fn allows_proxy_ec_disclosure(ctx: &ConsentContext) -> bool {
!ctx.expired && !ctx.gpc && allows_ec_creation(ctx) && allows_eid_persistence(ctx)
Expand Down
Loading
Loading