From 7d37e4fd770e70ae573b93e25f8930f03dd640ec Mon Sep 17 00:00:00 2001 From: Simon Murray Date: Mon, 12 Aug 2024 10:05:51 +0100 Subject: [PATCH] Add Generic Client Certificate Flags --- charts/unikorn-common/Chart.yaml | 2 +- charts/unikorn-common/templates/_helpers.tpl | 26 ++++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/charts/unikorn-common/Chart.yaml b/charts/unikorn-common/Chart.yaml index 3afbfef..e6af38f 100644 --- a/charts/unikorn-common/Chart.yaml +++ b/charts/unikorn-common/Chart.yaml @@ -4,6 +4,6 @@ description: Unikorn common templates to keep dependent charts in check. type: application -version: v0.1.6 +version: v0.1.7 icon: https://raw.githubusercontent.com/unikorn-cloud/assets/main/images/logos/dark-on-light/icon.png diff --git a/charts/unikorn-common/templates/_helpers.tpl b/charts/unikorn-common/templates/_helpers.tpl index ed495d1..413578d 100644 --- a/charts/unikorn-common/templates/_helpers.tpl +++ b/charts/unikorn-common/templates/_helpers.tpl @@ -175,6 +175,23 @@ where you want to use ACME, but don't want to make is widely structed by browser {{- end }} {{- end }} +{{/* +Unified X.509 client certificate. +This is used by services to authenticate against identity in order to grant an +oauth2 token for use with other services. +*/}} +{{- define "unikorn.clientCertificate.secretNamespace" -}} +{{- if (and .Values.clientCertificate .Values.clientCertificate.secretNamespace) -}} +{{- .Values.clientCertificate.secretNamespace }} +{{- end }} +{{- end }} + +{{- define "unikorn.clientCertificate.secretName" -}} +{{- if (and .Values.clientCertificate .Values.clientCertificate.secretName) -}} +{{- .Values.clientCertificate.secretName }} +{{- end }} +{{- end }} + {{/* Unified service definitions. These are typically used by services that rely on other services to function @@ -230,3 +247,12 @@ As all components use the same client libraries, they have the same flags. - --region-ca-secret-name={{ $name }} {{- end }} {{- end }} + +{{- define "unikorn.clientCertificate.flags" -}} +{{- with $namespace := ( include "unikorn.clientCertificate.secretNamespace" . ) }} +- --client-certificate-namespace={{ $namespace }} +{{- end }} +{{- with $name := ( include "unikorn.clientCertificate.secretName" . ) }} +- --client-certificate-name={{ $name }} +{{- end }} +{{- end }}