⚠ This page is served via a proxy. Original site: https://github.com
This service does not collect credentials or authentication data.
Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 6 additions & 39 deletions proxies/live/apiproxy/targets/target.xml
Original file line number Diff line number Diff line change
@@ -1,43 +1,10 @@
<TargetEndpoint name="organisation-data-terminology-api-target">
<PreFlow>
<Request>
<Step>
<Name>OauthV2.VerifyAccessTokenAppLevel3OrCis2Aal3</Name>
</Step>
<Step>
<Name>FlowCallout.ApplyRateLimiting</Name>
</Step>
</Request>
</PreFlow>
<FaultRules>
<FaultRule name="access_token_expired">
<Step>
<Name>ExtractVariables.OAuthErrorFaultString</Name>
</Step>
<Step>
<Name>AssignMessage.OAuthPolicyErrorResponse</Name>
</Step>
<Condition>oauthV2.OauthV2.VerifyAccessToken.failed</Condition>
</FaultRule>
</FaultRules>
<!--
To point to a named target server as this is how it SHOULD be implemented:
For example:
<HTTPTargetConnection>
<SSLInfo>
<Enabled>true</Enabled>
</SSLInfo>
<LoadBalancer>
<Server name="organisation-data-terminology-api" />
</LoadBalancer>
</HTTPTargetConnection>
-->
<HTTPTargetConnection>
<URL>http://mocktarget.apigee.net</URL>
<Properties>
<Property name="supports.http10">true</Property>
<Property name="request.retain.headers">User-Agent,Referer,Accept-Language</Property>
<Property name="retain.queryparams">apikey</Property>
</Properties>
<SSLInfo>
<Enabled>true</Enabled>
</SSLInfo>
<LoadBalancer>
<Server name="organisation-data-terminology-api" />
</LoadBalancer>
</HTTPTargetConnection>
</TargetEndpoint>
24 changes: 0 additions & 24 deletions tests/test_endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,27 +66,3 @@ def test_wait_for_status(nhsd_apim_proxy_url, status_endpoint_auth_headers):
pytest.fail("version not found")

assert deployed_commitId == getenv('SOURCE_COMMIT_ID')


@pytest.mark.nhsd_apim_authorization({"access": "application", "level": "level0"})
def test_app_level0(nhsd_apim_proxy_url, nhsd_apim_auth_headers):
resp = requests.get(f"{nhsd_apim_proxy_url}", headers=nhsd_apim_auth_headers)
assert resp.status_code == 401 # unauthorized


@pytest.mark.nhsd_apim_authorization({"access": "application", "level": "level3"})
def test_app_level3(nhsd_apim_proxy_url, nhsd_apim_auth_headers):
resp = requests.get(f"{nhsd_apim_proxy_url}", headers=nhsd_apim_auth_headers)
assert resp.status_code == 200


@pytest.mark.nhsd_apim_authorization(
{
"access": "healthcare_worker",
"level": "aal3",
"login_form": {"username": "656005750104"},
}
)
def test_cis2_aal3(nhsd_apim_proxy_url, nhsd_apim_auth_headers):
resp = requests.get(f"{nhsd_apim_proxy_url}", headers=nhsd_apim_auth_headers)
assert resp.status_code == 200