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

theia-cloud: Make OAuth2 Proxy's allowed redirect domains configurable #89

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,29 @@ data:
skip_provider_button="true"
reverse_proxy="true"
# email_domains=["*"]
{{- $cookieDomains := .Values.oauth2Proxy.cookieDomains | default (list) }}
{{- $whitelistDomains := .Values.oauth2Proxy.whitelistDomains | default (list) }}
{{- if .Values.hosts.usePaths }}
cookie_domains=["{{ tpl (.Values.hosts.configuration.baseHost | toString) . }}"]
whitelist_domains=["{{ tpl (.Values.hosts.configuration.baseHost | toString) . }}:*","{{ $keycloakHost }}:*",".google.com:*"]
{{- if gt (len $cookieDomains) 0 }}
cookie_domains={{ toJson $cookieDomains }}
{{- else }}
cookie_domains=["{{ tpl (.Values.hosts.configuration.baseHost | toString) . }}"]
{{- end }}
{{- if gt (len $whitelistDomains) 0 }}
whitelist_domains={{ toJson $whitelistDomains }}
{{- else }}
whitelist_domains=["{{ tpl (.Values.hosts.configuration.baseHost | toString) . }}:*","{{ $keycloakHost }}:*"]
{{- end }}
{{- else }}
cookie_domains=["{{ tpl (.Values.hosts.configuration.instance | toString) . }}.{{ tpl (.Values.hosts.configuration.baseHost | toString) . }}"]
whitelist_domains=["{{ tpl (.Values.hosts.configuration.instance | toString) . }}:*","{{ $keycloakHost }}:*",".google.com:*"]
{{- if gt (len $cookieDomains) 0 }}
cookie_domains={{ toJson $cookieDomains }}
{{- else }}
cookie_domains=["{{ tpl (.Values.hosts.configuration.instance | toString) . }}.{{ tpl (.Values.hosts.configuration.baseHost | toString) . }}"]
{{- end }}
{{- if gt (len $whitelistDomains) 0 }}
whitelist_domains={{ toJson $whitelistDomains }}
{{- else }}
whitelist_domains=["{{ tpl (.Values.hosts.configuration.instance | toString) . }}:*","{{ $keycloakHost }}:*"]
{{- end }}
{{- end }}
custom_templates_dir="/templates"
14 changes: 14 additions & 0 deletions charts/theia-cloud/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,20 @@ keycloak:
# for how to generate a strong cookie secret.
cookieSecret: "OQINaROshtE9TcZkNAm5Zs2Pv3xaWytBmc5W7sPX7ws="

# -- Values related to OAuth2 Proxy configuration
oauth2Proxy:
# Allowed redirect domains for OAuth2 Proxy (controls whitelist_domains).
# When empty, defaults are used:
# if hosts.usePaths: [ "<baseHost>:*", "<keycloak host>:*" ]
# else: [ "<instance>:*", "<keycloak host>:*" ]
whitelistDomains: []

# Cookie domains for OAuth2 Proxy.
# When empty, defaults are used:
# if hosts.usePaths: [ "<baseHost>" ]
# else: [ "<instance>.<baseHost>" ]
cookieDomains: []

# -- Values related to the operator
# @default -- (see details below)
operator:
Expand Down