Skip to content

Commit

Permalink
Moving secrets (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
petruki authored Jun 17, 2023
1 parent 745bdfe commit a15a978
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 20 deletions.
2 changes: 1 addition & 1 deletion charts/switcher-api/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ maintainers:
url: https://github.com/petruki

type: application
version: 1.0.8
version: 1.0.9
appVersion: "latest"
13 changes: 0 additions & 13 deletions charts/switcher-api/templates/api/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,11 @@ data:
MAX_REQUEST_PER_MINUTE: {{ default 0 .Values.api.env.maxRequestPerMinute | quote }}
JWT_ADMIN_TOKEN_RENEW_INTERVAL: {{ default "5m" .Values.api.env.jwtAdminTokenRenewInterval | quote }}
JWT_CLIENT_TOKEN_EXP_TIME: {{ default "5m" .Values.api.env.jwtClientTokenExpTime | quote }}
JWT_SECRET: {{ randAlphaNum 16 | quote }}
RESOURCE_SECRET: {{ default "admin" .Values.api.env.resourceSecret | quote }}
MONGODB_URI: {{ .Values.api.env.mongoUri }}

# Auth Integration
{{- if and .Values.api.env.bitbucketClientId .Values.api.env.bitbucketClientSecret -}}
BITBUCKET_OAUTH_CLIENT_ID: {{ .Values.api.env.bitbucketClientId | quote }}
BITBUCKET_OAUTH_SECRET: {{ .Values.api.env.bitbucketClientSecret | quote }}
{{- end -}}
{{- if and .Values.api.env.githubClientId .Values.api.env.githubClientSecret -}}
GIT_OAUTH_CLIENT_ID: {{ .Values.api.env.githubClientId | quote }}
GIT_OAUTH_SECRET: {{ .Values.api.env.githubClientSecret | quote }}
{{- end -}}

# Platform/Services Integration
{{- if .Values.api.env.googleRecaptchaSecret -}}
GOOGLE_RECAPTCHA_SECRET: {{ .Values.api.env.googleRecaptchaSecret | quote }}
{{- end -}}
{{- if .Values.api.env.switcherSlackJwtSecret -}}
SWITCHER_SLACK_JWT_SECRET: {{ .Values.api.env.switcherSlackJwtSecret | quote }}
{{- end -}}
28 changes: 28 additions & 0 deletions charts/switcher-api/templates/api/secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
apiVersion: v1
kind: Secret
metadata:
namespace: {{ .Release.Namespace }}
name: switcher-api
labels:
{{- include "switcher-api.labels" . | nindent 4 }}
type: Opaque
data:
JWT_SECRET: {{ randAlphaNum 16 | b64enc | quote }}
MONGODB_URI: {{ .Values.api.env.mongoUri | b64enc | quote }}
RESOURCE_SECRET: {{ default "admin" .Values.api.env.resourceSecret | b64enc | quote }}

# Auth Integration
{{- if and .Values.api.env.bitbucketClientId .Values.api.env.bitbucketClientSecret -}}
BITBUCKET_OAUTH_SECRET: {{ .Values.api.env.bitbucketClientSecret | b64enc | quote }}
{{- end -}}
{{- if and .Values.api.env.githubClientId .Values.api.env.githubClientSecret -}}
GIT_OAUTH_SECRET: {{ .Values.api.env.githubClientSecret | b64enc | quote }}
{{- end -}}

# Platform/Services Integration
{{- if .Values.api.env.googleRecaptchaSecret -}}
GOOGLE_RECAPTCHA_SECRET: {{ .Values.api.env.googleRecaptchaSecret | b64enc | quote }}
{{- end -}}
{{- if .Values.api.env.switcherSlackJwtSecret -}}
SWITCHER_SLACK_JWT_SECRET: {{ .Values.api.env.switcherSlackJwtSecret | b64enc | quote }}
{{- end -}}
2 changes: 2 additions & 0 deletions charts/switcher-api/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ api:
envFrom:
- configMapRef:
name: switcher-api
- secretRef:
name: switcher-api

imagePullSecrets: []
nameOverride: ""
Expand Down
2 changes: 1 addition & 1 deletion charts/switcher-slack-app/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ maintainers:
url: https://github.com/petruki

type: application
version: 1.0.4
version: 1.0.5
appVersion: "latest"
6 changes: 1 addition & 5 deletions charts/switcher-slack-app/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,4 @@ metadata:
data:
SLACK_CLIENT_ID: {{ default "[CHANGE_ME]" .Values.app.env.slackClientId | quote }}
SWITCHER_URL: {{ .Values.app.env.switcherManagementUrl | quote }}
SWITCHER_API_URL: {{ .Values.app.env.switcherAPIUrl | quote }}

SLACK_SIGNING_SECRET: {{ default "[CHANGE_ME]" .Values.app.env.slackSigningSecret | quote }}
SLACK_CLIENT_SECRET: {{ default "[CHANGE_ME]" .Values.app.env.slackClientSecret | quote }}
SWITCHER_JWT_SECRET: {{ randAlphaNum 16 | quote }}
SWITCHER_API_URL: {{ .Values.app.env.switcherAPIUrl | quote }}
12 changes: 12 additions & 0 deletions charts/switcher-slack-app/templates/secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: v1
kind: Secret
metadata:
namespace: {{ .Release.Namespace }}
name: switcher-slack-app
labels:
{{- include "switcher-slack-app.labels" . | nindent 4 }}
type: Opaque
data:
SLACK_SIGNING_SECRET: {{ default "[CHANGE_ME]" .Values.app.env.slackSigningSecret | b64enc | quote }}
SLACK_CLIENT_SECRET: {{ default "[CHANGE_ME]" .Values.app.env.slackClientSecret | b64enc | quote }}
SWITCHER_JWT_SECRET: {{ randAlphaNum 16 | b64enc | quote }}
2 changes: 2 additions & 0 deletions charts/switcher-slack-app/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ app:
envFrom:
- configMapRef:
name: switcher-slack-app
- secretRef:
name: switcher-slack-app

imagePullSecrets: []
nameOverride: ""
Expand Down

0 comments on commit a15a978

Please sign in to comment.