From 21bd8c5660714c62cdc0b567f5aa3657187c61d1 Mon Sep 17 00:00:00 2001 From: Nicola Murino Date: Mon, 28 Oct 2024 18:34:36 +0100 Subject: [PATCH] node: use a plain string as key 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)