Skip to content

tmpclient: add temporal decorrelation between context and identity requests #72

@bokelley

Description

@bokelley

The current tmpclient fires ContextMatch and IdentityMatch independently, but the two calls travel with nearly identical timing. A network observer correlating arrival times at the router and identity agent can re-link them even when they're sent in parallel.

Add an optional randomized delay (jitter) on the identity request to decorrelate the two calls. Suggested surface:

  • WithDecorrelationMax(max time.Duration) Option — upper bound on the delay (default: off, recommend 5ms when enabled)
  • Delay drawn from [0, max) via crypto/rand (not math/rand) before sending the identity request

Prior design lived in closed PR #9 (client/ package). That PR used math/rand/v2; we should use crypto/rand for this since it's privacy-adjacent.

Acceptance

  • Option is off by default (no behavior change)
  • When set, identity request is delayed by a random duration in [0, max)
  • Test asserts delay occurs and is bounded
  • No impact on context request timing

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions