feat: forward MaxMind device tracking_token to minFraud#39
Merged
Conversation
JoseSzycho
previously approved these changes
May 11, 2026
Plumb the browser-collected MaxMind trackingToken into the minFraud request body so the score reflects the device fingerprint captured at signup, not just IP and email. The token rides on the milo Session (annotation iam.miloapis.com/maxmind-tracking-token, populated by auth-provider-zitadel from Zitadel session metadata) — device fingerprinting is intrinsically session-scoped, not user-scoped. Key features/changes: - Add TrackingToken to provider.Input as an optional field - Resolver reads the iam.miloapis.com/maxmind-tracking-token Session annotation on the latest session for the user and populates input - MaxMind client adds device.tracking_token to the request body and builds the device block when the token is the only device-side signal present (e.g. session API was unavailable) - Test coverage: assert tracking_token is sent in the all-fields case and that a token-only input still produces a device block - Log resolved input with hasTrackingToken=bool to surface presence without leaking the token itself Missing annotation is non-fatal — fraud evaluation continues with the existing IP/email/UA signals from the User and Session.
3528be9 to
3512015
Compare
ecv
approved these changes
May 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Merge order (2 of 5)
Part of a cross-repo rollout enabling MaxMind device fingerprinting in the signup fraud check.
device.tracking_tokenplumbingSafe to merge in isolation; the new field is optional and an empty annotation is a no-op.
Summary
TrackingTokentoprovider.Inputand forward it asdevice.tracking_tokenin the minFraud request body.datasource.Resolver.resolveSessionnow reads theiam.miloapis.com/maxmind-tracking-tokenannotation on the latest milo Session (populated byauth-provider-zitadelfrom Zitadel session metadata) and populatesinput.TrackingToken.deviceblock when the token is the only device-side signal present (e.g. fresh signup with no IP/UA yet).ResolvelogshasTrackingToken=boolso we can spot misses in flight logs without leaking the token itself.End-to-end the token reaches MaxMind:
Missing annotation is non-fatal — fraud evaluation continues with IP/email/UA signals only.
Test plan
go test ./internal/provider/maxmind/... ./internal/datasource/...passes.device.tracking_tokenin the outbound minFraud body once a User is created via a session with the annotation.