Skip to content

Commit

Permalink
chore(RBAC) disable session conf secret if not set (#1033)
Browse files Browse the repository at this point in the history
Replace the default placeholder value for
enterprise.rbac.session_conf_secret with an empty string.

Disable configuring a session conf envvar if session_conf_secret is not
set.

Kong 3.6 does not require this setting in some configurations.
Previously, the chart effectively required it.
  • Loading branch information
rainest authored Mar 29, 2024
1 parent 744df5f commit e09fd7a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
7 changes: 7 additions & 0 deletions charts/kong/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## Unreleased

### Changes

* Updated handling of `session_conf_secret` to accommodate Kong 3.6.
It can now be omitted [when using OIDC](https://docs.konghq.com/gateway/3.6.x/kong-manager/auth/oidc/migrate/).

## 2.38.0

### Changes
Expand Down
6 changes: 4 additions & 2 deletions charts/kong/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -1115,8 +1115,10 @@ the template that it itself is using form the above sections.
{{- $_ := set $autoEnv "KONG_ADMIN_GUI_AUTH_CONF" $guiAuthConf -}}
{{- end }}
{{- $guiSessionConf := include "secretkeyref" (dict "name" .Values.enterprise.rbac.session_conf_secret "key" "admin_gui_session_conf") -}}
{{- $_ := set $autoEnv "KONG_ADMIN_GUI_SESSION_CONF" $guiSessionConf -}}
{{- if .Values.enterprise.rbac.session_conf_secret }}
{{- $guiSessionConf := include "secretkeyref" (dict "name" .Values.enterprise.rbac.session_conf_secret "key" "admin_gui_session_conf") -}}
{{- $_ := set $autoEnv "KONG_ADMIN_GUI_SESSION_CONF" $guiSessionConf -}}
{{- end }}
{{- end }}
{{- if .Values.enterprise.smtp.enabled }}
Expand Down
4 changes: 3 additions & 1 deletion charts/kong/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1028,7 +1028,9 @@ enterprise:
# If RBAC is enabled, this Secret must contain an admin_gui_session_conf key
# The key value must be a secret configuration, following the example at
# https://docs.konghq.com/enterprise/latest/kong-manager/authentication/sessions
session_conf_secret: kong-session-config
# If using 3.6+ and OIDC, session configuration is instead handled in the auth configuration,
# and this field can be left empty.
session_conf_secret: "" # CHANGEME
# If admin_gui_auth is not set to basic-auth, provide a secret name which
# has an admin_gui_auth_conf key containing the plugin config JSON
admin_gui_auth_conf_secret: CHANGEME-admin-gui-auth-conf-secret
Expand Down

0 comments on commit e09fd7a

Please sign in to comment.