-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.go
More file actions
33 lines (26 loc) · 1.16 KB
/
config.go
File metadata and controls
33 lines (26 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package vault
import "time"
// Config holds the configuration for a Vault instance.
type Config struct {
// AppID is the application identifier used for scoping secrets, flags, and config.
AppID string `json:"app_id" yaml:"app_id"`
// EncryptionKey is the master encryption key (32 bytes for AES-256-GCM).
// If empty, encryption is disabled (not recommended for production).
EncryptionKey []byte `json:"-" yaml:"-"`
// EncryptionKeyEnv is the environment variable name for the encryption key.
// Used as a fallback if EncryptionKey is not set directly.
EncryptionKeyEnv string `json:"encryption_key_env" yaml:"encryption_key_env"`
// FlagCacheTTL is the TTL for the flag evaluation cache.
// Defaults to 30 seconds.
FlagCacheTTL time.Duration `json:"flag_cache_ttl" yaml:"flag_cache_ttl"`
// SourcePollInterval is the interval for polling database sources.
// Defaults to 30 seconds.
SourcePollInterval time.Duration `json:"source_poll_interval" yaml:"source_poll_interval"`
}
// DefaultConfig returns a Config with sensible defaults.
func DefaultConfig() Config {
return Config{
FlagCacheTTL: 30 * time.Second,
SourcePollInterval: 30 * time.Second,
}
}