Connections API | GET connections/users & Connections API | GET /resource/instances/users#2613
Merged
howieandersen merged 3 commits intomainfrom Mar 20, 2026
Merged
Conversation
, #2581) Add two new GET endpoints to ConnectionsController: - GET /connections/users - retrieves available users with existing access from a party - GET /resources/instances/users - lists users with access to a specific instance New DTOs: - SimplifiedPartyDto: party information excluding sensitive personal identifiers - SimplifiedConnectionDto: simplified connection structure without access details New mapper utilities: - DtoMapper.Simplified: conversion methods for simplified DTOs with nullable reference types Both endpoints require POLICY_INSTANCE_DELEGATION authorization and exclude PersonIdentifier/SSN from responses for data privacy compliance.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds privacy-preserving “simplified” DTOs and exposes two new enduser Connections API GET endpoints to list (1) available users already connected to a party and (2) users with access to a specific resource instance, both guarded by the instance delegation authorization policy.
Changes:
- Added
SimplifiedPartyDtoandSimplifiedConnectionDtocontracts to exclude sensitive identifiers (e.g., SSN/person identifier) from responses. - Added
DtoMapperutilities to map existing connection/entity DTOs into the simplified response DTOs. - Added two new endpoints in
ConnectionsController:GET .../connections/usersandGET .../connections/resources/instances/users.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
src/libs/Altinn.Authorization.Api.Contracts/.../SimplifiedPartyDto.cs |
New simplified party DTO for response payloads without sensitive identifiers. |
src/libs/Altinn.Authorization.Api.Contracts/.../SimplifiedConnectionDto.cs |
New simplified connection DTO for nested “available users” listing. |
src/apps/Altinn.AccessManagement/.../DtoMapper.Simplified.cs |
New mapping helpers to produce simplified DTOs from existing connection/entity DTOs. |
src/apps/Altinn.AccessManagement/.../ConnectionsController.cs |
Adds the two new GET endpoints for available users and instance users. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
...pps/Altinn.AccessManagement/src/Altinn.AccessMgmt.Core/Utils/Mappers/DtoMapper.Simplified.cs
Outdated
Show resolved
Hide resolved
...ccessManagement/src/Altinn.AccessManagement.Api.Enduser/Controllers/ConnectionsController.cs
Show resolved
Hide resolved
...ccessManagement/src/Altinn.AccessManagement.Api.Enduser/Controllers/ConnectionsController.cs
Show resolved
Hide resolved
...ccessManagement/src/Altinn.AccessManagement.Api.Enduser/Controllers/ConnectionsController.cs
Show resolved
Hide resolved
...ccessManagement/src/Altinn.AccessManagement.Api.Enduser/Controllers/ConnectionsController.cs
Show resolved
Hide resolved
- Add ParameterValidation.Party() to GetAvailableUsers and GetInstanceUsers endpoints to reject Guid.Empty party parameter with 400 Bad Request - Remove unused Altinn.AccessMgmt.PersistenceEF.Models using directive from DtoMapper.Simplified.cs
...ccessManagement/src/Altinn.AccessManagement.Api.Enduser/Controllers/ConnectionsController.cs
Show resolved
Hide resolved
jonkjetiloye
approved these changes
Mar 20, 2026
Add proper scope-based authorization policies to GetAvailableUsers and GetInstanceUsers endpoints to align with existing controller patterns: - GetAvailableUsers (GET /connections/users): * POLICY_ENDUSER_CONNECTIONS_WRITE_TOOTHERS - write preparation endpoint * POLICY_INSTANCE_DELEGATION - instance delegation specific - GetInstanceUsers (GET /resources/instances/users): * POLICY_ENDUSER_CONNECTIONS_BIDRECTIONAL_READ - read operation * POLICY_INSTANCE_DELEGATION - instance delegation specific This ensures proper authorization checks consistent with other endpoints like CheckInstance, GetInstanceRights, and delegation check endpoints.
|
|
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.





…579, #2581)
Add two new GET endpoints to ConnectionsController:
New DTOs:
New mapper utilities:
Both endpoints require POLICY_INSTANCE_DELEGATION authorization and exclude PersonIdentifier/SSN from responses for data privacy compliance.
Description
Related Issue(s)
Verification
Documentation