move

package
v0.97.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 2, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Cmd = &cobra.Command{
	Use:     "move <old-path> <new-path>",
	Aliases: []string{"mv"},
	Short:   "Move/rename a secret in Vault",
	Long: `Move/rename a secret in Vault using vault address from .sikalabs/vault/vault.yaml

This command reads the Vault address from the configuration file and moves
a secret from the old path to the new path by:
1. Reading the secret from the old path (vault kv get)
2. Writing it to the new path (vault kv put)
3. Deleting it from the old path (vault kv delete) or destroying it (vault kv destroy) with --destroy flag

The difference between delete and destroy:
- delete: Soft delete, can be undeleted
- destroy: Permanent deletion (destroys all versions and deletes metadata, completely removes from UI)

Example:
  slu vault move secret/old/path secret/new/path
  slu vault mv secret/old/path secret/new/path
  slu vault move -f custom/vault.yaml secret/old/path secret/new/path
  slu vault move --destroy secret/old/path secret/new/path
`,
	Args: cobra.ExactArgs(2),
	Run: func(c *cobra.Command, args []string) {
		oldPath := args[0]
		newPath := args[1]

		err := vaultMove(FlagFile, oldPath, newPath, FlagDestroy)
		if err != nil {
			fmt.Fprintf(os.Stderr, "Error: %v\n", err)
			os.Exit(1)
		}
	},
}
View Source
var FlagDestroy bool
View Source
var FlagFile string

Functions

This section is empty.

Types

type VaultConfig

type VaultConfig struct {
	Meta struct {
		SchemaVersion int `yaml:"SchemaVersion"`
	} `yaml:"Meta"`
	VaultAddr string `yaml:"VaultAddr"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL