Skip to content

Commit

Permalink
fix: added helper function smtp auth for webmodeler (#2245)
Browse files Browse the repository at this point in the history
  • Loading branch information
hamza-m-masood authored Aug 28, 2024
1 parent d28a790 commit b54fa13
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 2 deletions.
13 changes: 13 additions & 0 deletions charts/camunda-platform-alpha/templates/web-modeler/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,19 @@ Define match labels for Web Modeler websockets to be used in matchLabels selecto
{{- end }}
{{- end -}}

{{/*
[web-modeler] Check if username and password is provided for the SMTP server
*/}}
{{- define "webModeler.restapi.mail.authEnabled" -}}
{{- $authEnabled := false -}}
{{- if and (typeIs "string" .Values.webModeler.restapi.mail.smtpUser) (ne .Values.webModeler.restapi.mail.smtpUser "") }}
{{- if or (and (typeIs "string" .Values.webModeler.restapi.mail.smtpPassword) (ne .Values.webModeler.restapi.mail.smtpPassword "")) .Values.webModeler.restapi.mail.existingSecret }}
{{- $authEnabled = true }}
{{- end }}
{{- end }}
{{- $authEnabled -}}
{{- end -}}

{{/*
[web-modeler] Get the full name of the Kubernetes objects from the postgresql dependency chart
*/}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ data:
username: {{ .Values.webModeler.restapi.mail.smtpUser | quote }}
{{- end }}
properties:
mail.smtp.auth: {{ .Values.webModeler.restapi.mail.smtpTlsEnabled }}
mail.smtp.auth: {{ include "webModeler.restapi.mail.authEnabled" . }}
mail.smtp.starttls.enable: {{ .Values.webModeler.restapi.mail.smtpTlsEnabled }}
mail.smtp.starttls.required: {{ .Values.webModeler.restapi.mail.smtpTlsEnabled }}
Expand Down
13 changes: 13 additions & 0 deletions charts/camunda-platform-latest/templates/web-modeler/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,19 @@ Define match labels for Web Modeler websockets to be used in matchLabels selecto
{{- end }}
{{- end -}}

{{/*
[web-modeler] Check if username and password is provided for the SMTP server
*/}}
{{- define "webModeler.restapi.mail.authEnabled" -}}
{{- $authEnabled := false -}}
{{- if and (typeIs "string" .Values.webModeler.restapi.mail.smtpUser) (ne .Values.webModeler.restapi.mail.smtpUser "") }}
{{- if or (and (typeIs "string" .Values.webModeler.restapi.mail.smtpPassword) (ne .Values.webModeler.restapi.mail.smtpPassword "")) .Values.webModeler.restapi.mail.existingSecret }}
{{- $authEnabled = true }}
{{- end }}
{{- end }}
{{- $authEnabled -}}
{{- end -}}

{{/*
[web-modeler] Get the full name of the Kubernetes objects from the postgresql dependency chart
*/}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ data:
username: {{ .Values.webModeler.restapi.mail.smtpUser | quote }}
{{- end }}
properties:
mail.smtp.auth: {{ .Values.webModeler.restapi.mail.smtpTlsEnabled }}
mail.smtp.auth: {{ include "webModeler.restapi.mail.authEnabled" . }}
mail.smtp.starttls.enable: {{ .Values.webModeler.restapi.mail.smtpTlsEnabled }}
mail.smtp.starttls.required: {{ .Values.webModeler.restapi.mail.smtpTlsEnabled }}
Expand Down

0 comments on commit b54fa13

Please sign in to comment.