Repository navigation
feat(identity): Forward the status.active selector on sessions - #1071
Merged
Merged
Conversation
The milo aggregator dropped status.active from session list requests, so the sessions provider never saw the selector and returned every session. Session now has its own field label conversion that accepts status.active. UserIdentity and Passkey keep the shared conversion and still drop it.
scotwells
approved these changes
Dec 1, 2026
scotwells
left a comment
Contributor
There was a problem hiding this comment.
The change forwards the active filter only for Sessions. The forwarding tests cover it both alone and with the user filter; Passkey and UserIdentity behavior stays unchanged.
ecv
approved these changes
Dec 1, 2026
ecv
left a comment
Contributor
There was a problem hiding this comment.
Approve.
The change only adds status.active as an accepted Session field-label, so the apiserver forwards it instead of silently dropping it; it widens no scope.
sessions/rest.goList forwardsopts.FieldSelector.String()verbatim to the backend, and the identity-aware filtering and SAR check run there (auth-provider-zitadel), unchanged. A selector term can only narrow results;status.userUIDcross-user lookups already existed and keep the same backend gate.status.activeis accepted for Session only.TestInstall_StatusActiveIsSessionOnlyconfirms UserIdentity and Passkey still drop it, andstatus.providerstill drops.- Tests:
go test ./pkg/apis/identity/ ./internal/apiserver/identity/sessions/pass. With thestatus.activebranch disabled,TestInstall_SessionFieldSelectorsandTestList_ForwardsStatusActiveSelectorboth fail, so the guard is covered. - Follow-ups: the backend's handling of
status.activelives in another repo and is untested here; add a cross-repo contract test. Unknown selector terms are still silently dropped to "everything", which is how this bug hid; consider rejecting them.
This was referenced Dec 1, 2026
Contributor
Author
|
Thanks @ecv and @scotwells for the reviews! I filed both follow-ups ecv raised: #1072 for rejecting unknown selector labels, and milo-os/zitadel-provider#234 for a contract test through Milo into the provider. |
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.
Problem
Milo dropped the
status.active=truefield selector onsessions.identity.miloapis.comlist requests. The Session field label conversion accepted onlystatus.userUID,metadata.nameandmetadata.namespace, and mapped every other label to an empty term, which apimachinery treats as match-everything. The zitadel provider never saw the selector, so cloud-portal's Active Sessions page got the full list.Solution
Session now has its own conversion func that also accepts
status.active. UserIdentity and Passkey keep the shared func and still drop the label. Other labels behave as before, including the silent drop of unknown ones. New tests check the conversion per kind and that the sessions REST List forwardsstatus.active=trueto the backend, alone and withstatus.userUID.Refs milo-os/zitadel-provider#231
Refs milo-os/zitadel-provider#233