Skip to content
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
2 changes: 1 addition & 1 deletion helm/superset/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ maintainers:
- name: Chuan-Yen Chiang
email: cychiang0823@gmail.com
url: https://github.com/cychiang
version: 0.1.0
version: 0.2.0
24 changes: 24 additions & 0 deletions helm/superset/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,24 @@ pip install {{ range .Values.additionalRequirements }}{{ . }} {{ end }}

{{ end -}}

{{- define "superset-common-oauthconfig" }}

from flask_appbuilder.security.manager import AUTH_OAUTH
AUTH_TYPE = AUTH_OAUTH
AUTH_USER_REGISTRATION = {{- if .Values.supersetNode.oauth.registration_enabled }} True{{- else }} False{{- end }}
AUTH_USER_REGISTRATION_ROLE = "{{ .Values.supersetNode.oauth.userRegistrationRole | default "Public" }}"

{{ end -}}


{{- define "superset-oauthconfig" }}
import json
OAUTH_PROVIDERS = [
json.loads('{{ .Values.supersetNode.oauth.config | toJson }}')
]

{{- end }}

{{- define "superset-config" }}
import os
from cachelib.redis import RedisCache
Expand Down Expand Up @@ -97,4 +115,10 @@ RESULTS_BACKEND = RedisCache(
port=env('REDIS_PORT'),
key_prefix='superset_results'
)

{{ if .Values.supersetNode.oauth.enabled }}
{{ include "superset-common-oauthconfig" . }}
{{ include "superset-oauthconfig" . }}
{{- end }}

{{- end }}
18 changes: 18 additions & 0 deletions helm/superset/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,24 @@ supersetNode:
- secretRef:
name: '{{ tpl .Values.envFromSecret . }}'
command: [ "/bin/sh", "-c", "until nc -zv $DB_HOST $DB_PORT -w1; do echo 'waiting for db'; sleep 1; done" ]
oauth:
enabled: false
registration_enabled: true
userRegistrationRole: Public
config:
name: google
whitelist: []
icon: fa-google
token_key: access_token
remote_app:
api_base_url: https://www.googleapis.com/oauth2/v2/
client_kwargs:
scope: email profile
request_token_url: null
access_token_url: https://accounts.google.com/o/oauth2/token
authorize_url: https://accounts.google.com/o/oauth2/auth
# client_id: xx
# client_secret: xx

##
## Superset worker configuration
Expand Down