Open
Conversation
e8c4acd to
335eb79
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR enables the gateway-api to construct and send GP Connect Access Record Structured requests that the Orange Box GP Connect demonstrator accepts, including updated stub data to “trigger” the Orange Box path and updated JWT claim structures/validation.
Changes:
- Added stub SDS/PDS data (ODS/ASID/endpoint + patient) to route a specific NHS number to the Orange Box demonstrator.
- Updated clinical JWT claim modeling (Device/Practitioner/Organization as dict payloads) and introduced a JWTValidator with unit tests.
- Updated the GP provider client request URL path/headers and expanded error diagnostics (behind
CDG_DEBUG), plus corresponding test updates and a new call script.
Reviewed changes
Copilot reviewed 24 out of 25 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| gateway-api/stubs/stubs/sds/stub.py | Adds dummy ODS/ASID/device + Orange Box endpoint seed data for SDS stub responses. |
| gateway-api/stubs/stubs/provider/stub.py | Adds strict header + JWT validation for stubbed provider access_record_structured handling. |
| gateway-api/stubs/stubs/pds/stub.py | Adds a test NHS number mapping to the new Orange Box trigger patient. |
| gateway-api/stubs/stubs/data/patients/patients.py | Registers the new Orange Box trigger patient fixture. |
| gateway-api/stubs/stubs/data/patients/orange_box_trigger_9690937278.json | Adds a Patient resource used to route to Orange Box via GP ODS. |
| gateway-api/src/gateway_api/test_controller.py | Updates controller JWT claim assertions to match new dict-based organization claim. |
| gateway-api/src/gateway_api/provider/test_client.py | Updates provider client tests for new endpoint path, headers, and stub signature. |
| gateway-api/src/gateway_api/provider/client.py | Changes provider endpoint path handling, content-type headers, and error reporting. |
| gateway-api/src/gateway_api/controller.py | Updates JWT generation to use dict claim objects (Device/Practitioner/Organization). |
| gateway-api/src/gateway_api/conftest.py | Adds a shared valid_jwt fixture for validator/client tests. |
| gateway-api/src/gateway_api/common/error.py | Introduces JWTValidationError for claim validation failures. |
| gateway-api/src/gateway_api/common/common.py | Adds get_http_text() helper for HTTP status phrase lookup. |
| gateway-api/src/gateway_api/clinical_jwt/validator.py | New JWTValidator implementing claim structure/timestamp validation. |
| gateway-api/src/gateway_api/clinical_jwt/test_validator.py | New unit tests for JWTValidator behavior. |
| gateway-api/src/gateway_api/clinical_jwt/test_practitioner.py | Updates Practitioner tests to use to_dict() output. |
| gateway-api/src/gateway_api/clinical_jwt/test_jwt.py | Updates JWT tests for dict-based claims and default algorithm behavior. |
| gateway-api/src/gateway_api/clinical_jwt/test_device.py | Updates Device tests to use to_dict() output. |
| gateway-api/src/gateway_api/clinical_jwt/practitioner.py | Refactors Practitioner to emit structured dict payloads (no JSON string building). |
| gateway-api/src/gateway_api/clinical_jwt/organization.py | Adds Organization claim model emitting dict payloads. |
| gateway-api/src/gateway_api/clinical_jwt/jwt.py | Changes JWT claim field types to dict payloads and sets default algorithm to none. |
| gateway-api/src/gateway_api/clinical_jwt/device.py | Refactors Device to emit structured dict payloads (no JSON string building). |
| gateway-api/src/gateway_api/clinical_jwt/init.py | Exposes Organization and JWTValidator from the clinical_jwt package. |
| gateway-api/scripts/call_gateway.py | Adds a CLI script for calling the gateway’s getstructuredrecord endpoint. |
| gateway-api/poetry.lock | Updates lockfile metadata (Poetry version and content hash). |
| Makefile | Passes stub/debug env vars into the docker container on make deploy. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
gateway-api/stubs/stubs/data/patients/orange_box_trigger_9690937278.json
Show resolved
Hide resolved
|
|
Deployment Complete
|
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.



Description
This PR permits CDG to call the Orange Box GP Connect demonstrator
Note that it includes a call script. To call the orange box.
$STUB_PROVIDER=falsein your terminalmake deploycd gateway-apipython scripts/call_gateway.py 9690937278To revert to using the stub, repeat the above but
unset STUB_PROVIDERbefore doing make deploy.Context
This demonstrates that we can build a request that is acceptable to the Orange Box demonstrator for GP Connect and return the response that we get.
Type of changes
Checklist
Sensitive Information Declaration
To ensure the utmost confidentiality and protect your and others privacy, we kindly ask you to NOT including PII (Personal Identifiable Information) / PID (Personal Identifiable Data) or any other sensitive data in this PR (Pull Request) and the codebase changes. We will remove any PR that do contain any sensitive information. We really appreciate your cooperation in this matter.