TokenStore
Bearer-token authority for HttpTransport.
Holds one primary token (the value surfaced as DroidMcp.serverToken and embedded in the pairing QR) plus any number of paired-client tokens, each tied to an opaque host-supplied label so it can be revoked individually.
verify returns the label that owns a presented token, or
nullif none matches — callers use the label for audit attribution.rotatePrimary mints a fresh primary, invalidating the old one. Paired clients are unaffected.
All comparisons are constant-time over each candidate token so a presented value can't be recovered byte-by-byte via timing. The number of paired clients is small and host-controlled, so iterating them is not a concern.
Thread-safe: the primary is @Volatile, clients live in a ConcurrentHashMap.
Functions
Snapshot of paired clients (does not include the primary), oldest first. Ties on PairedClient.createdAt (two pairings within the same millisecond) break deterministically on the unique label, so the order is stable rather than dependent on map iteration order.
Replace the primary token with a fresh value and return it.