feat(status): surface full sdkKeys[]/mobileKeys[] arrays on /status#731
Open
aaron-zeisler wants to merge 1 commit into
Open
Conversation
Add a KeyStatus representation and sdkKeys[]/mobileKeys[] arrays to EnvironmentStatusRep, populated from GetAcceptedKeys() partitioned by type. Each entry carries the obscured value, the optional wire identifier, and an optional Unix-millisecond expiry. The arrays are always present (never null); a server-only environment has an empty mobileKeys. expiringSdkKey is now computed from the accepted set as the soonest- expiring non-anchor SDK key, with a (expiry, value) tie-break so the pick is deterministic when several keys share an expiry.
06b94b2 to
f063227
Compare
39df6fe to
9b4302f
Compare
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.
Note
Stacked PR — splitting #724 (review/merge bottom-up):
mobileKeys[]AcceptedKeyssdkKeys[]/mobileKeys[]on/statusBase: #730. Top of the stack — completes the #724 split.
Summary
Surface the full accepted credential set on
/statusassdkKeys[]/mobileKeys[]arrays — each entry carrying the obscured value, the optional wire identifier, and an optional Unix-millisecond expiry. The existing scalarsdkKey/mobileKeyfields are preserved and now designate which array entry is the anchor / primary.expiringSdkKeyis now computed deterministically from the accepted set: the previous code overwrote on each loop iteration (arbitrary with multiple expiring keys); it now reports the soonest-expiring non-anchor key, with a(expiry, value)tie-break.Jira: SDK-2534
Background
The concurrent-keys epic (SDK-2453) lets an environment accept multiple SDK keys and mobile keys at once. Per the backend tech spec and RAC payload spec, the
sdkKeys/mobileKeysarrays are the authoritative full accepted set, including the default/anchor key (also duplicated on the legacy scalar fields). The status endpoint mirrors that: the arrays carry every accepted key; the scalars designate the anchor / primary.The wire format carries a non-secret
keyidentifier alongside each credential'svalue(threaded through the model in #729 and exposed viaAcceptedKeys()in #730). The identifier is genuinely optional — manual configuration and old-format (pre-concurrent-keys) payloads carry none — so it is modeled as a pointer and omitted from the JSON when absent.Response schema
EnvironmentStatusRepgains two arrays plus aKeyStatuselement type. The scalar fields are unchanged.Array entry order is unspecified. The arrays are always present (never null):
sdkKeysalways contains at least the anchor;mobileKeysis empty for an environment with no mobile key (e.g. server-side only).Example (environment mid-rotation: an extra service key + an expiring key)
Changes
KeyStatusand thesdkKeys[]/mobileKeys[]fields toEnvironmentStatusRep.GetAcceptedKeys()(from feat(credential): expose the full accepted key set via AcceptedKeys #730) by type, obscuring each value, and fills the arrays (always present, never null).expiringSdkKeybecomes the soonest-expiring non-anchor SDK key viaslices.MinFunc, comparing(expiry, value)so the pick is deterministic on a tie.