Skip to content

feat: add an all-packages match mode to the client delegation clients endpoints - #3914

Open
howieandersen wants to merge 1 commit into
mainfrom
feat/3913_package_match_all
Open

feat: add an all-packages match mode to the client delegation clients endpoints#3914
howieandersen wants to merge 1 commit into
mainfrom
feat/3913_package_match_all

Conversation

@howieandersen

Copy link
Copy Markdown
Contributor

The two clients endpoints in the client delegation APIs disagree on package filter semantics: the internal v1 systemuserclientdelegation/clients has 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 v2 clientdelegations/clients matches the union. Authentication needs the intersection, arbeidsflaten wants the union, and neither semantic was selectable.

This adds a packageMatch query parameter with values any and all to both endpoints. Defaults preserve each endpoint's current behavior: all on the internal v1, any on 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

Copilot AI lite review requested due to automatic review settings August 17, 2026 15:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add an all-packages match mode to the client delegation clients endpoints

2 participants