From 4ad7151809b134beff16c6987142675e40a38879 Mon Sep 17 00:00:00 2001 From: Javier Marcos <1271349+javuto@users.noreply.github.com> Date: Sun, 7 Apr 2024 20:54:20 +0200 Subject: [PATCH] Helper function in provision for SAML certificate --- deploy/lib.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/deploy/lib.sh b/deploy/lib.sh index 8c25b612..f882cfa9 100644 --- a/deploy/lib.sh +++ b/deploy/lib.sh @@ -415,3 +415,19 @@ function install_go_21() { go version fi } + +# Generate self-signed certificate for SAML authentication +# string path_to_certs +# string certificate_name +# int rsa_bits +function self_signed_saml() { + local __certs=$1 + local __name=$2 + local __bits=$3 + + local __samlcert="$__certs/$__name.crt" + local __samlkey="$__certs/$__name.key" + + sudo openssl req -x509 -newkey rsa:$__bits -sha256 -days 365 -nodes \ + -keyout "$__samlkey" -out "$__samlcert" -subj "/CN=$__name" +}