diff --git a/internal/config/config.go b/internal/config/config.go index f17f9c3..5dee95e 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -32,14 +32,21 @@ type FuncConfig struct { } type Auth struct { + SignAlg string `mapstructure:"sign_alg"` + HMACSecretPath string `mapstructure:"hmac_secret_path"` RefreshTokenTTL time.Duration `mapstructure:"refresh_token_ttl"` AccessTokenTTL time.Duration `mapstructure:"access_token_ttl"` } +type Data struct { + DataPath string `mapstructure:"data_dir"` +} + type Config struct { Server ServerConfig `mapstructure:"server"` Functions FuncConfig `mapstructure:"functions"` Auth Auth `mapstructure:"auth"` + Data Data `mapstructure:"data"` } var configPath atomic.Value // string @@ -54,10 +61,14 @@ var defaults = map[string]any{ "server.block.enabled": true, "server.block.block_dir": "./blocks", + "data.data_dir": "./data", + "functions.func_dir": "./functions", "auth.refresh_token_ttl": 24 * time.Hour, "auth.access_token_ttl": 15 * time.Minute, + "auth.sign_alg": "HS256", + "auth.hmac_secret_path": "./secret/hmac_secret", } func read(cfg *Config) error {