Skip to content

Commit 5741b62

Browse files
psubram3jmorton
andcommitted
add local keycloak instance
Co-authored-by: Pranav Subramanian <pranav.subramanian@nasa.gov> Co-authored-by: Jonathan Morton <jonathan.r.morton@nasa.gov>
1 parent b3f6114 commit 5741b62

2 files changed

Lines changed: 165 additions & 19 deletions

File tree

docker-compose.yml

Lines changed: 35 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ services:
2828
- aerie_file_store:/usr/src/app/action_file_store
2929
aerie_gateway:
3030
container_name: aerie_gateway
31-
depends_on: ["postgres"]
31+
depends_on: ["postgres", "keycloak"]
3232
environment:
3333
AUTH_TYPE: none
3434
AUTH_URL: https://atb-ocio-12b.jpl.nasa.gov:8443/cam-api
@@ -43,7 +43,10 @@ services:
4343
AERIE_DB_PORT: 5432
4444
GATEWAY_DB_USER: "${GATEWAY_USERNAME}"
4545
GATEWAY_DB_PASSWORD: "${GATEWAY_PASSWORD}"
46-
image: "ghcr.io/nasa-ammos/aerie-gateway:develop"
46+
# image: "aerie-gateway:no-auth-1"
47+
build:
48+
context: ../../NASA-AMMOS/aerie-gateway
49+
dockerfile: Dockerfile
4750
ports: ["9000:9000"]
4851
restart: always
4952
volumes:
@@ -154,22 +157,22 @@ services:
154157
restart: always
155158
volumes:
156159
- workspace_file_store:/usr/src/ws
157-
aerie_ui:
158-
container_name: aerie_ui
159-
depends_on: ["postgres"]
160-
environment:
161-
NODE_TLS_REJECT_UNAUTHORIZED: "0"
162-
PUBLIC_AERIE_FILE_STORE_PREFIX: "/usr/src/app/merlin_file_store/"
163-
ORIGIN: http://localhost
164-
PUBLIC_GATEWAY_CLIENT_URL: http://localhost:9000
165-
PUBLIC_GATEWAY_SERVER_URL: http://aerie_gateway:9000
166-
PUBLIC_HASURA_CLIENT_URL: http://localhost:8080/v1/graphql
167-
PUBLIC_HASURA_SERVER_URL: http://hasura:8080/v1/graphql
168-
PUBLIC_HASURA_WEB_SOCKET_URL: ws://localhost:8080/v1/graphql
169-
PUBLIC_COMMAND_EXPANSION_MODE: "typescript"
170-
image: "ghcr.io/nasa-ammos/aerie-ui:develop"
171-
ports: ["80:80"]
172-
restart: always
160+
# aerie_ui:
161+
# container_name: aerie_ui
162+
# depends_on: ["postgres"]
163+
# environment:
164+
# NODE_TLS_REJECT_UNAUTHORIZED: "0"
165+
# PUBLIC_AERIE_FILE_STORE_PREFIX: "/usr/src/app/merlin_file_store/"
166+
# ORIGIN: http://localhost
167+
# PUBLIC_GATEWAY_CLIENT_URL: http://localhost:9000
168+
# PUBLIC_GATEWAY_SERVER_URL: http://aerie_gateway:9000
169+
# PUBLIC_HASURA_CLIENT_URL: http://localhost:8080/v1/graphql
170+
# PUBLIC_HASURA_SERVER_URL: http://hasura:8080/v1/graphql
171+
# PUBLIC_HASURA_WEB_SOCKET_URL: ws://localhost:8080/v1/graphql
172+
# PUBLIC_COMMAND_EXPANSION_MODE: "typescript"
173+
# image: "ghcr.io/nasa-ammos/aerie-ui:develop"
174+
# ports: ["80:80"]
175+
# restart: always
173176
aerie_merlin_worker_1:
174177
build:
175178
context: ./merlin-worker
@@ -270,9 +273,22 @@ services:
270273
restart: always
271274
volumes:
272275
- aerie_file_store:/usr/src/app/merlin_file_store:ro
276+
keycloak:
277+
image: quay.io/keycloak/keycloak:latest
278+
container_name: aerie_keycloak
279+
ports:
280+
- "8000:8000"
281+
environment:
282+
KC_BOOTSTRAP_ADMIN_USERNAME: kcadmin
283+
KC_BOOTSTRAP_ADMIN_PASSWORD: kcadmin
284+
KC_HTTP_PORT: 8000
285+
KC_FEATURES: scripts # would be nice to make x-hasura-default-role work right but I'm having issues with this
286+
command: [ "start-dev", "--import-realm" ]
287+
volumes:
288+
- ./e2e-tests/oauth/realm-export.json:/opt/keycloak/data/import/realm-export.json
273289
hasura:
274290
container_name: aerie_hasura
275-
depends_on: ["postgres"]
291+
depends_on: ["postgres", "keycloak"]
276292
environment:
277293
AERIE_DATABASE_URL: "postgres://${AERIE_USERNAME}:${AERIE_PASSWORD}@postgres:5432/aerie?options=-c%20search_path%3Dutil_functions%2Chasura%2Cpermissions%2Ctags%2Cmerlin%2Cscheduler%2Csequencing%2Cactions%2Cpublic"
278294
AERIE_MERLIN_URL: "http://aerie_merlin:27183"

e2e-tests/oauth/realm-export.json

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
{
2+
"id": "aerie-dev",
3+
"realm": "aerie-dev",
4+
"enabled": "true",
5+
"defaultSignatureAlgorithm": "RS256",
6+
"clients": [
7+
{
8+
"id": "aerie",
9+
"clientId": "aerie",
10+
"enabled": "true",
11+
"redirectUris": ["*"],
12+
"publicClient": true,
13+
"protocol": "openid-connect",
14+
"standardFlowEnabled": true,
15+
"attributes": {
16+
"access.token.lifespan": "600",
17+
"refresh.token.lifespan": "1800",
18+
"client.session.idle.timeout": "1800",
19+
"client.session.max.lifespan": "3600",
20+
"pkce.code.challenge.method": "S256",
21+
"token.endpoint.auth.signing.max.exp": "60"
22+
},
23+
"protocolMappers": [
24+
{
25+
"name": "x-hasura-allowed-roles",
26+
"protocol": "openid-connect",
27+
"protocolMapper": "oidc-usermodel-client-role-mapper",
28+
"consentRequired": false,
29+
"config": {
30+
"introspection.token.claim": "true",
31+
"multivalued": "true",
32+
"userinfo.token.claim": "true",
33+
"id.token.claim": "true",
34+
"lightweight.claim": "false",
35+
"access.token.claim": "true",
36+
"claim.name": "https://hasura\\.io/jwt/claims.x-hasura-allowed-roles",
37+
"jsonType.label": "String",
38+
"usermodel.clientRoleMapping.clientId": "aerie"
39+
}
40+
},
41+
{
42+
"name": "x-hasura-user-id",
43+
"protocol": "openid-connect",
44+
"protocolMapper": "oidc-usermodel-property-mapper",
45+
"consentRequired": false,
46+
"config": {
47+
"introspection.token.claim": "true",
48+
"userinfo.token.claim": "true",
49+
"user.attribute": "id",
50+
"id.token.claim": "true",
51+
"lightweight.claim": "false",
52+
"access.token.claim": "true",
53+
"claim.name": "https://hasura\\.io/jwt/claims.x-hasura-user-id",
54+
"jsonType.label": "String"
55+
}
56+
},
57+
{
58+
"name": "x-hasura-default-role",
59+
"protocol": "openid-connect",
60+
"protocolMapper": "oidc-usermodel-client-role-mapper",
61+
"consentRequired": false,
62+
"config": {
63+
"introspection.token.claim": "true",
64+
"multivalued": "false",
65+
"userinfo.token.claim": "true",
66+
"id.token.claim": "true",
67+
"lightweight.claim": "false",
68+
"access.token.claim": "true",
69+
"claim.name": "https://hasura\\.io/jwt/claims.x-hasura-default-role",
70+
"jsonType.label": "String",
71+
"usermodel.clientRoleMapping.clientId": "aerie"
72+
}
73+
}
74+
]
75+
}
76+
],
77+
"users": [
78+
{
79+
"username": "AerieAdmin",
80+
"enabled": "true",
81+
"email": "AerieAdmin@aerie-dev.gov",
82+
"firstName": "Admin",
83+
"lastName": "Aerie",
84+
"emailVerified": "true",
85+
"credentials": [
86+
{
87+
"type": "password",
88+
"value": "password"
89+
}
90+
],
91+
"clientRoles": {
92+
"aerie": ["3-viewer", "2-user", "1-aerie_admin"]
93+
}
94+
},
95+
{
96+
"username": "AerieUser",
97+
"enabled": "true",
98+
"email": "AerieUser@aerie-dev.gov",
99+
"firstName": "User",
100+
"lastName": "Aerie",
101+
"emailVerified": "true",
102+
"credentials": [
103+
{
104+
"type": "password",
105+
"value": "password"
106+
}
107+
],
108+
"clientRoles": {
109+
"aerie": ["3-viewer", "2-user"]
110+
}
111+
},
112+
{
113+
"username": "AerieViewer",
114+
"enabled": "true",
115+
"email": "AerieViewer@aerie-dev.gov",
116+
"firstName": "Viewer",
117+
"lastName": "Aerie",
118+
"emailVerified": "true",
119+
"credentials": [
120+
{
121+
"type": "password",
122+
"value": "password"
123+
}
124+
],
125+
"clientRoles": {
126+
"aerie": ["3-viewer"]
127+
}
128+
}
129+
]
130+
}

0 commit comments

Comments
 (0)