Skip to content

Commit 11f3e14

Browse files
Another refactor and include security
1 parent f4fb98a commit 11f3e14

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+38
-44
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,7 @@ dist
2828
/sandbox-staging
2929
/specification/api/components/examples
3030
/specification/api/components/x-nhsd-apim/x-nhsd-apim.yml
31+
/specification/api/components/security-schemes/security-schemes.yml
32+
/specification/api/components/security/security.yml
33+
/specification/api/components/parameters/authorization/authorization.yml
3134
/scripts/JWT/*.pem

Makefile

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -46,31 +46,25 @@ publish-oas:
4646
npm run publish-oas
4747

4848
set-authorization: guard-APIM_ENV
49-
@ AUTHORIZATION=authorization-$$APIM_ENV.yml \
50-
envsubst '$${AUTHORIZATION}' \
51-
< specification/api/components/parameters/authorization/authorization-template.yml > specification/api/components/parameters/authorization/authorization.yml
49+
SPEC_DIR=./specification/api/components/environments
50+
COMPONENT_DIR=./specification/api/components/parameters/authorization
51+
./scripts/build/substitute_build_env.sh $$COMPONENT_DIR/authorization-template.yml $$SPEC_DIR/$$APIM_ENV.env $$COMPONENT_DIR/authorization.yml
5252

53-
set-target: guard-APIM_ENV
54-
@ TARGET=target-$$APIM_ENV.yml \
55-
envsubst '$${TARGET}' \
56-
< specification/api/components/x-nhsd-apim/target-template.yml > specification/api/components/x-nhsd-apim/target.yml
57-
58-
set-access: guard-APIM_ENV
59-
@ ACCESS=access-$$APIM_ENV.yml \
60-
envsubst '$${ACCESS}' \
61-
< specification/api/components/x-nhsd-apim/access-template.yml > specification/api/components/x-nhsd-apim/access.yml
53+
set-nhsd-apim: guard-APIM_ENV
54+
SPEC_DIR=./specification/api/components/environments
55+
COMPONENT_DIR=./specification/api/components/x-nhsd-apim
56+
./scripts/build/substitute_build_env.sh $$COMPONENT_DIR/x-nhsd-apim-template.yml $$SPEC_DIR/$$APIM_ENV.env $$COMPONENT_DIR/x-nhsd-apim.yml
6257

6358
set-security: guard-APIM_ENV
64-
@ SECURITY=security-$$APIM_ENV.yml \
65-
envsubst '$${SECURITY}' \
66-
< specification/api/components/security/security-template.yml > specification/api/components/security/security.yml
67-
@ SECURITY_SCHEMES=security-schemes-$$APIM_ENV.yml \
68-
envsubst '$${SECURITY_SCHEMES}' \
69-
< specification/api/components/security-schemes/security-schemes-template.yml > specification/api/components/security-schemes/security-schemes.yml
59+
SPEC_DIR=./specification/api/components/environments
60+
COMPONENT_DIR=./specification/api/components/security
61+
./scripts/build/substitute_build_env.sh $$COMPONENT_DIR/security-template.yml $$SPEC_DIR/$$APIM_ENV.env $$COMPONENT_DIR/security.yml
62+
COMPONENT_DIR=./specification/api/components/security-schemes
63+
./scripts/build/substitute_build_env.sh $$COMPONENT_DIR/security-schemes-template.yml $$SPEC_DIR/$$APIM_ENV.env $$COMPONENT_DIR/security-schemes.yml
64+
7065

7166
construct-spec: guard-APIM_ENV
72-
SPEC_DIR=./specification/api/components/x-nhsd-apim
73-
./scripts/build/substitute_build_env.sh $$SPEC_DIR/x-nhsd-apim-template.yml $$SPEC_DIR/$$APIM_ENV.env $$SPEC_DIR/x-nhsd-apim.yml
67+
$(MAKE) set-nhsd-apim APIM_ENV=$$APIM_ENV
7468
$(MAKE) set-authorization APIM_ENV=$$APIM_ENV
7569
$(MAKE) set-security APIM_ENV=$$APIM_ENV
7670

specification/api/components/security-schemes/security-schemes-ptl.yml renamed to specification/api/components/environments/common/security-schemes-ptl.yml

File renamed without changes.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
MONITORING_FLAG=false
22
TEMPORARY_FLAG=false
3-
ENV_DIR=./int
3+
ENV_DIR=../environments/int

specification/api/components/x-nhsd-apim/int/access.yml renamed to specification/api/components/environments/int/access.yml

File renamed without changes.

specification/api/components/parameters/authorization/authorization-int.yml renamed to specification/api/components/environments/int/authorization.yml

File renamed without changes.

specification/api/components/x-nhsd-apim/int/rate-limiting.yml renamed to specification/api/components/environments/int/rate-limiting.yml

File renamed without changes.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
$ref: '../common/security-schemes-ptl.yml'

specification/api/components/security/security-int.yml renamed to specification/api/components/environments/int/security.yml

File renamed without changes.

specification/api/components/x-nhsd-apim/int/target-attributes.yml renamed to specification/api/components/environments/int/target-attributes.yml

File renamed without changes.

0 commit comments

Comments
 (0)