Skip to content

Commit 8172bec

Browse files
Fix: [AEA-6028] - Fixed security setting for proxygen PR deploys (#461)
## Summary - Routine Change ## Details it turns out it won't let you leave out the security setting on external targets in proxygen
1 parent 6c9bdec commit 8172bec

4 files changed

Lines changed: 9 additions & 13 deletions

File tree

.tool-versions

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
nodejs 24.12.0
1+
nodejs 24.13.0
22
python 3.14.2
33
poetry 2.2.1
44
shellcheck 0.10.0

docker/Dockerfile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ RUN apt-get update \
1717
# install aws stuff
1818
# Download correct AWS CLI for arch
1919
RUN if [ "$TARGETARCH" = "arm64" ] || [ "$TARGETARCH" == "aarch64" ]; then \
20-
wget -O /tmp/awscliv2.zip "https://awscli.amazonaws.com/awscli-exe-linux-aarch64.zip"; \
20+
wget -O /tmp/awscliv2.zip "https://awscli.amazonaws.com/awscli-exe-linux-aarch64.zip"; \
2121
else \
22-
wget -O /tmp/awscliv2.zip "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip"; \
22+
wget -O /tmp/awscliv2.zip "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip"; \
2323
fi && \
2424
unzip /tmp/awscliv2.zip -d /tmp/aws-cli && \
2525
/tmp/aws-cli/aws/install && \
@@ -28,9 +28,9 @@ RUN if [ "$TARGETARCH" = "arm64" ] || [ "$TARGETARCH" == "aarch64" ]; then \
2828
# Install ASDF
2929
RUN ASDF_VERSION=$(awk '!/^#/ && NF {print $1; exit}' /tmp/.tool-versions.asdf) && \
3030
if [ "$TARGETARCH" = "arm64" ] || [ "$TARGETARCH" = "aarch64" ]; then \
31-
wget -O /tmp/asdf.tar.gz https://github.com/asdf-vm/asdf/releases/download/v${ASDF_VERSION}/asdf-v${ASDF_VERSION}-linux-arm64.tar.gz; \
31+
wget -O /tmp/asdf.tar.gz https://github.com/asdf-vm/asdf/releases/download/v${ASDF_VERSION}/asdf-v${ASDF_VERSION}-linux-arm64.tar.gz; \
3232
else \
33-
wget -O /tmp/asdf.tar.gz https://github.com/asdf-vm/asdf/releases/download/v${ASDF_VERSION}/asdf-v${ASDF_VERSION}-linux-amd64.tar.gz; \
33+
wget -O /tmp/asdf.tar.gz https://github.com/asdf-vm/asdf/releases/download/v${ASDF_VERSION}/asdf-v${ASDF_VERSION}-linux-amd64.tar.gz; \
3434
fi && \
3535
tar -xvzf /tmp/asdf.tar.gz && \
3636
mv asdf /usr/bin
@@ -45,7 +45,7 @@ ENV PATH="$PATH:/home/cdkuser/.asdf/shims/:/home/cdkuser/node_modules/.bin"
4545
# Install ASDF plugins
4646
RUN asdf plugin add nodejs https://github.com/asdf-vm/asdf-nodejs.git
4747
# install some common node versions that are used in builds to speed things up
48-
RUN asdf install nodejs 22.20.0;
48+
RUN asdf install nodejs 24.13.0
4949

5050
# copy files needed for deployment
5151
COPY --chown=cdkuser docker/entrypoint.sh /home/cdkuser/

packages/deploymentUtils/src/specifications/fixSpec.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,12 @@ export function fixSpec({
4646
instance = `${apiName}-pr-${pr_id}`
4747
spec.info.title = `[PR-${pr_id}] ${spec.info.title}`
4848
spec["x-nhsd-apim"].monitoring = false
49-
delete spec["x-nhsd-apim"].target.security.secret
50-
} else {
51-
if (blueGreen) {
52-
stack = calculateVersionedStackName(stackName, version)
53-
}
54-
spec["x-nhsd-apim"].target.security.secret = mtlsSecretName
49+
} else if (blueGreen) {
50+
stack = calculateVersionedStackName(stackName, version)
5551
}
5652
spec.info.version = version
5753
spec["x-nhsd-apim"].target.url = `https://${stack}.${awsEnvironment}.eps.national.nhs.uk`
54+
spec["x-nhsd-apim"].target.security.secret = mtlsSecretName
5855
if (apigeeEnvironment === "prod") {
5956
spec.servers = [ {url: `https://api.service.nhs.uk/${instance}`} ]
6057
replaceSchemeRefs(spec, "proxygen.prod.api.platform.nhs.uk")

packages/deploymentUtils/tests/specifications/fixSpec.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ describe("fixSpec", () => {
7171
expect(instance).toBe("eps-pr-456")
7272
expect(spec.info.title).toBe("[PR-456] EPS API")
7373
expect(spec["x-nhsd-apim"].monitoring).toBe(false)
74-
expect(spec["x-nhsd-apim"].target.security.secret).toBeUndefined()
7574
expect(spec["x-nhsd-apim"]["target-attributes"]).toBeUndefined()
7675
expect(spec.servers[0].url)
7776
.toBe("https://sandbox.api.service.nhs.uk/eps-pr-456")

0 commit comments

Comments
 (0)