Minor improvemnets

This commit is contained in:
Daniel Hougaard
2024-07-29 12:21:38 +02:00
parent 4249ec6030
commit 91cee20cc8
2 changed files with 2 additions and 7 deletions

View File

@@ -82,11 +82,6 @@ func setFileVaultPassphrase(passphrase string) {
return
}
if configFile.VaultBackendType != "file" {
log.Error().Msgf("You are not using file vault to store your login details. You can only set passphrase for file vault. Use 'infisical vault use file' to switch to file vault")
return
}
// encode with base64
encodedPassphrase := base64.StdEncoding.EncodeToString([]byte(passphrase))
configFile.VaultBackendPassphrase = encodedPassphrase
@@ -97,7 +92,7 @@ func setFileVaultPassphrase(passphrase string) {
return
}
fmt.Printf("\nSuccessfully, set passphrase for file vault. You can now store your login details securely at rest\n")
util.PrintSuccessMessage("\nSuccessfully, set passphrase for file vault.\n")
}
func printAvailableVaultBackends() {

View File

@@ -23,7 +23,7 @@ func SetValueInKeyring(key, value string) error {
err = keyring.Set(currentVaultBackend, MAIN_KEYRING_SERVICE, key, value)
if err != nil {
PrintWarning("Fallback file keyring is being used\n\nYou can persist your file passphrase by running the following command:\ninfisical vault set file passphrase <your-passphrase>\n")
PrintWarning("Fallback file keyring is being used\n\nYou can persist your file passphrase by running the following command:\ninfisical vault set file --passphrase <your-passphrase>\n")
err = keyring.Set(VAULT_BACKEND_FILE_MODE, MAIN_KEYRING_SERVICE, key, value)
}