fix: replace magic file permissions and add crypto constant comments
Replace hardcoded 0o600 with secret.FilePerms constant for consistency. Add explanatory comments for cryptographic constants (32-byte keys, bech32 encoding parameters) rather than extracting them as they are well-known cryptographic standard values.
This commit is contained in:
@@ -219,7 +219,7 @@ func (cli *Instance) VaultImport(cmd *cobra.Command, vaultName string) error {
|
||||
ltPublicKey := ltIdentity.Recipient().String()
|
||||
secret.Debug("Storing long-term public key", "pubkey", ltPublicKey, "vault_dir", vaultDir)
|
||||
|
||||
if err := afero.WriteFile(cli.fs, pubKeyPath, []byte(ltPublicKey), 0o600); err != nil {
|
||||
if err := afero.WriteFile(cli.fs, pubKeyPath, []byte(ltPublicKey), secret.FilePerms); err != nil {
|
||||
return fmt.Errorf("failed to store long-term public key: %w", err)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user