-
Notifications
You must be signed in to change notification settings - Fork 4
Description
Introduction
Legacy systems (not utilizing systemusers) in Altinn 2 can process correspondence, ie. place them in archive in A2. This cannot currently be mirrored to Dialogporten.
Description
There is currently no way for the correspondence integration to utilize serviceowner/dialogs/{dialogId}/endusercontext/systemlabels in this context, as supplying EndUserId is required which only supports types of NorwegianPersonIdentifier or SystemUserIdentifier.
In order to support this legacy scenario, we need a method for supplying arbitrary actor information available to only admin-integrations.
Implementation
SetSystemLabelCommandHandler and BulkSetSystemLabelCommandHandler are extended to allow for an arbitrary actor to be supplied as part of the request body, available for only admin-integrations (ie. having digdir:dialogporten.serviceprovider.admin scope). This replaces the requirement to supply EndUserId. No authorization is performed, as this is the responsibility of the calling integration having admin privileges.
Supplying EndUserId and arbitrary actor is mutually exclusive, which must be handled in the validator.
Concurrency handling via revisions/if-match/etag should work as before and not be changed in any way.
Suggested DTO changes:
Normal actor validation should be made (valid PartyIdentifier, actorName can be supplied xor actorId)
Tasks
- Change validators for SetSystemLabelCommandHandler and BulkSetSystemLabelCommandHandler
- Update DTOs
- Prepare documentation
- Add integration tests
Threat Modelling
- I have considered potential security risks (if risks were found, please list them below)
- This does not authorize the provided actor against the supplied dialog(s). This is acceptable, because 1) this is only allowed for admin-integrations, which for all practical purposes are internal and 2) the supplied actor is not grantedany access to the dialog or notifications
Acceptance criteria
GIVEN an admin-integration calling SetSystemLabel for a dialog
WHEN it sends a request with addLabels set, EndUserId omitted, and a performedBy object containing a valid PartyIdentifier (via actorId xor actorName)
THEN the request succeeds, the labels are added, and the performedBy actor is stored as part of the change metadata
GIVEN an admin-integration calling BulkSetSystemLabel for one or more dialogs
WHEN it sends a request with dialogs, addLabels, and a performedBy object containing a valid PartyIdentifier (via actorId xor actorName)
THEN the request succeeds, the labels are added, and the performedBy actor is stored for each updated dialog
GIVEN a request to SetSystemLabel or BulkSetSystemLabel
WHEN both EndUserId and performedBy are supplied
THEN the request is rejected with a validation error indicating they are mutually exclusive
GIVEN a request using SetSystemLabel or BulkSetSystemLabel
WHEN performedBy.actorId is not a valid PartyIdentifier, or both actorId and actorName are provided, or neither is provided
THEN the request is rejected with a validation error describing the invalid or conflicting actor information
GIVEN a non-admin integration calling SetSystemLabel or BulkSetSystemLabel
WHEN it supplies a performedBy object
THEN the request is rejected with an authorization error stating that performedBy is only allowed for admin-integrations
Metadata
Metadata
Assignees
Labels
Type
Projects
Status