Skip to content

Commit

Permalink
Merge pull request #72 from opf/feature/oidc-existing-secret
Browse files Browse the repository at this point in the history
Add existing secret for OIDC
  • Loading branch information
machisuji authored Jan 10, 2024
2 parents 3bb8f19 + 1f2594c commit 55fc0c0
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/dull-brooms-wash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@openproject/helm-charts": minor
---

Add existingSecret for OIDC
6 changes: 5 additions & 1 deletion charts/openproject/templates/secret_oidc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ stringData:
{{ $oidc_prefix }}_DISPLAY__NAME: {{ .Values.openproject.oidc.displayName | quote }}
{{ $oidc_prefix }}_HOST: {{ .Values.openproject.oidc.host | quote }}
{{ $oidc_prefix }}_IDENTIFIER: {{ .Values.openproject.oidc.identifier | quote }}
{{ $oidc_prefix }}_SECRET: {{ .Values.openproject.oidc.secret | quote }}
{{/* Fall back to '_' as secret name if the name is not given. This way `lookup` will return null (since secrets with this name will and cannot exist) which it doesn't with an empty string. */}}
{{ $secret := (lookup "v1" "Secret" .Release.Namespace (default "_" .Values.openproject.oidc.existingSecret)) | default (dict "data" dict) -}}
{{ $oidc_prefix }}_SECRET: {{
default .Values.openproject.oidc.secret (get $secret.data .Values.openproject.oidc.secretKeys.secret | b64dec) | quote
}}
{{ $oidc_prefix }}_AUTHORIZATION__ENDPOINT: {{ .Values.openproject.oidc.authorizationEndpoint | quote }}
{{ $oidc_prefix }}_TOKEN__ENDPOINT: {{ .Values.openproject.oidc.tokenEndpoint | quote }}
{{ $oidc_prefix }}_USERINFO__ENDPOINT: {{ .Values.openproject.oidc.userinfoEndpoint | quote }}
Expand Down
14 changes: 12 additions & 2 deletions charts/openproject/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -284,9 +284,20 @@ openproject:
userinfoEndpoint: ""
endSessionEndpoint: ""
scope: "[openid]"

# Optional attribute mappings from the id token
attribute_map: {}


## To avoid having sensitive credentials in your values.yaml, the preferred way is to
## use an existing secret containing the OIDC compatible access credentials.
## Specify the name of this existing secret here.
existingSecret:

## In case your secret does not use the default keys in the secret, you can adjust them here.
secretKeys:
secret: "oidcSecret"

## Modify PostgreSQL statement timout.
## Increase in case you get errors such as "ERROR: canceling statement due to statement timeout".
##
Expand Down Expand Up @@ -349,9 +360,8 @@ s3:
secretAccessKey:

## To avoid having sensitive credentials in your values.yaml, the preferred way is to
## use an existing secret containing the PostgreSQL credentials.
## use an existing secret containing the S3 compatible access credentials.
## Specify the name of this existing secret here.
#
existingSecret:

## In case your secret does not use the default keys in the secret, you can adjust them here.
Expand Down

0 comments on commit 55fc0c0

Please sign in to comment.