Skip to content

Commit 2641f26

Browse files
Add permissions to legacy-core stack
1 parent 5edd51f commit 2641f26

File tree

4 files changed

+32
-6
lines changed

4 files changed

+32
-6
lines changed

v2/stacks/legacy-core-publishing/README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ This stack deploys the necessary services and dependencies to work with the lega
44

55
The stack uses the sandbox instance of dp-identity-api to simplify the approach to using auth.
66

7+
By default this uses a local version of dp-permissions-api and runs in the de-centralised permissions mode as this what we
8+
are currently developing towards.
9+
710
## Initialisation
811

912
To connect to the dp-identity-api in sandbox you will need to port forward the address.
@@ -43,14 +46,14 @@ To run the stack:
4346
COMPOSE_FILE=core-deps.yml:core.yml
4447
```
4548

46-
3. Ensure that the AWS access keys (environment variables) in local.env are up to date (and delete the word 'export' before each new one copied across).
47-
48-
4. Build and start the stack:
49+
3. Build and start the stack:
4950

5051
```shell
51-
make up
52+
make up-with-seed
5253
```
5354

55+
`up-with-seed` seeds the `dp-permissions-api` with the appropriate permissions. You may need to restart other services to pick up the latest bundle if this is your first time.
56+
5457
For more information on working with the stack and other make targets, see the [general stack guidance](../README.md#general-guidance-for-each-stack).
5558

5659
## Testing
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
services:
2+
mongodb:
3+
extends:
4+
file: ${PATH_MANIFESTS}/deps/mongo.yml
5+
service: mongodb
6+
volumes:
7+
- ${PATH_PROVISIONING}/mongo:/docker-entrypoint-initdb.d:ro

v2/stacks/legacy-core-publishing/core.yml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,16 @@ services:
55
service: zebedee
66
environment:
77
ENABLE_JWT_SESSIONS: "true"
8-
ENABLE_PERMISSIONS_AUTH: ${ENABLE_PERMISSIONS_AUTH:-1}
8+
ENABLE_PERMISSIONS_API: ${ENABLE_PERMISSIONS_API:-true}
9+
PERMISSIONS_API_URL: http://dp-permissions-api:25400
910
IDENTITY_API_URL: http://host.docker.internal:25600
1011
ENABLE_STATIC_FILES_PUBLISHING: "false"
1112
extra_hosts:
1213
- "host.docker.internal:host-gateway" # localhost mapping for linux
1314
- "docker.for.mac.host.internal:host-gateway" # localhost mapping for mac (docker v17.12 to v18.02)
15+
depends_on:
16+
dp-permissions-api:
17+
condition: service_healthy
1418
dp-api-router:
1519
extends:
1620
file: ${PATH_MANIFESTS}/core-ons/dp-api-router.yml
@@ -27,6 +31,8 @@ services:
2731
depends_on:
2832
zebedee:
2933
condition: service_healthy
34+
environment:
35+
ENABLE_PERMISSION_API: ${ENABLE_PERMISSION_API:-true}
3036
dp-frontend-router:
3137
extends:
3238
file: ${PATH_MANIFESTS}/core-ons/dp-frontend-router.yml
@@ -54,3 +60,13 @@ services:
5460
depends_on:
5561
dp-api-router:
5662
condition: service_healthy
63+
dp-permissions-api:
64+
extends:
65+
file: ${PATH_MANIFESTS}/core-ons/dp-permissions-api.yml
66+
service: dp-permissions-api
67+
environment:
68+
IDENTITY_API_URL: http://host.docker.internal:25600
69+
extra_hosts:
70+
- "host.docker.internal:host-gateway" # localhost mapping for linux
71+
- "docker.for.mac.host.internal:host-gateway" # localhost mapping for mac (docker v17.12 to v18.02)
72+

v2/stacks/legacy-core-publishing/default.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ PATH_PROVISIONING="../../provisioning"
99

1010
# -- Docker compose vars --
1111
# https://docs.docker.com/compose/environment-variables/envvars/
12-
COMPOSE_FILE=core.yml:redirect.yml:redirect-deps.yml
12+
COMPOSE_FILE=core-deps.yml:core.yml:redirect.yml:redirect-deps.yml
1313
COMPOSE_PATH_SEPARATOR=:
1414
COMPOSE_PROJECT_NAME=legacy-core-publishing
1515
COMPOSE_HTTP_TIMEOUT=120

0 commit comments

Comments
 (0)