Refactor vault functionality to dedicated package, fix import cycles with interface pattern, fix tests

This commit is contained in:
2025-05-29 12:48:36 -07:00
parent c33385be6c
commit ddb395901b
18 changed files with 1847 additions and 2128 deletions
+32
View File
@@ -0,0 +1,32 @@
package secret
import (
"time"
)
// VaultMetadata contains information about a vault
type VaultMetadata struct {
Name string `json:"name"`
CreatedAt time.Time `json:"createdAt"`
Description string `json:"description,omitempty"`
}
// UnlockKeyMetadata contains information about an unlock key
type UnlockKeyMetadata struct {
ID string `json:"id"`
Type string `json:"type"` // passphrase, pgp, keychain
CreatedAt time.Time `json:"createdAt"`
Flags []string `json:"flags,omitempty"`
}
// SecretMetadata contains information about a secret
type SecretMetadata struct {
Name string `json:"name"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
}
// Configuration represents the global configuration
type Configuration struct {
DefaultVault string `json:"defaultVault,omitempty"`
}