Refactor vault functionality to dedicated package, fix import cycles with interface pattern, fix tests
This commit is contained in:
@@ -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"`
|
||||
}
|
||||
Reference in New Issue
Block a user