Skip to content

Commit 9305dbe

Browse files
authored
Merge branch 'main' into feature/CCM-13009_update-docs-2
2 parents 624906e + ec49b72 commit 9305dbe

32 files changed

+456
-456
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,4 @@ dist
2727
/sandbox/*.log
2828
/sandbox-staging
2929
/specification/api/components/examples
30+
/scripts/JWT/*.pem

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ serve-swagger:
9494
npm run serve-swagger-docs
9595

9696
copy-examples:
97-
cp -r ./sandbox/data/examples/. ./specification/api/components/examples
97+
@scripts/build/copy-examples.sh
9898

9999
config:: _install-dependencies version # Configure development environment (main) @Configuration
100100
npm install

package-lock.json

Lines changed: 296 additions & 387 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
},
1111
"devDependencies": {
1212
"@openapitools/openapi-generator-cli": "^2.21.4",
13-
"@redocly/cli": "^1.34.5",
13+
"@redocly/cli": "^2.11.1",
1414
"@tsconfig/node22": "^22.0.2",
1515
"@types/jest": "^30.0.0",
1616
"@types/js-yaml": "^4.0.9",

sandbox/data/examples/createMI/requests/createMI_INVALID.json renamed to sandbox/data/examples/createMI/requests/createMI_request_INVALID.json

File renamed without changes.

sandbox/data/examples/createMI/requests/createMI_NOTFOUND.json renamed to sandbox/data/examples/createMI/requests/createMI_request_NOTFOUND.json

File renamed without changes.

sandbox/data/examples/createMI/requests/createMI_SUCCESS.json renamed to sandbox/data/examples/createMI/requests/createMI_request_SUCCESS.json

File renamed without changes.

sandbox/data/examples/createMI/responses/createMI_SUCCESS.json renamed to sandbox/data/examples/createMI/responses/createMI_response_SUCCESS.json

File renamed without changes.

sandbox/utils/ResponseProvider.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,9 @@ async function postLettersResponse(request) {
101101

102102
async function postMIResponse(request) {
103103
const postMIFileMap = {
104-
'data/examples/createMI/requests/createMI_SUCCESS.json': {responsePath: 'data/examples/createMI/responses/createMI_SUCCESS.json', responseCode: 200},
105-
'data/examples/createMI/requests/createMI_INVALID.json': {responsePath:'data/examples/errors/responses/badRequest.json',responseCode: 400},
106-
'data/examples/createMI/requests/createMI_NOTFOUND.json': {responsePath:'data/examples/errors/responses/resourceNotFound.json',responseCode: 404},
104+
'data/examples/createMI/requests/createMI_request_SUCCESS.json': {responsePath: 'data/examples/createMI/responses/createMI_response_SUCCESS.json', responseCode: 200},
105+
'data/examples/createMI/requests/createMI_request_INVALID.json': {responsePath:'data/examples/errors/responses/badRequest.json',responseCode: 400},
106+
'data/examples/createMI/requests/createMI_request_NOTFOUND.json': {responsePath:'data/examples/errors/responses/resourceNotFound.json',responseCode: 404},
107107
};
108108
return await mapExampleResponse(request, postMIFileMap);
109109
}

scripts/JWT/README.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Environments – Notify Supplier
2+
3+
## Environment Matrix
4+
5+
| Environment Name | Apigee Instance | Proxy URL | Application | Security Level | Private Key | KID | Notes / Env Code |
6+
|------------------|-----------------|-----------|--------------|----------------|--------------|------|------------------|
7+
| **Internal dev – PRs** | Internal | internal-dev.api.service.nhs.uk/nhs-notify-supplier-PR-XXX | Notify-Supplier-App-Restricted – Internal Dev 2 | level 0 ||| internal-dev PRs |
8+
| **Internal dev – Main** | Internal | internal-dev.api.service.nhs.uk/nhs-notify-supplier | Notify Supplier – Application Restricted – Internal Dev Main | level 3 | [internal-dev-test-1.pem](https://eu-west-2.console.aws.amazon.com/systems-manager/parameters/%252Fnhs%252Fjwt%252Fkeys%252Finternal-dev-test-1.pem/description?region=eu-west-2&tab=Table) | internal-dev-test-1 | dev |
9+
| **Ref** | Internal | ref.api.service.nhs.uk/nhs-notify-supplier | Notify Supplier – Application Restricted – Ref | level 3 | [ref-test-1.pem](https://eu-west-2.console.aws.amazon.com/systems-manager/parameters/%252Fnhs%252Fjwt%252Fkeys%252Fref-test-1.pem/description?region=eu-west-2&tab=Table) | ref-test-1 | prod |
10+
| **Int** | External | int.api.service.nhs.uk/nhs-notify-supplier | Notify Supplier – Integration Testing | level 3 | [int-test-1.pem](https://eu-west-2.console.aws.amazon.com/systems-manager/parameters/%252Fnhs%252Fint%252Fjwt%252Fint-test-1.pem/description?region=eu-west-2&tab=Table) | int-test-1 | int |
11+
12+
---
13+
14+
## How to Get the JWT Access Token
15+
16+
1. Download the private key from AWS Systems Manager and save it locally as `$KID.pem`, for example `ref-test-1.pem`.
17+
18+
2. Get the Apigee API key via one of the following:
19+
- [Apigee Edge Console](https://apigee.com/edge)
20+
- [Internal developer account](https://onboarding.prod.api.platform.nhs.uk/Index)
21+
- [External developer account](https://dos-internal.ptl.api.platform.nhs.uk/Index)
22+
23+
3. Run the Python script `get_bearer_token.py` with the parameters:
24+
25+
```bash
26+
python get_bearer_token.py --kid <KID> --env <ENVIRONMENT> --appid <APIKEY>
27+
```
28+
29+
Example:
30+
31+
```bash
32+
python get_bearer_token.py --kid ref-test-1 --env ref --appid 8Np3gFEw21JX7AGuokId0QEFTaOhG4Z2
33+
```
34+
35+
4. The access token will be returned in the response
36+
37+
5. Add the access token to your API requests as a header:
38+
39+
| Header Name | Header Value |
40+
|--------------|--------------|
41+
| Authorization | `Bearer <access token>` |
42+
43+
---

0 commit comments

Comments
 (0)