Skip to content

Commit

Permalink
add routing to mhdspoc target server
Browse files Browse the repository at this point in the history
  • Loading branch information
hs14m2b committed May 10, 2024
1 parent 202c3fb commit 398a5e2
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 0 deletions.
4 changes: 4 additions & 0 deletions proxies/live/apiproxy/proxies/default.xml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@
<RouteRule name="NoRouteStatus">
<Condition>(proxy.pathsuffix MatchesPath "/_status") and ((request.verb = "GET") or (request.verb = "HEAD"))</Condition>
</RouteRule>
<RouteRule name="nhse-tsas-solarch-mhdspoc-api-target">
<TargetEndpoint>tsas-solarch-mhdpoc-api-target</TargetEndpoint>
<Condition>(proxy.pathsuffix MatchesPath "/mhdspoc/**") and ((request.verb = "GET") or (request.verb = "HEAD") or (request.verb = "POST") or (request.verb = "PUT"))</Condition>
</RouteRule>
<RouteRule name="nhse-tsas-solarch-demo-api-target">
<TargetEndpoint>nhse-tsas-solarch-demo-api-target</TargetEndpoint>
</RouteRule>
Expand Down
53 changes: 53 additions & 0 deletions proxies/live/apiproxy/targets/targetmhdspoc.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<TargetEndpoint name="tsas-solarch-mhdpoc-api-target">
<PreFlow>
<Request>
<Step>
<Name>VerifyApiKey.FromHeader</Name>
<Condition>request.header.Authorization Is null</Condition>
</Step>
<Step>
<Name>OauthV2.VerifyAccessTokenAppAllLevels</Name>
<Condition>request.header.apikey Is null</Condition>
</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="nhse-tsas-solarch-demo-api" />
</LoadBalancer>
</HTTPTargetConnection>
-->
<HTTPTargetConnection>
<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>false</Enabled>
</SSLInfo>
<LoadBalancer>
<Server name="tsas-solarch-mhdpoc-api" />
</LoadBalancer>
</HTTPTargetConnection>
</TargetEndpoint>

0 comments on commit 398a5e2

Please sign in to comment.