Repository navigation
Conversation
The shared conformance suite gains verify_identity_gates, run by the Axum and Fastly runners: the configured _pubcid cookie is read and a cookie named sharedId is not (SID-1); _pubcid_optout stops reading the browser's SharedID and keeps it out of the bid request (SID-2); Purpose 4 denied with Purpose 1 granted keeps SharedID out of the record, the response and the bid request (SID-6, WB-3); Purpose 1 denied expires SharedID and its companion, and html5 storage gets no server-made SharedID (WB-3); and a cross-site POST or a GET calls no provider (ID-9). Each case has a control that shows the capture works. Requests can now turn on an ID5 provider, a capture bidder and html5 storage, and observations record the exchange's outbound requests. The Axum runner adds ID5 within and past the page-lookup deadline (ID-4) and a withdrawal after a grant whose lookup is slower than the deadline (ID-9).
…feat/1581-axum-identity-acceptance
Run held after-response tasks before asserting no late UID, and require the within-deadline response to be released before the deadline. Replace the held follow-up test, which passed with or without the withdrawal because follow-ups never run for a newly minted EC, with a grant case and a returning-reader case that has a no-withdrawal control. Check the status of the Purpose 1 only POST and of the cross-site POST and GET, build the cross-site POST from the control with only its Origin changed, and document what origin_requests counts. Signed-off-by: dhruv8sh <dhruv8sh@proton.me>
|
#1581's acceptance criteria that this PR doesn't add tests for, because PRs below it in the stack already cover them. Most of those tests are in the shared conformance suite, which the Axum runner here executes, so they already run on Axum:
These stay with the page script, #1622 (T20):
This PR adds what was missing on top of those: ID-4 on Axum, |
ChristianPavilonis
left a comment
There was a problem hiding this comment.
The shared cases give Axum and Fastly the same identity checks, and the scripted clock makes the Axum deadline tests deterministic. All 10 Axum identity conformance tests passed locally. Approved with non-blocking comments on what a few assertions prove and how the fixtures are maintained.
…feat/1581-axum-identity-acceptance Signed-off-by: dhruv8sh <dhruv8sh@proton.me> # Conflicts: # crates/trusted-server-adapter-axum/src/identity_conformance.rs # crates/trusted-server-adapter-fastly/src/identity_conformance.rs # crates/trusted-server-core/src/test_support/identity_conformance.rs
Check user.ext.eids too in the SharedID absence cases, require both opt-out expiries, prove ID5 overlaps a delayed origin fetch, assert follow-up outcomes instead of queue sizes, and count publisher forwarding apart from provider traffic. Share the ID5 provider and partner fixtures between core and Axum. Signed-off-by: dhruv8sh <dhruv8sh@proton.me>
Summary
verify_identity_gatesto the shared suite, so Fastly runs the same cases: SID-1, SID-2, SID-6, two WB-3 cases and ID-9's "calls no provider".feat/1598-ec-route-fastly), which is now on Refuse EC creation when a trusted JA4 contradicts the UA #1661, so the JA4/User-Agent rule (T12) is in this stack. ID-7 on Axum is covered by Refuse EC creation when a trusted JA4 contradicts the UA #1661's shared navigation scenarios (a non-browser JA4, another engine's JA4, current Firefox and Safari, no trusted JA4), which the Axum runner here executes; the EC route's refusal of a contradicting JA4 is in Verify EC route acceptance on Fastly and cap mirrored expiry #1662's route tests.Changes
crates/trusted-server-core/src/test_support/identity_conformance.rsverify_identity_gates. SID-1: the configured_pubcidcookie is read andsharedIdis not. SID-2:_pubcid_optoutstops reading the browser's SharedID and keeps it out of the bid request. SID-6 and WB-3: with Purpose 1 granted and Purpose 4 denied, no SharedID is set, expired or sent, whether the browser cookie is absent or different, and a browser SharedID is not read into a record that has none. The Prebid fixture comes from oneprebid_fixture(storage_type)helper, so thehtml5case differs from the cookie cases only in storage type. WB-3: Purpose 1 denied expires_pubcidand_pubcid_cst, andhtml5storage gets no server-made SharedID. ID-9: a cross-sitePOSTand aGETcall no provider and mint nothing. Each case has a control that shows the capture works: a bid request that does carry SharedID, and a POST that does call ID5. To support this,ApiRequestcan turn on an ID5 provider, a capture bidder andhtml5storage, applied by the newconfigure_api_request;ApiObservationrecords the exchange's outbound requests; and the newtcf_purposes_cookiesets Purposes 1 and 4 separately.crates/trusted-server-adapter-axum/src/identity_conformance.rsverify_identity_gates. ID-4: ID5 answering within the deadline puts its UID in the record and the mirror cookie; one past the deadline is skipped and the response goes out by the deadline. ID-9: after a grant with no EC whose page-phase ID5 lookup is slower than the deadline, the withdrawal expires the identity cookies and leaves a withdrawn record with no late UID. With anafter_responseprovider, aHoldingSchedulerholds follow-up tasks: a grant with no EC schedules one that calls no provider, and a returning reader's follow-up held across a withdrawal calls no provider and stores no UID, with a control run (no withdrawal) that does call ID5 and store its UID. Tests that assert no late UID run the held tasks first. The provider setup is shared with the existing redirect test.crates/trusted-server-adapter-fastly/src/identity_conformance.rsverify_identity_gatesand appliesconfigure_api_request.Closes
Refs #1581. Safari's one-year
Max-Agehas been verified by hand. These stay open, both in the page script (#1622):Spec
Spec: server-side identity on every adapter: ID-4, ID-7, ID-9, WB-3, WB-4, SID-1, SID-2 and SID-6 (plan ID A10). Checked against
9ea63979a: compliant for what this PR covers, with the gaps above.Test plan
cargo test-axumandcargo test-fastly(Fastly 4296 passed; Axum 128 passed, at59a5eb5d8)cargo clippy-fastly && cargo clippy-axumcargo fmt --all -- --checktcf_consent_cookieandtcf_purposes_cookie(host target)Max-Agehtml5as cookie storage, readingsharedIdinstead of the configured cookie, never reading the configured cookie, ignoring_pubcid_optoutin the SharedID cookie handling or in the auction, letting Purpose 1 alone permit EIDs, keeping SharedID when Purpose 1 is denied, calling providers on an ECGET, skipping page-lookup collection on Axum, storing EID updates without the consent gate (the SID-6 case on a record without SharedID), and dropping the live-row consent check from both after-response gates (after_response_lookups_allowedand the coordinator; either one alone still blocks the lookup).Notes for review
after_responseprovider does schedule a follow-up task after its response, so the server has that window. But follow-ups run only for an EC that existed before the request (after_response_lookups_allowed), so the grant's follow-up never calls a provider and no late UID can follow the withdrawal;follow_up_from_a_grant_with_no_ec_calls_no_providershows it. For a returning reader, whose follow-up does run, the task re-reads the row when it runs:held_follow_up_for_a_returning_reader_calls_no_provider_after_a_withdrawalholds it across a withdrawal, andheld_follow_up_for_a_returning_reader_stores_the_uidis the control. Page-phase lookups finish or are skipped before the grant's response. In the browser, the script also queues the withdrawal behind the grant._pubcid_optoutis enforced both in the SharedID cookie handling and separately in the auction (auction/endpoints.rs). The new tests cover both.ApiObservation::outboundholds every outbound request the exchange made, including the one to the publisher origin;origin_requestsis unchanged.Checklist
unwrap()in production code — useexpect("should ...")logmacros (notprintln!)