You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: Add support for external resource references in authorizationAttributes (#801)
## Description
This adds support for supplying fully qualified resource references as
`authorizationAttribute` values in dialog elements and actions. Before
only simple strings were allowed, which was assumed to be a
`urn:altinn:subresource` referring a rule in the same policy. Now it is
possible to refer to other resources, ie. have one dialog element refer
to `urn:altinn:resource:totally-other-resource`. This allows for greater
flexibility, and makes it possible to eg. have notification jobs, which
may refer other resource registry entry, to match the authorization
rules for a dialog element.
Implementation chances:
- Added logic in `CreateResourceCategory` to let
`authorizationAttribute` values referring to `urn:altinn:resource`
namespaced override default resource/resourceinstance attributes
- Moved (most) "elementread" vs "read" logic from application to
infrastructure where it belongs
- Handle other namespaced values by utilizing `SplitNsAndValue` and
adding parameter for fallback namespace (if supplying simple string)
- Changed from `HashSet<AltinnAction>` to List<AltinnAction>` as we are
relying on ordering to match XACML responses to the request (needed
fixing unrelated to functional change)
- Added null cache option to disable caching locally. Timeouts still
apply though, which is annoying during debugging/stepping
- Added checks so that service owners can only refer to external
resources they own (as with `serviceResource`)
- Rewrote `CreateDialogDetailsResponse` for clarity
Also added more unit tests, and made the existing tests more robust.
Also added e2e tests for end users testing external resource references,
as well as service owner checks
## Related Issue(s)
N/A
## Verification
- [x] **Your** code builds clean without any errors or warnings
- [x] Manual testing done (required)
- [x] Relevant automated test added (if you find this hard, leave it and
we'll help out)
---------
Co-authored-by: Ole Jørgen Skogstad <skogstad@softis.net>
Copy file name to clipboardexpand all lines: src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogElements/Queries/Get/GetDialogElementQuery.cs
Copy file name to clipboardexpand all lines: src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/Dialogs/Commands/Create/CreateDialogCommand.cs
+27-2
Original file line number
Diff line number
Diff line change
@@ -50,9 +50,12 @@ public CreateDialogCommandHandler(
Copy file name to clipboardexpand all lines: src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/Dialogs/Commands/Update/UpdateDialogCommand.cs
+30
Original file line number
Diff line number
Diff line change
@@ -76,6 +76,14 @@ public async Task<UpdateDialogResult> Handle(UpdateDialogCommand request, Cancel
0 commit comments