Skip to content

Commit

Permalink
Merge pull request #18 from NHSDigital/NPA-1970-authenticate-with-waf…
Browse files Browse the repository at this point in the history
…-using-api-key

Added secret for WAF API token
  • Loading branch information
chris-young-12-nhs authored Feb 21, 2024
2 parents dbc8192 + a75cd6d commit 00f48bf
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion manifest_template.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
SERVICE_NAME: validated-relationships-service-api
PRODUCT_DISPLAY_NAME: validated-relationships-service-api
DESCRIPTION: example description
DESCRIPTION: Validated Relationships Service API
APIGEE_ENVIRONMENTS:
- name: internal-dev
display_name: Internal Development
Expand Down
11 changes: 11 additions & 0 deletions proxies/live/apiproxy/policies/AssignMessage.AddAPIToken.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<AssignMessage async="false" continueOnError="false" enabled="true" name="AddAPIToken">
<DisplayName>Add API Token</DisplayName>
<Add>
<Headers>
<Header name="x-origin-shared-secret">{private.environment_kvm_data.apikey}</Header>
</Headers>
</Add>
<IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables>
<AssignTo createNew="false" transport="http" type="request"/>
</AssignMessage>
5 changes: 4 additions & 1 deletion proxies/live/apiproxy/targets/target.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
<Step>
<Name>FlowCallout.ApplyRateLimiting</Name>
</Step>
<Step>
<Name>AddAPIToken</Name>
</Step>
</Request>
</PreFlow>
<FaultRules>
Expand All @@ -24,7 +27,7 @@
<!--TODO: The target needs to configured on a per enironment basis (NPA-1979)
This URL will also need to change once we have DNS in place (NPA-1669)
-->
<URL>https://6e6ljoc1a5.execute-api.eu-west-2.amazonaws.com/default/api</URL>
<URL>https://jfhedvdn0k.execute-api.eu-west-2.amazonaws.com/default/api</URL>
<Properties>
<Property name="supports.http10">true</Property>
<Property name="request.retain.headers">User-Agent,Referer,Accept-Language</Property>
Expand Down

0 comments on commit 00f48bf

Please sign in to comment.