Skip to content

Commit 44ab332

Browse files
Merge branch 'main' into AEA-6037
2 parents 398771c + f60fb07 commit 44ab332

File tree

22 files changed

+623
-611
lines changed

22 files changed

+623
-611
lines changed

.devcontainer/devcontainer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@
3535
"timonwong.shellcheck",
3636
"mkhl.direnv",
3737
"github.vscode-github-actions",
38-
"Orta.vscode-jest"
38+
"Orta.vscode-jest",
39+
"jebbs.plantuml"
3940
],
4041
"settings": {
4142
"python.defaultInterpreterPath": "/workspaces/prescriptionsforpatients/.venv/bin/python",

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
TAG_FORMAT=$(yq '.TAG_FORMAT' .github/config/settings.yml)
2727
echo "TAG_FORMAT=$TAG_FORMAT" >> "$GITHUB_OUTPUT"
2828
quality_checks:
29-
uses: NHSDigital/eps-common-workflows/.github/workflows/quality-checks.yml@41e3450a9869f278be0e431a4b47b5c77bd55559
29+
uses: NHSDigital/eps-common-workflows/.github/workflows/quality-checks.yml@86a580e5eb38584c877ccfba5fc6f3f071faeffe
3030
needs: [get_asdf_version]
3131
with:
3232
asdfVersion: ${{ needs.get_asdf_version.outputs.asdf_version }}
@@ -45,7 +45,7 @@ jobs:
4545
4646
tag_release:
4747
needs: [quality_checks, get_commit_id, get_asdf_version]
48-
uses: NHSDigital/eps-common-workflows/.github/workflows/tag-release.yml@41e3450a9869f278be0e431a4b47b5c77bd55559
48+
uses: NHSDigital/eps-common-workflows/.github/workflows/tag-release.yml@86a580e5eb38584c877ccfba5fc6f3f071faeffe
4949
with:
5050
dry_run: true
5151
asdfVersion: ${{ needs.get_asdf_version.outputs.asdf_version }}

.github/workflows/pull_request.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ env:
1010
jobs:
1111
dependabot-auto-approve-and-merge:
1212
needs: quality_checks
13-
uses: NHSDigital/eps-common-workflows/.github/workflows/dependabot-auto-approve-and-merge.yml@41e3450a9869f278be0e431a4b47b5c77bd55559
13+
uses: NHSDigital/eps-common-workflows/.github/workflows/dependabot-auto-approve-and-merge.yml@86a580e5eb38584c877ccfba5fc6f3f071faeffe
1414
secrets:
1515
AUTOMERGE_APP_ID: ${{ secrets.AUTOMERGE_APP_ID }}
1616
AUTOMERGE_PEM: ${{ secrets.AUTOMERGE_PEM }}
@@ -34,15 +34,15 @@ jobs:
3434
echo "TAG_FORMAT=$TAG_FORMAT" >> "$GITHUB_OUTPUT"
3535
3636
quality_checks:
37-
uses: NHSDigital/eps-common-workflows/.github/workflows/quality-checks.yml@41e3450a9869f278be0e431a4b47b5c77bd55559
37+
uses: NHSDigital/eps-common-workflows/.github/workflows/quality-checks.yml@86a580e5eb38584c877ccfba5fc6f3f071faeffe
3838
needs: [get_asdf_version]
3939
with:
4040
asdfVersion: ${{ needs.get_asdf_version.outputs.asdf_version }}
4141
secrets:
4242
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
4343

4444
pr_title_format_check:
45-
uses: NHSDigital/eps-common-workflows/.github/workflows/pr_title_check.yml@41e3450a9869f278be0e431a4b47b5c77bd55559
45+
uses: NHSDigital/eps-common-workflows/.github/workflows/pr_title_check.yml@86a580e5eb38584c877ccfba5fc6f3f071faeffe
4646

4747
get_issue_number:
4848
runs-on: ubuntu-22.04
@@ -73,7 +73,7 @@ jobs:
7373

7474
tag_release:
7575
needs: [get_asdf_version]
76-
uses: NHSDigital/eps-common-workflows/.github/workflows/tag-release.yml@41e3450a9869f278be0e431a4b47b5c77bd55559
76+
uses: NHSDigital/eps-common-workflows/.github/workflows/tag-release.yml@86a580e5eb38584c877ccfba5fc6f3f071faeffe
7777
with:
7878
dry_run: true
7979
asdfVersion: ${{ needs.get_asdf_version.outputs.asdf_version }}

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
echo "TAG_FORMAT=$TAG_FORMAT" >> "$GITHUB_OUTPUT"
2424
2525
quality_checks:
26-
uses: NHSDigital/eps-common-workflows/.github/workflows/quality-checks.yml@41e3450a9869f278be0e431a4b47b5c77bd55559
26+
uses: NHSDigital/eps-common-workflows/.github/workflows/quality-checks.yml@86a580e5eb38584c877ccfba5fc6f3f071faeffe
2727
needs: [get_asdf_version]
2828
with:
2929
asdfVersion: ${{ needs.get_asdf_version.outputs.asdf_version }}
@@ -42,7 +42,7 @@ jobs:
4242
4343
tag_release:
4444
needs: [quality_checks, get_commit_id, get_asdf_version]
45-
uses: NHSDigital/eps-common-workflows/.github/workflows/tag-release.yml@41e3450a9869f278be0e431a4b47b5c77bd55559
45+
uses: NHSDigital/eps-common-workflows/.github/workflows/tag-release.yml@86a580e5eb38584c877ccfba5fc6f3f071faeffe
4646
with:
4747
dry_run: false
4848
asdfVersion: ${{ needs.get_asdf_version.outputs.asdf_version }}

.github/workflows/run_regression_tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333

3434
- name: Generate a token to authenticate regression testing
3535
id: generate-token
36-
uses: actions/create-github-app-token@7e473efe3cb98aa54f8d4bac15400b15fad77d94
36+
uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf
3737
with:
3838
app-id: ${{ vars.REGRESSION_TESTS_APP_ID }}
3939
private-key: ${{ secrets.REGRESSION_TESTS_PEM }}
@@ -52,7 +52,7 @@ jobs:
5252
asdf_version: ${{ steps.asdf-version.outputs.version }}
5353

5454
- name: Cache asdf
55-
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830
55+
uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb
5656
with:
5757
path: |
5858
~/.asdf

.github/workflows/sam_package_code.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
asdf_version: ${{ steps.asdf-version.outputs.version }}
2929

3030
- name: Cache asdf
31-
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830
31+
uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb
3232
with:
3333
path: |
3434
~/.asdf
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
@startuml
2+
title: AEA-5947: (TO BE) Proxy Access Flow for Get My Prescriptions
3+
4+
participant User
5+
participant "NHS App" as App
6+
participant "NHS App Backend" as AppBackend
7+
participant "Apigee" as Apigee
8+
participant "ProxyRules" as ProxyRules
9+
participant "Step Functions StateMachine" as StateMachine
10+
participant "GetMyPrescriptions Lambda" as GmpLambda
11+
participant "psu Get Status Updates Lambda" as GsuLambda
12+
participant "EnrichPrescriptions Lambda" as EpLambda
13+
participant SpineClient
14+
participant Spine
15+
16+
User -> App: Request
17+
App -> AppBackend: Request API
18+
AppBackend -> Apigee: Call PfP API
19+
Apigee -> ProxyRules: Forward request
20+
ProxyRules -> ProxyRules: Preflow
21+
note right #FF9999
22+
Oauth token validation etc. is unchanged
23+
NEW: Sets delegated-access.enabled and IgnoreUnresolvedVariables to true
24+
end note
25+
ProxyRules -> ProxyRules: AddPatientAccessHeader
26+
note right
27+
Sets NHSD-NHSLogin-User to PX:JWT claim NHS number
28+
end note
29+
ProxyRules -> ProxyRules: AM-Add-Delegation-Headers
30+
note right #FF9999
31+
NEW: Sets new headers, completely separate to NHSD-NHSLogin-User
32+
end note
33+
ProxyRules -> ProxyRules: OverridePatientAccessHeader
34+
note right
35+
Overwrites NHSD-NHSLogin-User with P9:request header X-NHS-NUMBER
36+
end note
37+
ProxyRules -> StateMachine: Forward request
38+
StateMachine -> GmpLambda: Forward request
39+
activate GmpLambda
40+
GmpLambda -> GmpLambda: adaptHeadersToSpine(headers)
41+
note right #FF9999
42+
As well as the existing behaviour that sends spine the same values for
43+
both NHSD-NHSLogin-User (actor) and nhsNumber (subject)
44+
these are now separated if delegated-access.enabled is true
45+
end note
46+
GmpLambda -> SpineClient: getPrescriptions(*all* headers)
47+
SpineClient -> Spine: get request
48+
activate Spine
49+
Spine -> Spine: _createContext
50+
note right #FF9999
51+
NEW: Add actor to context
52+
end note
53+
== other calls, not least the actual query ==
54+
Spine -> Spine: auditSarAccessRequest
55+
note right #FF9999
56+
NEW: Add actor to SAR0001 log
57+
end note
58+
Spine -> SpineClient: Response
59+
deactivate Spine
60+
SpineClient -> GmpLambda
61+
GmpLambda -> StateMachine: Response
62+
deactivate GmpLambda
63+
StateMachine -> GsuLambda: Forward response
64+
GsuLambda -> SpineClient: getStatus(*all* headers)
65+
SpineClient -> Spine: get request
66+
Spine -> SpineClient: Response
67+
SpineClient -> StateMachine: Response
68+
GsuLambda -> StateMachine:
69+
StateMachine -> EpLambda: Forward response
70+
EpLambda -> StateMachine:
71+
StateMachine -> ProxyRules: Response
72+
note right #FF9999
73+
NEW: This is happy path but we must add RaiseFault flow too
74+
end note
75+
ProxyRules -> Apigee: Response
76+
Apigee -> App: Forward response
77+
App -> User: Display result
78+
@enduml

docs/pfp-AS-IS.puml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
@startuml
2+
title: AEA-5947: (AS IS) Proxy Access Flow for Get My Prescriptions
3+
4+
participant User
5+
participant "NHS App" as App
6+
participant "NHS App Backend" as AppBackend
7+
participant "Apigee" as Apigee
8+
participant "ProxyRules" as ProxyRules
9+
participant "Step Functions StateMachine" as StateMachine
10+
participant "GetMyPrescriptions Lambda" as GmpLambda
11+
participant "psu Get Status Updates Lambda" as GsuLambda
12+
participant "EnrichPrescriptions Lambda" as EpLambda
13+
participant SpineClient
14+
participant "Spine Patient Facing Prescriptions" as Spine
15+
16+
User -> App: Request
17+
App -> AppBackend: Request API
18+
AppBackend -> Apigee: Call PfP API
19+
Apigee -> ProxyRules: Forward request
20+
ProxyRules -> ProxyRules: Preflow
21+
note right
22+
Includes OAuth token validation etc.
23+
end note
24+
ProxyRules -> ProxyRules: AddPatientAccessHeader
25+
note right
26+
Sets NHSD-NHSLogin-User to PX:JWT claim NHS number
27+
end note
28+
ProxyRules -> ProxyRules: OverridePatientAccessHeader
29+
note right
30+
Overwrites NHSD-NHSLogin-User with P9:request header X-NHS-NUMBER
31+
TODO who sets X-NHS-NUMBER? Is it trusted?
32+
TODO given this is within an Azure pipeline condition does it ever get called?
33+
end note
34+
ProxyRules -> StateMachine: Forward request
35+
StateMachine -> GmpLambda: Forward request
36+
activate GmpLambda
37+
GmpLambda -> GmpLambda: extractNHSNumber(headers["nhsd-nhslogin-user"])
38+
GmpLambda -> SpineClient: getPrescriptions(*all* headers)
39+
SpineClient -> Spine: get request
40+
activate Spine
41+
Spine -> Spine: _createContext
42+
== other calls, not least the actual query ==
43+
Spine -> Spine: auditSarAccessRequest
44+
Spine -> SpineClient: Response
45+
deactivate Spine
46+
SpineClient -> GmpLambda
47+
GmpLambda -> StateMachine: Response
48+
deactivate GmpLambda
49+
StateMachine -> GsuLambda: Forward response
50+
GsuLambda -> SpineClient: getStatus(*all* headers)
51+
SpineClient -> Spine: get request
52+
Spine -> SpineClient: Response
53+
SpineClient -> StateMachine: Response
54+
GsuLambda -> StateMachine:
55+
StateMachine -> EpLambda: Forward response
56+
EpLambda -> StateMachine:
57+
StateMachine -> ProxyRules: Response
58+
ProxyRules -> Apigee: Response
59+
Apigee -> App: Forward response
60+
App -> User: Display result
61+
@enduml

0 commit comments

Comments
 (0)