Documentation
¶
Index ¶
- Constants
- func Decrypt(key, ciphertext []byte) ([]byte, error)
- func Encrypt(key, plaintext []byte) ([]byte, error)
- func GenerateKey() ([]byte, error)
- func IsDisabled() bool
- func KeyExists(configDir string) bool
- func LoadKey(configDir string) ([]byte, error)
- func SaveKey(configDir string, key []byte) error
- type Cache
- func (c *Cache) Clear() error
- func (c *Cache) ClearEnv(env string) error
- func (c *Cache) Delete(service, env string) error
- func (c *Cache) Get(service, env string) (*types.ResolvedCredentials, error)
- func (c *Cache) Set(service, env string, creds *types.ResolvedCredentials) error
- func (c *Cache) Status() (*Status, error)
- type Config
- type Entry
- type EntryInfo
- type Status
Constants ¶
View Source
const ( // DefaultCacheDir is the default cache directory name DefaultCacheDir = "cache" // DefaultTTL is the default cache TTL DefaultTTL = 1 * time.Hour // CacheFileExtension is the extension for cache files CacheFileExtension = ".enc" )
View Source
const ( // KeySize is the size of the encryption key in bytes (AES-256) KeySize = 32 // KeyFileName is the name of the encryption key file KeyFileName = ".key" )
Variables ¶
This section is empty.
Functions ¶
func GenerateKey ¶
GenerateKey generates a new random encryption key
func IsDisabled ¶
func IsDisabled() bool
IsDisabled checks if caching is disabled via environment variable
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache manages credential caching
func (*Cache) Get ¶
func (c *Cache) Get(service, env string) (*types.ResolvedCredentials, error)
Get retrieves cached credentials for a service/env
type Entry ¶
type Entry struct {
Service string `json:"service"`
Env string `json:"env"`
CachedAt time.Time `json:"cached_at"`
TTLSeconds int `json:"ttl_seconds"`
Credentials *types.ResolvedCredentials `json:"credentials"`
}
Entry represents a cached credential entry
Click to show internal directories.
Click to hide internal directories.