Repository navigation
Conversation
ChristianPavilonis
left a comment
There was a problem hiding this comment.
Reviewed c012ddf0d against feat/s2s-eid-vendors (b990702ea). The range includes the #1712 retry-memory commit via merge dad2dce73; comments here are about this PR's own changes.
Approving so I'm not blocking, on the understanding that you'll handle the comments before merging. R1 needs a decision before this lands: it's a broader consent change than #1548 asks for, and I'd like the stack owners to agree to it explicitly or have the combined gate restored. R2 is a small retry-memory bug.
Checks: focused core tests on the touched modules.
| /// | ||
| /// Owned UIDs use their recorded owner's consent. Ownerless legacy UIDs | ||
| /// retain the source's existing aggregate vendor gates. | ||
| pub(crate) fn uid_allowed(&self, source: &str, uid: &KvUid, consent: &ConsentContext) -> bool { |
There was a problem hiding this comment.
R1 · Decision needed: owned UIDs no longer need the source's combined vendor consent. Before, every stored UID for a source was withheld unless all vendors claiming that source had consent, including disabled providers' vendors via keep_vendor_gate. Now an owned UID checks only its owner. Example: source S moves from disabled provider old (vendor B) to new (vendor A). A visitor who consents to A but not B now gets new's UIDs for S. Before, they were withheld.
Browser-sent EIDs for the same source still use the combined gate (auction/endpoints.rs:661-671), so one source now has two consent rules. from_ec_with_kinds_keeps_a_disabled_providers_gate_on_a_reassigned_source still says the source is "withheld while the disabled provider's vendor lacks consent", which no longer governs owned UIDs. The guide also lost the sentence saying the gate covered "every ID for those sources, whether a provider stored it or the browser sent it".
#1548 only asks that egress check the owner is still configured. The smallest change that keeps the old contract is providers.allows(...) && !partner.owner_vendor_consent_denied(consent). If relaxing it is a deliberate product call for the stack, that's fine, but please get the stack owners to sign off, document the stored-vs-browser difference in the guide, and update that registry test.
| ProviderLookup { | ||
| provider: registered.id.clone(), | ||
| status, | ||
| retry: status.retry_action(), |
There was a problem hiding this comment.
R2 · P3: a response whose IDs are all for GDPR-excluded sources still clears retry memory. retry is fixed here from the initial status, so a vendor that returned IDs gets RetryAction::Clear. After the merge, exclude_sources drops the GDPR-excluded sources and recount_found downgrades the status to NoMatch, but retry stays Clear, and plan_write removes the deadline. For a GDPR visitor where the vendor only returns an ID for an excluded source, the due source is retried on every navigation, which contradicts the new spec §8.3 ("an empty validated result classified as NoMatch" records an hour). In exclude_sources, when filtering turns a Found/Clear into NoMatch, set retry = RetryAction::NoMatch (leave cookie-derived Preserve and Failure alone), and add a test with only an excluded source in the response. I traced this path in the code but didn't run it.
| /// .with_provider_config(&settings.ec.identity_providers); | ||
| /// ``` | ||
| #[must_use] | ||
| pub fn with_provider_config(mut self, providers: &[IdentityProviderConfig]) -> Self { |
There was a problem hiding this comment.
R3 · Nonblocking: owner configuration exists in two copies. The policy is built once into PartnerRegistry.providers (used by plan_write, egress and admin) and again into KvIdentityGraph.providers, which is only set through the with_provider_config builder. A graph built without it skips pruning silently, and the two can disagree; the Fastly fixture had to rewrite settings.ec.identity_providers to line them up (app.rs:3765-3768). Fastly also rebuilds the graph copy per maybe_identity_graph call. Since egress is already enforced by the registry and #1548 says "pruned or not served", I'd either keep pruning only in plan_write and admin and drop the graph-level copy, or pass the registry's ConfiguredProviders into the graph as a required argument.
| if !record.is_provider_written() { | ||
| return true; | ||
| } | ||
| let mut entry = KvEntry::tombstone(created); |
There was a problem hiding this comment.
R4 · Nonblocking: owner and lifetime sanitizing is duplicated. normalize_provider_expiries(); prune_unconfigured_owners(...) appears here, in kv.rs prepare_entry and entry_for_write, and in write_plan.rs:70-71. KvPartnerId::retain_uids is a fourth copy of the retain/drop-empty/resync shape in prune_expired, retain_readable and drop_last_uid. This function also wraps one record in a fake KvEntry::tombstone just to reach entry-level pruning, and the ownerless gate in eids.rs:133-137 repeats uid_allowed's ownerless branch. A record-level retain_servable, one KvEntry helper running both steps, and a single ownerless gate would cover all of it.
| "should mark {source}" | ||
| ); | ||
| } | ||
| registry.providers = super::super::registry::ConfiguredProviders::new(&[ |
There was a problem hiding this comment.
R5 · Nonblocking: owner-policy fixtures are copied ten times. This registry.providers = ConfiguredProviders::new(&[serde_json::from_value(json!({...}))]) shape repeats across write_plan, identify (×4), eids, coordinator, after_response and admin (×2), mostly as single lines over 100 columns that rustfmt can't wrap. providers is pub(crate) largely so tests can overwrite it. One test helper (for example test_support::owner_registry(...)) with a multi-line json! would cut this and let providers go private.
| matches!(only_status(&results), LookupStatus::Found { .. }), | ||
| "should make a fresh lookup for the new owner" | ||
| ); | ||
| assert!( |
There was a problem hiding this comment.
R6 · Nits: this should be assert_eq!(transport.sent.borrow().len(), 1, ...). Also: seven new tests have no blank line before them (validate.rs:513, eids.rs:457, identify.rs:1199, kv.rs:4823, write_plan.rs:1729, admin.rs:1794, coordinator/mod.rs:5020), 18 added lines exceed 100 columns (the R5 fixtures), several new tests skip the Arrange/Act/Assert layout AGENTS.md asks for, and the "#1488 is gated on #1547" note in docs/guide/configuration.md:1021 and spec §8.3 is process state that goes stale once the stack merges.
Summary
Base and scope
Targets
feat/s2s-eid-vendors, starting at #1488 headb990702eaaaaaa8e0000723c78b5994bd91f28d5. That branch already introducesMAX_EXPIRY_SECSand clamps absolute and relative provider expiries. The approved dependency mergedad2dce732b9b64d0640453f40d48daf299fb4deincorporates #1712 / #1547 retry memory before this change. Neithermainnorrc/identityis the base or target.The mirror does not exist on this base. Separately reviewed companion changes on
fix/1548-provider-uid-mirror-compat, targeting #1489'sfeat/s2s-eid-collection-providers, cover mirror construction, retained-cookie fallback, and synthesized pull-sync owners. Merge that companion as part of integrating the identity stack to complete mirror coverage; this core change does not import #1489 or later Axum support.Behavior before and after
Previously, an unspecified provider expiry became
Expiry::Never. Any live provider UID at a source suppressed lookup, even if another provider owned it. Egress checked current source configuration, so removing or renaming a provider could leave its stored UID served indefinitely and prevent the new owner from acquiring an identity.Now validation defaults an unspecified UID expiry to the existing 30-day maximum and preserves the existing
At/Afterclamps. The constant is shared fromec/eid_types.rs. An unspecified refresh time still schedules no refresh. Lookup eligibility, generated IDs and cookie deduplication distinguish owners; a former owner's UID, expiry or private refresh state cannot satisfy or block the new owner.Owned UIDs require a configured owner that still claims the source and passes its own vendor-consent gate. Disabled providers remain configured. Matching duplicate disabled-owner policies retain every applicable vendor gate. Ownerless browser/batch records retain their existing source-level rules. Source GDPR exclusions, cookie opt-outs, revocations, retry memory and conditional-write protections remain in force.
Orphaned owners are withheld immediately and physically pruned on the next successful write. Cleanup resynchronizes the legacy
record.uidalias and covers page-load, after-response, create/revive, partner/batch upsert, legacy pull-sync enrichment and identify's cluster-cache writes. Pruning accompanies real writes rather than introducing a separate cleanup write.Egress coverage
user.eidsfrom/auctionand page-bidslive_eidsand the shared filtered EID viewx-ts-eidsuidandeidlive_eidsA carried mirror contains no owner metadata. If its row or request clock cannot establish current eligibility, the companion expires it. This can clear an otherwise valid cookie during a read/clock failure or non-navigation response without a clock; a later successful navigation rebuilds it.
Existing rows and rollback
New provider results record additive optional
acquired_atmetadata. Effective expiry is the earlier of the stated deadline and acquisition plusMAX_EXPIRY_SECS. Existing owned UIDs without acquisition metadata useKvEntry.createdas a fixed anchor, includingNeverand overlong absolute expiries. Repeated reads do not extend that deadline; no migration is needed.The conservative fallback can immediately expire a legacy UID acquired recently on a much older row, because its true acquisition time was never stored. New results on old rows use their own acquisition timestamp. Older binaries ignore and may discard
acquired_atwhen rewriting rows, causing upgraded readers to use the conservative fallback again. Ownerless IDs are unaffected.Changes
The diff includes prerequisite #1547 / #1712 retry memory through the signed dependency merge; the table identifies that inherited behavior alongside #1548.
crates/trusted-server-adapter-fastly/src/app.rscrates/trusted-server-adapter-fastly/src/main.rscrates/trusted-server-core/src/ec/admin.rscrates/trusted-server-core/src/ec/after_response.rscrates/trusted-server-core/src/ec/coordinator/mod.rscrates/trusted-server-core/src/ec/coordinator/results.rscrates/trusted-server-core/src/ec/coordinator/validate.rscrates/trusted-server-core/src/ec/eid_types.rscrates/trusted-server-core/src/ec/eids.rscrates/trusted-server-core/src/ec/identify.rsuidandeidthrough the shared stored-UID policy.crates/trusted-server-core/src/ec/kv.rscrates/trusted-server-core/src/ec/kv_types.rscrates/trusted-server-core/src/ec/registry.rscrates/trusted-server-core/src/ec/write_plan.rscrates/trusted-server-core/src/test_support.rsdocs/guide/configuration.mddocs/superpowers/specs/2026-10-30-s2s-eid-collection-design.mdCloses
Closes #1548
Spec
Updated existing collection design, especially validation, disabled providers, the no-expiry acceptance scenario and mirror policy.
Test plan
Core implementation commit:
ead6159013767c782f6bacce7e4e60df1e12635f. Its committed tree exactly matches the reviewed and tested working tree.Rust 1.98.1 and Node 24.20.0 were used. Fastly tests used Viceroy 0.22.0, matching the actual worktree
.tool-versionspin.cargo test --locked -p trusted-server-core --lib ec::— 662 passed.cargo clippy --locked -p trusted-server-core --all-targets --all-features -- -D warnings.cargo clippy --locked -p trusted-server-core --lib --all-features --target wasm32-wasip1 -- -D warnings.cargo test --locked -p trusted-server-adapter-fastly --target wasm32-wasip1 ec— 62 passed; one existing deadline-network fixture ignored because it needs its separate origin harness.cargo clippy --locked -p trusted-server-adapter-fastly --all-targets --all-features --target wasm32-wasip1 -- -D warnings.ignoreexamples.Independent review and runtime evidence
Review corrections through
c012ddf0dcce3464e2d7311fd3fb6ae00e2c70bfpreserve cookie IDs alongside another source's failed lookup and record its one-hour or five-minute retry interval, including request-build failures. Cookie-only updates preserve the deadline; successful lookups/generated results and fresh opt-outs clear it. Filtering all cookie IDs preserves the actual failure interval. Admin diagnostics now reportprovider_policyfor owner/lifetime exclusions; guidance matches retry-only writes, bounded lifetimes and opaque-body withholding. The final correction passed 667 native EC tests and all-target/all-feature core Clippy under the pinned toolchain. Fail-first regressions distinguish the lost deadline, changed-cookie clearing, filtered-result interval and request-build path. Formatting passes. All 25 current-revision hosted checks pass. Checkout logs confirm the tested merge includes headc012ddf0dcce3464e2d7311fd3fb6ae00e2c70bfand live basebfdd19b077d67d697e85408f8974aae5442d7a0e; the API workflow base field retains historicalb990702eaaaaaa8e0000723c78b5994bd91f28d5.Local Axum runtime verdict: VERIFIED for the approved integration-overlay scope. The #1488 Axum adapter itself rejects providers. Verification therefore used native-support revision
6b4a5fdc0aca527eed1f8842eb7b87b89cca6cf8with the core and mirror changes applied in a disposable worktree; that later adapter support is not included here.The real Axum application served localhost HTTP with persistent EC records and scripted provider, origin and bidder transport at example hosts. A seeded UID had no expiry and carried the old owner's private refresh state. Positive controls first observed it in actual bidder OpenRTB EIDs,
/auctionresponsex-ts-eids, authenticated identify and mirror output.Disabling the shared owner checks only in the disposable copy makes the pre-write identify assertion fail. Restoring the exact source reproduces both positive scenarios. Every positive-run listener was stopped and verified closed; the disposable runtime worktree was removed after preserving the patch and sanitized evidence.
This proves the local application route/storage/serialization flow with controlled upstreams. It does not claim browser behavior, live provider TLS/API validation, deployed behavior, or that unmodified #1488 supports providers on Axum. The 30-day boundary is established by targeted tests rather than waiting 30 days in the runtime probe. No browser, DataDome bypass, remote proxy task, real credential or operator configuration was used.
Checklist
unwrap().