From 646944ab2a1a15fdf1b46f30d96e2cdd63b0b5a08454ce5307e5831b93601221 Mon Sep 17 00:00:00 2001 From: Tyler J King Date: Wed, 13 May 2026 06:49:15 -0400 Subject: [PATCH] fix(gsap-attestor): use HCL JSON mode for SPIRE plugin_data parsing SPIRE's chart renders plugin_data as JSON via reformat-and-yaml2json, so hclsimple.Decode with "plugin.json" filename triggers HCL v2 JSON mode. Falls back to native HCL for direct testing. Co-Authored-By: Claude Opus 4.6 --- cmd/gsap-attestor/main.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cmd/gsap-attestor/main.go b/cmd/gsap-attestor/main.go index 95f72c3..726a79f 100644 --- a/cmd/gsap-attestor/main.go +++ b/cmd/gsap-attestor/main.go @@ -2,7 +2,6 @@ package main import ( "context" - "encoding/json" "sync" "github.com/hashicorp/hcl/v2/hclsimple" @@ -42,7 +41,7 @@ func (p *Plugin) Attest(ctx context.Context, req *workloadattestorv1.AttestReque func decodeConfig(data string) (GsapAttestorConfig, error) { var cfg GsapAttestorConfig - if err := json.Unmarshal([]byte(data), &cfg); err != nil { + if err := hclsimple.Decode("plugin.json", []byte(data), nil, &cfg); err != nil { if err2 := hclsimple.Decode("plugin.hcl", []byte(data), nil, &cfg); err2 != nil { return cfg, err2 }