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
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,14 @@
<IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables>
</Request>
<Response>healthcheckResponse</Response>
<!-- <HTTPTargetConnection>-->
<!-- <SSLInfo>-->
<!-- <Enabled>true</Enabled>-->
<!-- </SSLInfo>-->
<!-- <LoadBalancer>-->
<!-- <Server name="patient-care-aggregator-reporting" />-->
<!-- </LoadBalancer>-->
<!-- <Path>/_ping</Path>-->
<!-- </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="patient-care-aggregator-reporting" />
</LoadBalancer>
<Path>/aggregator/status</Path>
</HTTPTargetConnection>
<Timeout>20000</Timeout>
</ServiceCallout>
</ServiceCallout>
111 changes: 70 additions & 41 deletions proxies/live/apiproxy/targets/target.xml
Original file line number Diff line number Diff line change
@@ -1,43 +1,72 @@
<TargetEndpoint name="patient-care-aggregator-reporting-target">
<PreFlow>
<Request>
<ProxyEndpoint name="default">
<Flows>
<Flow name="OptionsPreFlight">
<Request/>
<Response>
<Step>
<Name>AssignMessage.AddCors</Name>
</Step>
</Response>
<Condition>(request.verb = "OPTIONS") and (request.header.origin != null) and (request.header.Access-Control-Request-Method != null)</Condition>
</Flow>
<Flow name="AddPayloadToPing">
<Description/>
<Request/>
<Response>
<Step>
<Name>AssignMessage.AddPayloadToPing</Name>
</Step>
</Response>
<Condition>(proxy.pathsuffix MatchesPath "/_ping") and ((request.verb = "GET") or (request.verb = "HEAD"))</Condition>
</Flow>
<Flow name="StatusEndpoint">
<Request>
<Step>
<Condition>request.header.apikey = null or private.common.status-endpoint-api-key != request.header.apikey</Condition>
<Name>RaiseFault.401Unauthorized</Name>
</Step>
<Step>
<Name>ServiceCallout.CallHealthcheckEndpoint</Name>
</Step>
</Request>
<Response>
<Step>
<Name>javascript.SetStatusResponse</Name>
</Step>
</Response>
<Condition>(proxy.pathsuffix MatchesPath "/_status") and ((request.verb = "GET") or (request.verb = "HEAD"))
</Condition>
</Flow>
</Flows>
<PreFlow/>
<PostClientFlow name="PostClientFlow">
<Response>
<Step>
<Name>OauthV2.VerifyAccessTokenAppLevel3OrCis2Aal3</Name>
<Name>FlowCallout.LogToSplunk</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="patient-care-aggregator-reporting" />
</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>
</HTTPTargetConnection>
</TargetEndpoint>
</Response>
</PostClientFlow>
<HTTPProxyConnection>
<BasePath>{{ SERVICE_BASE_PATH }}</BasePath>
<VirtualHost>secure</VirtualHost>
</HTTPProxyConnection>
<RouteRule name="NoRoute">
<Condition>(request.verb = "OPTIONS") and (request.header.origin != null) and (request.header.Access-Control-Request-Method != null)</Condition>
</RouteRule>
<RouteRule name="NoRoutePing">
<Condition>(proxy.pathsuffix MatchesPath "/_ping") and ((request.verb = "GET") or (request.verb = "HEAD"))</Condition>
</RouteRule>
<RouteRule name="NoRouteStatus">
<Condition>(proxy.pathsuffix MatchesPath "/_status") and ((request.verb = "GET") or (request.verb = "HEAD"))</Condition>
</RouteRule>
<RouteRule name="patient-care-aggregator-reporting">
<TargetEndpoint>patient-care-aggregator-reporting</TargetEndpoint>
</RouteRule>
<DefaultFaultRule>
<Step>
<Name>AssignMessage.Errors.CatchAllMessage</Name>
</Step>
</DefaultFaultRule>
</ProxyEndpoint>


1 change: 1 addition & 0 deletions specification/patient-care-aggregator-reporting.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# This is an OpenAPI Specification (https://swagger.io/specification/)
# for patient-care-aggregator-reporting owned by NHS Digital (https://digital.nhs.uk/)

openapi: '3.0.0'
info:
title: 'patient-care-aggregator-reporting'
Expand Down