|
| 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 |
0 commit comments