CODE RUB: GetSessions Controller#223
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new authenticated GET api/auth/session endpoint to surface current session/claim details and wires it through the NHS Digital API orchestration layer, with accompanying unit, integration, and acceptance test coverage.
Changes:
- Added
Sessionaction toAuthController(authorized route) that validates NHS access token presence and returns selected user claims. - Exposed
GetAccessTokenAsyncviaINhsDigitalApiOrchestrationServiceand implemented it inNhsDigitalApiOrchestrationService. - Added new unit/integration/acceptance tests and broker helpers for calling the new session endpoint.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| LondonDataServices.IDecide.Manage.Server/Controllers/AuthController.cs | Adds the new GET session endpoint and returns claim-based session info. |
| LondonDataServices.IDecide.Manage.Server.Tests.Unit/Controllers/Auth/AuthControllerTests.Session.Logic.cs | Adds unit tests for OK and Unauthorized scenarios for Session. |
| LondonDataServices.IDecide.Manage.Server.Tests.Unit/Controllers/Auth/AuthControllerTests.Session.Exceptions.cs | Adds unit tests for exception-to-response mappings for Session. |
| LondonDataServices.IDecide.Manage.Server.Tests.Integration/Brokers/ApiBroker.Auth.cs | Adds broker helper to call GET api/auth/session in integration tests. |
| LondonDataServices.IDecide.Manage.Server.Tests.Integration/Apis/Auth/AuthApiTests.Session.cs | Adds a basic integration test for Session status code behavior. |
| LondonDataServices.IDecide.Manage.Server.Tests.Acceptance/Brokers/ApiBroker.Auth.cs | Adds broker helper to call GET api/auth/session in acceptance tests. |
| LondonDataServices.IDecide.Manage.Server.Tests.Acceptance/Apis/Auth/AuthTests.Session.cs | Adds acceptance tests for OK vs Unauthorized based on mocked access token. |
| LondonDataServices.IDecide.Core/Services/Orchestrations/NhsDigitalApis/NhsDigitalApiOrchestrationService.cs | Adds orchestration method GetAccessTokenAsync delegating to foundation service with TryCatch. |
| LondonDataServices.IDecide.Core/Services/Orchestrations/NhsDigitalApis/INhsDigitalApiOrchestrationService.cs | Extends orchestration interface with GetAccessTokenAsync. |
cjdutoit
approved these changes
Jun 8, 2026
cjdutoit
approved these changes
Jun 8, 2026
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.
CLOSES AB#28809