Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set quarkus.oidc.credentials.secret in dev mode #711

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion horreum-backend/src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ hibernate.jdbc.time_zone=UTC
## need to set following property in PROD env
##quarkus.oidc.auth-server-url=http://localhost:8180/realms/horreum
quarkus.oidc.client-id=horreum
quarkus.oidc.credentials.secret=overridden-in-file-dot-env

## Do not un comment the line below, there appears to be a bug in Quarkus 3.4.1 where dev services do not overwrite the config property
#quarkus.oidc.credentials.secret=overridden-in-file-dot-env

# This option lets HorreumAuthorizationFilter transform app keys sent as tokens
quarkus.http.auth.proactive=false

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public void startHorreumContainers(
.putAll(Map.of(HORREUM_DEV_POSTGRES_BACKUP, backupFilename))
.build();
}
HorreumResources.startContainers(containerArgs);
Map<String, String> envvars = HorreumResources.startContainers(containerArgs);

Map<String, String> postrgesConfig = new HashMap<>();
String jdbcUrl = HorreumResources.postgreSQLResource.getJdbcUrl();
Expand All @@ -112,6 +112,7 @@ public void startHorreumContainers(

keycloakConfig.put("quarkus.oidc.auth-server-url", "http://localhost:" + keycloakPort + "/realms/horreum");
keycloakConfig.put("horreum.keycloak.url", "http://localhost:" + keycloakPort);
keycloakConfig.put("quarkus.oidc.credentials.secret", envvars.get("quarkus.oidc.credentials.secret"));

horreumKeycloakDevService = new DevServicesResultBuildItem.RunningDevService(
HorreumResources.keycloakResource.getContainer().getContainerName(),
Expand Down