Skip to content

Commit 90daf85

Browse files
committed
jwt configurable
1 parent b53be04 commit 90daf85

File tree

6 files changed

+44
-40
lines changed

6 files changed

+44
-40
lines changed

deploy/docker/docker-compose.yml

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
# See the License for the specific language governing permissions and
1111
# limitations under the License.
1212

13-
1413
services:
1514

1615
crapi-identity:
@@ -39,6 +38,7 @@ services:
3938
4039
- SMTP_AUTH=true
4140
- SMTP_STARTTLS=true
41+
- JWT_EXPIRATION=604800000
4242
- ENABLE_LOG4J=${ENABLE_LOG4J:-false}
4343
- API_GATEWAY_URL=https://api.mypremiumdealership.com
4444
- TLS_ENABLED=${TLS_ENABLED:-false}
@@ -53,10 +53,10 @@ services:
5353
mongodb:
5454
condition: service_healthy
5555
healthcheck:
56-
test: /app/health.sh
57-
interval: 15s
58-
timeout: 15s
59-
retries: 15
56+
test: /app/health.sh
57+
interval: 15s
58+
timeout: 15s
59+
retries: 15
6060
deploy:
6161
resources:
6262
limits:
@@ -92,10 +92,10 @@ services:
9292
crapi-identity:
9393
condition: service_healthy
9494
healthcheck:
95-
test: /app/health.sh
96-
interval: 15s
97-
timeout: 15s
98-
retries: 15
95+
test: /app/health.sh
96+
interval: 15s
97+
timeout: 15s
98+
retries: 15
9999
deploy:
100100
resources:
101101
limits:
@@ -135,10 +135,10 @@ services:
135135
crapi-community:
136136
condition: service_healthy
137137
healthcheck:
138-
test: /app/health.sh
139-
interval: 15s
140-
timeout: 15s
141-
retries: 15
138+
test: /app/health.sh
139+
interval: 15s
140+
timeout: 15s
141+
retries: 15
142142
deploy:
143143
resources:
144144
limits:
@@ -164,10 +164,10 @@ services:
164164
crapi-workshop:
165165
condition: service_healthy
166166
healthcheck:
167-
test: curl 0.0.0.0:80/web/health
168-
interval: 15s
169-
timeout: 15s
170-
retries: 15
167+
test: curl 0.0.0.0:80/web/health
168+
interval: 15s
169+
timeout: 15s
170+
retries: 15
171171
deploy:
172172
resources:
173173
limits:
@@ -184,10 +184,10 @@ services:
184184
#ports:
185185
# - "${LISTEN_IP:-127.0.0.1}:5432:5432"
186186
healthcheck:
187-
test: ["CMD-SHELL", "pg_isready"]
188-
interval: 15s
189-
timeout: 15s
190-
retries: 15
187+
test: [ "CMD-SHELL", "pg_isready" ]
188+
interval: 15s
189+
timeout: 15s
190+
retries: 15
191191
volumes:
192192
- postgresql-data:/var/lib/postgresql/data/
193193
deploy:
@@ -205,11 +205,11 @@ services:
205205
#ports:
206206
# - "${LISTEN_IP:-127.0.0.1}:27017:27017"
207207
healthcheck:
208-
test: echo 'db.runCommand("ping").ok' | mongo mongodb:27017/test --quiet
209-
interval: 15s
210-
timeout: 15s
211-
retries: 15
212-
start_period: 20s
208+
test: echo 'db.runCommand("ping").ok' | mongo mongodb:27017/test --quiet
209+
interval: 15s
210+
timeout: 15s
211+
retries: 15
212+
start_period: 20s
213213
volumes:
214214
- mongodb-data:/data/db
215215
deploy:
@@ -226,13 +226,13 @@ services:
226226
MH_MONGO_URI: admin:crapisecretpassword@mongodb:27017
227227
MH_STORAGE: mongodb
228228
ports:
229-
# - "127.0.0.1:1025:1025" # smtp server
229+
# - "127.0.0.1:1025:1025" # smtp server
230230
- "${LISTEN_IP:-127.0.0.1}:8025:8025" # Mail ui
231231
healthcheck:
232-
test: ["CMD", "nc", "-z", "localhost", "8025"]
233-
interval: 15s
234-
timeout: 15s
235-
retries: 15
232+
test: [ "CMD", "nc", "-z", "localhost", "8025" ]
233+
interval: 15s
234+
timeout: 15s
235+
retries: 15
236236
deploy:
237237
resources:
238238
limits:
@@ -245,11 +245,11 @@ services:
245245
#ports:
246246
# - "${LISTEN_IP:-127.0.0.1}:8443:443" # https
247247
healthcheck:
248-
test: echo -n "GET / HTTP/1.1\n\n" > /dev/tcp/api.mypremiumdealership.com/443
249-
interval: 15s
250-
timeout: 15s
251-
retries: 15
252-
start_period: 15s
248+
test: echo -n "GET / HTTP/1.1\n\n" > /dev/tcp/api.mypremiumdealership.com/443
249+
interval: 15s
250+
timeout: 15s
251+
retries: 15
252+
start_period: 15s
253253
deploy:
254254
resources:
255255
limits:

deploy/helm/templates/identity/config.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ data:
2626
SMTP_EMAIL: {{ .Values.identity.config.smtpEmail }}
2727
SMTP_PASS: {{ .Values.identity.config.smtpPass }}
2828
SMTP_FROM: {{ .Values.identity.config.smtpFrom }}
29-
SMTP_AUTH: {{ .Values.identity.config.smtpAuth | quote }}
29+
SMTP_AUTH: {{ .Values.identity.config.smtpAuth | 604800000 }}
30+
JWT_EXPIRATION: {{ .Values.identity.config.jwtExpiration | quote }}
3031
SMTP_STARTTLS: {{ .Values.identity.config.smtpStartTLS | quote }}
3132
SERVER_PORT: {{ .Values.identity.port | quote }}
3233
API_GATEWAY_URL: {{ if .Values.apiGatewayServiceInstall }}"https://{{ .Values.apiGatewayService.service.name }}"{{ else }}{{ .Values.apiGatewayServiceUrl }}{{ end }}

deploy/helm/values.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ enableShellInjection: true
88
imagePullPolicy: Always
99
apiGatewayServiceUrl: https://api.mypremiumdealership.com
1010
apiGatewayServiceInstall: true
11-
apiGatewayPassword:
11+
apiGatewayPassword:
1212
tlsEnabled: false
1313

1414
waitForK8sResources:
@@ -73,6 +73,7 @@ identity:
7373
smtpFrom: "[email protected]"
7474
smtpAuth: true
7575
smtpStartTLS: true
76+
jwtExpiration: 604800000
7677
keyStoreType: PKCS12
7778
keyStore: classpath:certs/server.p12
7879
keyStorePassword: passw0rd

deploy/k8s/base/identity/config.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ metadata:
77
data:
88
DB_HOST: postgresdb
99
DB_DRIVER: postgresql
10-
JWT_SECRET: crapi #Used for creating a JWT. Can be anything
10+
JWT_SECRET: crapi #Used for creating a JWT. Can be anything
1111
DB_USER: admin
1212
DB_PASSWORD: crapisecretpassword
1313
DB_NAME: crapi
@@ -24,5 +24,6 @@ data:
2424
SMTP_PASS: "xxxxxxxxxxxxxx"
2525
SMTP_FROM: "[email protected]"
2626
SMTP_AUTH: "true"
27+
JWT_EXPIRATION: "604800000"
2728
SMTP_STARTTLS: "true"
2829
SERVER_PORT: "8080"

services/identity/.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ export [email protected]
1919
export ENABLE_SHELL_INJECTION=false
2020
export JWT_SECRET=crapi
2121
export SMTP_HOST=smtp.example.com
22+
export JWT_EXPIRATION=604800000
2223
export API_GATEWAY_URL=https://api.mypremiumdealership.com
2324
export TLS_ENABLED=false
2425
export TLS_KEYSTORE_TYPE=PKCS12

services/identity/src/main/resources/application.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ spring.jpa.hibernate.ddl-auto=update
1515

1616

1717
app.jwksJson=${JWKS}
18-
app.jwtExpiration=604800000
18+
app.jwtExpiration=${JWT_EXPIRATION}
1919

2020
#Mail Configuration
2121
mail.from=${SMTP_FROM}

0 commit comments

Comments
 (0)