|
1 | | -# No path params provided or no ID in params |
2 | | -# No permissions to access resource in request params |
3 | | -# No permissions to access resource in S3 bucket |
4 | | -# Attempt to access pointer type without permissions |
5 | 1 | # Invalid ID (X26|Something-) |
| 2 | +Feature: Consumer - readDocumentReference - Failure Scenarios |
| 3 | + |
| 4 | + Scenario: Pointer not found |
| 5 | + Given the application 'DataShare' (ID 'z00z-y11y-x22x') is registered to access the API |
| 6 | + And the organisation 'RX898' is authorised to access pointer types: |
| 7 | + | system | value | |
| 8 | + | http://snomed.info/sct | 736253002 | |
| 9 | + When consumer 'RX898' reads a DocumentReference with ID 'X26-000000000-000000000' |
| 10 | + Then the response status code is 404 |
| 11 | + And the response is an OperationOutcome with 1 issue |
| 12 | + And the OperationOutcome contains the issue: |
| 13 | + """ |
| 14 | + { |
| 15 | + "severity": "error", |
| 16 | + "code": "not-found", |
| 17 | + "details": { |
| 18 | + "coding": [ |
| 19 | + { |
| 20 | + "system": "https://fhir.nhs.uk/ValueSet/Spine-ErrorOrWarningCode-1", |
| 21 | + "code": "NO_RECORD_FOUND", |
| 22 | + "display": "No record found" |
| 23 | + } |
| 24 | + ] |
| 25 | + }, |
| 26 | + "diagnostics": "The requested DocumentReference could not be found" |
| 27 | + } |
| 28 | + """ |
| 29 | + |
| 30 | + # TODO: This scenario is not valid as the ID is not valid - additional validation required |
| 31 | + Scenario: Invalid ID in path parameters |
| 32 | + Given the application 'DataShare' (ID 'z00z-y11y-x22x') is registered to access the API |
| 33 | + And the organisation 'RX898' is authorised to access pointer types: |
| 34 | + | system | value | |
| 35 | + | http://snomed.info/sct | 736253002 | |
| 36 | + When consumer 'RX898' reads a DocumentReference with ID 'X26`DROP TABLE 'pointers';--Something-000000000-000000000' |
| 37 | + Then the response status code is 404 |
| 38 | + And the response is an OperationOutcome with 1 issue |
| 39 | + And the OperationOutcome contains the issue: |
| 40 | + """ |
| 41 | + { |
| 42 | + "severity": "error", |
| 43 | + "code": "not-found", |
| 44 | + "details": { |
| 45 | + "coding": [ |
| 46 | + { |
| 47 | + "system": "https://fhir.nhs.uk/ValueSet/Spine-ErrorOrWarningCode-1", |
| 48 | + "code": "NO_RECORD_FOUND", |
| 49 | + "display": "No record found" |
| 50 | + } |
| 51 | + ] |
| 52 | + }, |
| 53 | + "diagnostics": "The requested DocumentReference could not be found" |
| 54 | + } |
| 55 | + """ |
| 56 | +
|
| 57 | + Scenario: No permissions to access any resources |
| 58 | + Given the application 'DataShare' (ID 'z00z-y11y-x22x') is registered to access the API |
| 59 | + And the organisation 'RX898' is authorised to access pointer types: |
| 60 | + | system | value | |
| 61 | + When consumer 'RX898' reads a DocumentReference with ID 'X26-000000000-000000000' |
| 62 | + Then the response status code is 403 |
| 63 | + And the response is an OperationOutcome with 1 issue |
| 64 | + And the OperationOutcome contains the issue: |
| 65 | + """ |
| 66 | + { |
| 67 | + "severity": "error", |
| 68 | + "code": "forbidden", |
| 69 | + "details": { |
| 70 | + "coding": [ |
| 71 | + { |
| 72 | + "system": "https://fhir.nhs.uk/ValueSet/Spine-ErrorOrWarningCode-1", |
| 73 | + "code": "ACCESS DENIED", |
| 74 | + "display": "Access has been denied to process this request" |
| 75 | + } |
| 76 | + ] |
| 77 | + }, |
| 78 | + "diagnostics": "Your organisation 'RX898' does not have permission to access this resource. Contact the onboarding team." |
| 79 | + } |
| 80 | + """ |
| 81 | + |
| 82 | + Scenario: No permissions to access specific pointer type |
| 83 | + Given the application 'DataShare' (ID 'z00z-y11y-x22x') is registered to access the API |
| 84 | + And the organisation 'RX898' is authorised to access pointer types: |
| 85 | + | system | value | |
| 86 | + | http://snomed.info/sct | 736253002 | |
| 87 | + And a DocumentReference resource exists with values: |
| 88 | + | property | value | |
| 89 | + | id | 02V-1111111111-ReadDocRefNoAuthForType | |
| 90 | + | subject | 9278693472 | |
| 91 | + | status | current | |
| 92 | + | type | 887701000000100 | |
| 93 | + | contentType | application/pdf | |
| 94 | + | url | https://example.org/my-doc.pdf | |
| 95 | + | custodian | 02V | |
| 96 | + When consumer 'RX898' reads a DocumentReference with ID '02V-1111111111-ReadDocRefNoAuthForType' |
| 97 | + Then the response status code is 403 |
| 98 | + And the response is an OperationOutcome with 1 issue |
| 99 | + And the OperationOutcome contains the issue: |
| 100 | + """ |
| 101 | + { |
| 102 | + "severity": "error", |
| 103 | + "code": "forbidden", |
| 104 | + "details": { |
| 105 | + "coding": [ |
| 106 | + { |
| 107 | + "system": "https://fhir.nhs.uk/ValueSet/Spine-ErrorOrWarningCode-1", |
| 108 | + "code": "ACCESS DENIED", |
| 109 | + "display": "Access has been denied to process this request" |
| 110 | + } |
| 111 | + ] |
| 112 | + }, |
| 113 | + "diagnostics": "The requested DocumentReference is not of a type that this organisation is allowed to access" |
| 114 | + } |
| 115 | + """ |
| 116 | + |
| 117 | + Scenario: No permissions to access any pointers in S3 |
| 118 | + Given the application 'DataShare' (ID 'z00z-y11y-x22x') is registered to access the API |
| 119 | + And the application is configured to lookup permissions from S3 |
| 120 | + And the organisation 'RX898' is authorised in S3 to access pointer types: |
| 121 | + | system | value | |
| 122 | + When consumer 'RX898' reads a DocumentReference with ID 'X26-000000000-000000000' |
| 123 | + Then the response status code is 403 |
| 124 | + And the response is an OperationOutcome with 1 issue |
| 125 | + And the OperationOutcome contains the issue: |
| 126 | + """ |
| 127 | + { |
| 128 | + "severity": "error", |
| 129 | + "code": "forbidden", |
| 130 | + "details": { |
| 131 | + "coding": [ |
| 132 | + { |
| 133 | + "system": "https://fhir.nhs.uk/ValueSet/Spine-ErrorOrWarningCode-1", |
| 134 | + "code": "ACCESS DENIED", |
| 135 | + "display": "Access has been denied to process this request" |
| 136 | + } |
| 137 | + ] |
| 138 | + }, |
| 139 | + "diagnostics": "Your organisation 'RX898' does not have permission to access this resource. Contact the onboarding team." |
| 140 | + } |
| 141 | + """ |
| 142 | + |
| 143 | + Scenario: No permissions to access specific pointer type in S3 |
| 144 | + Given the application 'DataShare' (ID 'z00z-y11y-x22x') is registered to access the API |
| 145 | + And the application is configured to lookup permissions from S3 |
| 146 | + And the organisation 'RX898' is authorised in S3 to access pointer types: |
| 147 | + | system | value | |
| 148 | + | http://snomed.info/sct | 736253002 | |
| 149 | + And a DocumentReference resource exists with values: |
| 150 | + | property | value | |
| 151 | + | id | 02V-1111111111-ReadDocRefNoAuthForTypeS3 | |
| 152 | + | subject | 9278693472 | |
| 153 | + | status | current | |
| 154 | + | type | 887701000000100 | |
| 155 | + | contentType | application/pdf | |
| 156 | + | url | https://example.org/my-doc.pdf | |
| 157 | + | custodian | 02V | |
| 158 | + When consumer 'RX898' reads a DocumentReference with ID '02V-1111111111-ReadDocRefNoAuthForTypeS3' |
| 159 | + Then the response status code is 403 |
| 160 | + And the response is an OperationOutcome with 1 issue |
| 161 | + And the OperationOutcome contains the issue: |
| 162 | + """ |
| 163 | + { |
| 164 | + "severity": "error", |
| 165 | + "code": "forbidden", |
| 166 | + "details": { |
| 167 | + "coding": [ |
| 168 | + { |
| 169 | + "system": "https://fhir.nhs.uk/ValueSet/Spine-ErrorOrWarningCode-1", |
| 170 | + "code": "ACCESS DENIED", |
| 171 | + "display": "Access has been denied to process this request" |
| 172 | + } |
| 173 | + ] |
| 174 | + }, |
| 175 | + "diagnostics": "The requested DocumentReference is not of a type that this organisation is allowed to access" |
| 176 | + } |
| 177 | + """ |
0 commit comments