From 256e3c1e3e0d6e06f80ca08e17d0a8195f555990 Mon Sep 17 00:00:00 2001 From: Nicola Murino Date: Mon, 28 Oct 2024 14:33:38 +0100 Subject: [PATCH] node: use a plain string as key Some KMS providers only allow UTF-8 characters Signed-off-by: Nicola Murino --- internal/dataprovider/node.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/dataprovider/node.go b/internal/dataprovider/node.go index a1c8b2c4..50c90546 100644 --- a/internal/dataprovider/node.go +++ b/internal/dataprovider/node.go @@ -99,7 +99,7 @@ func (n *NodeData) validate() error { if n.Proto != NodeProtoHTTP && n.Proto != NodeProtoHTTPS { return util.NewValidationError(fmt.Sprintf("invalid node proto: %s", n.Proto)) } - n.Key = kms.NewPlainSecret(util.BytesToString(util.GenerateRandomBytes(32))) + n.Key = kms.NewPlainSecret(util.GenerateUniqueID()) n.Key.SetAdditionalData(n.Host) if err := n.Key.Encrypt(); err != nil { return fmt.Errorf("unable to encrypt node key: %w", err)