Skip to content

Commit 5c47bd4

Browse files
authored
Cope with old sqlconfig files wrt --password-encrypted flag (#303)
1 parent f7deb1f commit 5c47bd4

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

internal/secret/secret.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,13 @@ func Decode(cipherText string, passwordEncryption string) (plainText string) {
4646
if cipherText == "" {
4747
panic("Cannot decode/decrypt an empty string")
4848
}
49+
50+
// BUG(stuartpa): Temporary code, remove when rolling over to v1.0.0, needed
51+
// as very early users migrated from the old password-encrypted bool value
52+
if passwordEncryption == "" {
53+
passwordEncryption = "none"
54+
}
55+
4956
if !IsValidEncryptionMethod(passwordEncryption) {
5057
panic(fmt.Sprintf(
5158
"Invalid encryption method (%q not in %q)",

0 commit comments

Comments
 (0)