From 90056323a20a77a418e598116823f1950568fea7 Mon Sep 17 00:00:00 2001 From: Stuart Padley Date: Mon, 13 Mar 2023 06:35:45 -0700 Subject: [PATCH] Cope with old sqlconfig files wrt old password-encrypted flag --- internal/secret/secret.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/internal/secret/secret.go b/internal/secret/secret.go index eab54c8d..b2c5f2a5 100644 --- a/internal/secret/secret.go +++ b/internal/secret/secret.go @@ -46,6 +46,13 @@ func Decode(cipherText string, passwordEncryption string) (plainText string) { if cipherText == "" { panic("Cannot decode/decrypt an empty string") } + + // BUG(stuartpa): Temporary code, remove when rolling over to v1.0.0, needed + // as very early users migrated from the old password-encrypted bool value + if passwordEncryption == "" { + passwordEncryption = "none" + } + if !IsValidEncryptionMethod(passwordEncryption) { panic(fmt.Sprintf( "Invalid encryption method (%q not in %q)",