From b711ceb4bf1f7a6d57e37c5145ffc0579f4326d9 Mon Sep 17 00:00:00 2001 From: ivan katliarchuk Date: Sun, 29 Dec 2024 14:57:02 +0000 Subject: [PATCH] fix(aes-encryption): update docs Signed-off-by: ivan katliarchuk --- docs/registry/txt.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/registry/txt.md b/docs/registry/txt.md index 13345e42b..463826cb2 100644 --- a/docs/registry/txt.md +++ b/docs/registry/txt.md @@ -86,6 +86,13 @@ func main() { for _, k := range keys { key := []byte(k) + if len(key) != 32 { + // if key is not a plain txt let's decode + var err error + if key, err = b64.StdEncoding.DecodeString(string(key)); err != nil || len(key) != 32 { + fmt.Errorf("the AES Encryption key must have a length of 32 byte") + } + } encrypted, _ := endpoint.EncryptText( "heritage=external-dns,external-dns/owner=example,external-dns/resource=ingress/default/example", key,