Skip to content

Commit cb8b0cc

Browse files
authored
Fix context path and env var names for YAML config (#2493)
The migration to YAML configuration broke the servlet context path by using the deprecated `server.context-path` instead of the Spring Boot 3.x `server.servlet.context-path` property. This caused integration tests to fail with unresolved placeholder errors and Docker-based auth tests to return 404s on all auth endpoints.
1 parent c5349dd commit cb8b0cc

File tree

3 files changed

+22
-19
lines changed

3 files changed

+22
-19
lines changed

docker/auth-test/docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ services:
3737
mock-oauth2:
3838
condition: service_started
3939
environment:
40+
- SERVER_SERVLET_CONTEXT_PATH=/WebAPI
4041
- SPRING_DATASOURCE_HIKARI_CONNECTIONTIMEOUT=60000
4142
- SPRING_DATASOURCE_HIKARI_INITIALIZATIONFAILTIMEOUT=60000
4243
- DATASOURCE_URL=jdbc:postgresql://postgres:5432/ohdsi

docker/integration-test/docker-compose.yml

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ services:
6464
mock-oauth2:
6565
condition: service_started
6666
environment:
67+
- SERVER_SERVLET_CONTEXT_PATH=/WebAPI
6768
- SPRING_DATASOURCE_HIKARI_CONNECTIONTIMEOUT=60000
6869
- SPRING_DATASOURCE_HIKARI_INITIALIZATIONFAILTIMEOUT=60000
6970
- DATASOURCE_URL=jdbc:postgresql://postgres:5432/ohdsi
@@ -85,24 +86,24 @@ services:
8586
- SECURITY_AUTH_CAS_ENABLED=false
8687
- SECURITY_AUTH_WINDOWS_ENABLED=false
8788
- SECURITY_AUTH_KERBEROS_ENABLED=false
88-
- SECURITY_AUTH_GOOGLE_ENABLED=false
89-
- SECURITY_AUTH_FACEBOOK_ENABLED=false
90-
- SECURITY_AUTH_GITHUB_ENABLED=false
91-
- SECURITY_OID_CLIENTID=webapi-client
92-
- SECURITY_OID_APISECRET=${OIDC_CLIENT_SECRET:-webapi-secret}
93-
- SECURITY_OID_URL=http://mock-oauth2:9090/default/.well-known/openid-configuration
94-
- SECURITY_OID_EXTERNALURL=http://localhost:9090/default
95-
- SECURITY_OID_LOGOUTURL=http://localhost:9090/default/endsession
96-
- SECURITY_OID_EXTRASCOPES=profile email
97-
- SECURITY_OAUTH_CALLBACK_UI=http://localhost:18080/WebAPI/#/welcome
98-
- SECURITY_OAUTH_CALLBACK_API=http://localhost:18080/WebAPI/user/oauth/callback
99-
- SECURITY_OAUTH_CALLBACK_URLRESOLVER=query
100-
- SECURITY_DB_DATASOURCE_URL=jdbc:postgresql://postgres:5432/ohdsi
101-
- SECURITY_DB_DATASOURCE_DRIVERCLASSNAME=org.postgresql.Driver
102-
- SECURITY_DB_DATASOURCE_USERNAME=postgres
103-
- SECURITY_DB_DATASOURCE_PASSWORD=${POSTGRES_PASSWORD:-postgres}
104-
- SECURITY_DB_DATASOURCE_SCHEMA=webapi
105-
- SECURITY_DB_DATASOURCE_AUTHENTICATIONQUERY=select password from webapi.users where lower(login) = lower(?)
89+
- SECURITY_AUTH_OAUTH_GOOGLE_ENABLED=false
90+
- SECURITY_AUTH_OAUTH_FACEBOOK_ENABLED=false
91+
- SECURITY_AUTH_OAUTH_GITHUB_ENABLED=false
92+
- SECURITY_AUTH_OPENID_CLIENTID=webapi-client
93+
- SECURITY_AUTH_OPENID_APISECRET=${OIDC_CLIENT_SECRET:-webapi-secret}
94+
- SECURITY_AUTH_OPENID_URL=http://mock-oauth2:9090/default/.well-known/openid-configuration
95+
- SECURITY_AUTH_OPENID_EXTERNALURL=http://localhost:9090/default
96+
- SECURITY_AUTH_OPENID_LOGOUTURL=http://localhost:9090/default/endsession
97+
- SECURITY_AUTH_OPENID_EXTRASCOPES=profile email
98+
- SECURITY_AUTH_OAUTH_CALLBACK_UI=http://localhost:18080/WebAPI/#/welcome
99+
- SECURITY_AUTH_OAUTH_CALLBACK_API=http://localhost:18080/WebAPI/user/oauth/callback
100+
- SECURITY_AUTH_OAUTH_CALLBACK_URLRESOLVER=query
101+
- SECURITY_AUTH_JDBC_DATASOURCE_URL=jdbc:postgresql://postgres:5432/ohdsi
102+
- SECURITY_AUTH_JDBC_DATASOURCE_DRIVERCLASSNAME=org.postgresql.Driver
103+
- SECURITY_AUTH_JDBC_DATASOURCE_USERNAME=postgres
104+
- SECURITY_AUTH_JDBC_DATASOURCE_PASSWORD=${POSTGRES_PASSWORD:-postgres}
105+
- SECURITY_AUTH_JDBC_DATASOURCE_SCHEMA=webapi
106+
- SECURITY_AUTH_JDBC_DATASOURCE_AUTHENTICATIONQUERY=select password from webapi.users where lower(login) = lower(?)
106107
ports:
107108
- "18080:8080"
108109
healthcheck:

src/main/resources/application.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,8 @@ sensitiveinfo:
277277

278278
# EMBEDDED SERVER CONFIGURATION (ServerProperties)
279279
server:
280-
context-path: /WebAPI
280+
servlet:
281+
context-path: /WebAPI
281282
port: 8080
282283
ssl:
283284
enabled: false

0 commit comments

Comments
 (0)