feat(vault-tui): implement KV client and service for managing secrets

- Added internal/vault/client.go for creating a Vault client with configuration settings.
- Introduced internal/vault/errors.go to classify Vault API errors for better UI handling.
- Created internal/vault/kv.go to manage KV secrets, including listing, reading, writing, and deleting operations.
- Implemented internal/vault/mounts.go to list and describe secret engine mounts.
- Developed internal/vault/service.go to provide a unified entry point for Vault operations.
- Added internal/vault/kv_test.go for comprehensive testing of KV operations.
- Introduced internal/ui/toast.go for transient notifications in the UI.
- Added renovate.json for dependency management and updates.
This commit is contained in:
2026-08-14 11:09:03 +02:00
commit ae30ba1240
85 changed files with 9413 additions and 0 deletions
+31
View File
@@ -0,0 +1,31 @@
// Package token owns everything about where a Vault token lives between
// runs: resolving one from flag/env/config/disk, validating it, keeping it
// renewed, and writing it back out — including in a form the real Vault CLI
// can read (see store_vaultcli.go).
package token
import "context"
// Store persists a single token value. Implementations must not log the
// token value anywhere.
type Store interface {
// Kind identifies the implementation for display: "vault-cli", "profile",
// or "none".
Kind() string
// Location is a display string: the token file path, or the external
// helper binary path.
Location() string
Get(ctx context.Context) (string, error)
Store(ctx context.Context, token string) error
Erase(ctx context.Context) error
}
// noneStore never persists anything; used when token.storage: none.
type noneStore struct{}
func NewNoneStore() Store { return noneStore{} }
func (noneStore) Kind() string { return "none" }
func (noneStore) Location() string { return "" }
func (noneStore) Get(context.Context) (string, error) { return "", nil }
func (noneStore) Store(context.Context, string) error { return nil }
func (noneStore) Erase(context.Context) error { return nil }