feat: add an all-packages match mode to the client delegation clients endpoints - #3914
Open
howieandersen wants to merge 1 commit into
Open
feat: add an all-packages match mode to the client delegation clients endpoints#3914howieandersen wants to merge 1 commit into
howieandersen wants to merge 1 commit into
Conversation
howieandersen
requested review from
Thuen,
andreasisnes,
jonkjetiloye and
lovoll
August 17, 2026 15:29
Copilot stopped reviewing on behalf of
howieandersen due to an error
August 17, 2026 15:51
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.
The two clients endpoints in the client delegation APIs disagree on package filter semantics: the internal v1
systemuserclientdelegation/clientshas matched the intersection since the EF rewrite (a client must hold every requested package, role packages and directly delegated packages counted as one set), while the enduser v2clientdelegations/clientsmatches the union. Authentication needs the intersection, arbeidsflaten wants the union, and neither semantic was selectable.This adds a
packageMatchquery parameter with valuesanyandallto both endpoints. Defaults preserve each endpoint's current behavior:allon the internal v1,anyon the enduser v2, so no consumer sees a behavior change without opting in. Invalid values return 400 in each API's existing validation style. In all mode a client matches when the union of its package holdings toward the facilitator covers every requested package, mixed sources included; each mode reuses the endpoint's existing package identifier resolution so the two modes cannot disagree on what a package reference means.Integration tests cover both modes on both endpoints, including a client holding one package through an ER role and another through a direct delegation, single-package equivalence between the modes, and the 400. A new Bruno scenario (14_PackageMatchAll) covers the v2 endpoint end to end against the at22 fixtures.
Two pre-existing quirks are inherited unchanged and worth knowing when reviewing: the v1 endpoint only counts directly delegated packages on rettighetshaver assignments, and unresolvable package identifiers throw on v1 but are silently dropped on v2. The v1 enduser clientdelegations clients endpoint is a third variant of this filter and is deliberately untouched.
Closes #3913