From adf61a4d1d56900bf70b4ac29951b176c1875966 Mon Sep 17 00:00:00 2001 From: Alexey Date: Thu, 18 Dec 2025 11:25:07 +0200 Subject: [PATCH] add token config --- internal/config/config.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/internal/config/config.go b/internal/config/config.go index 738a3d8..f17f9c3 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -31,9 +31,15 @@ type FuncConfig struct { FunctionDir string `mapstructure:"func_dir"` } +type Auth struct { + RefreshTokenTTL time.Duration `mapstructure:"refresh_token_ttl"` + AccessTokenTTL time.Duration `mapstructure:"access_token_ttl"` +} + type Config struct { Server ServerConfig `mapstructure:"server"` Functions FuncConfig `mapstructure:"functions"` + Auth Auth `mapstructure:"auth"` } var configPath atomic.Value // string @@ -49,6 +55,9 @@ var defaults = map[string]any{ "server.block.block_dir": "./blocks", "functions.func_dir": "./functions", + + "auth.refresh_token_ttl": 24 * time.Hour, + "auth.access_token_ttl": 15 * time.Minute, } func read(cfg *Config) error {