Skip to content

Commit

Permalink
Disable default OIDC tenant when authentication is disabled (#8000)
Browse files Browse the repository at this point in the history
See https://groups.google.com/g/quarkus-dev/c/isGqZvY829g/m/BNerQvSRAQAJ

This property is a runtime property and it is likely to be more
correct to set it to false, when authentication is not enabled.

Incidentally, this allows to get rid of the OIDC warning when
Nessie starts.
  • Loading branch information
adutra authored Jan 29, 2024
1 parent bec6ee0 commit 4b0d2c8
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 5 deletions.
4 changes: 2 additions & 2 deletions helm/nessie/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,8 @@ spec:
value: {{ .Values.authentication.oidcClientId }}
{{- end }}
{{- else }}
- name: QUARKUS_LOG_CATEGORY__IO_QUARKUS_OIDC__LEVEL
value: "ERROR"
- name: QUARKUS_OIDC_TENANT_ENABLED
value: "false"
{{- end }}

{{- if .Values.authorization.enabled }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,11 @@ quarkus.http.body.handle-file-uploads=false
#quarkus.oidc.client-id=
nessie.server.authentication.enabled=false
nessie.server.authentication.anonymous-paths=/q/health/live,/q/health/live/,/q/health/ready,/q/health/ready/
# to be overwritten by end user when enabling OpenID validation
quarkus.oidc.auth-server-url=http://127.255.0.0:0/auth/realms/unset/
quarkus.http.auth.basic=false
# OIDC-enabled is a build-time property (cannot be overwritten at run-time), MUST be true
# OIDC-enabled is a build-time property (cannot be overwritten at run-time), MUST be true.
# However, we can overwrite the tenant-enabled property at run-time.
quarkus.oidc.enabled=true
quarkus.oidc.tenant-enabled=${nessie.server.authentication.enabled}

## Quarkus swagger settings
# fixed at buildtime
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ public Map<String, String> getConfigOverrides() {
return ImmutableMap.<String, String>builder()
.putAll(super.getConfigOverrides())
.put("quarkus.http.auth.basic", "true")
// Need a dummy URL to satisfy the Quarkus OIDC extension.
.put("quarkus.oidc.auth-server-url", "http://127.255.0.0:0/auth/realms/unset/")
.build();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ public Map<String, String> getConfigOverrides() {
.putAll(super.getConfigOverrides())
.put("nessie.version.store.type", IN_MEMORY.name())
.put("quarkus.http.auth.basic", "true")
// Need a dummy URL to satisfy the Quarkus OIDC extension.
.put("quarkus.oidc.auth-server-url", "http://127.255.0.0:0/auth/realms/unset/")
.putAll(AuthenticationEnabledProfile.AUTH_CONFIG_OVERRIDES)
.putAll(AuthenticationEnabledProfile.SECURITY_CONFIG)
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ public Map<String, String> getConfigOverrides() {
.putAll(super.getConfigOverrides())
.putAll(AUTHZ_RULES)
.put("nessie.server.authorization.enabled", "true")
// Need a dummy URL to satisfy the Quarkus OIDC extension.
.put("quarkus.oidc.auth-server-url", "http://127.255.0.0:0/auth/realms/unset/")
.build();
}
}

0 comments on commit 4b0d2c8

Please sign in to comment.