From 2fcca6c76ff42b7f73a8dae27ac770011e8a8709 Mon Sep 17 00:00:00 2001 From: Javan lacerda Date: Thu, 20 Jun 2024 16:59:29 +0000 Subject: [PATCH] Adding option to check the required claim exist Signed-off-by: Javan lacerda --- pkg/identity/ciprovider/principal.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/identity/ciprovider/principal.go b/pkg/identity/ciprovider/principal.go index 5ccebc520..5bf1d5cda 100644 --- a/pkg/identity/ciprovider/principal.go +++ b/pkg/identity/ciprovider/principal.go @@ -55,7 +55,9 @@ func applyTemplateOrReplace(path string, data map[string]string, defaultData map if strings.Contains(path, "{{") { var doc bytes.Buffer - t := template.New("") + // This option forces to having the claim that is required + // for the template + t := template.New("").Option("missingkey=error") p, err := t.Parse(path) if err != nil { panic(err)