feat(voice): время жизни токена LiveKit настраивается (по умолчанию 10 минут)

AGENT.md 7.14: токен выдаётся на 10 минут и переиздаётся клиентом до истечения.
Значение задаётся LIVEKIT_TOKEN_TTL_SECONDS.
This commit is contained in:
2026-09-20 18:32:47 +03:00
parent 6d495f4521
commit 9e7d023f7e
2 changed files with 9 additions and 6 deletions
+8 -5
View File
@@ -41,11 +41,14 @@ type Config struct {
LiveKitAPIKey string LiveKitAPIKey string
LiveKitAPISecret string LiveKitAPISecret string
LiveKitURL string LiveKitURL string
Version string // LiveKitTokenTTL — время жизни токена доступа к комнате (AGENT.md 7.14:
Commit string // по умолчанию 10 минут, клиент переиздаёт токен до истечения).
BuildDate string LiveKitTokenTTL time.Duration
ShutdownTTL time.Duration Version string
Maintenance time.Duration Commit string
BuildDate string
ShutdownTTL time.Duration
Maintenance time.Duration
} }
func Load() (Config, error) { func Load() (Config, error) {
+1 -1
View File
@@ -96,7 +96,7 @@ func New(cfg config.Config, db *database.DB, logger *slog.Logger, deps Deps) *Se
slowmode: map[string]time.Time{}, slowmode: map[string]time.Time{},
presence: map[uint64]time.Time{}, presence: map[uint64]time.Time{},
webhookSeen: map[string]time.Time{}, webhookSeen: map[string]time.Time{},
voice: voice.NewIssuer(cfg.LiveKitAPIKey, cfg.LiveKitAPISecret, time.Hour), voice: voice.NewIssuer(cfg.LiveKitAPIKey, cfg.LiveKitAPISecret, cfg.LiveKitTokenTTL),
} }
switch { switch {
case deps.Permissions != nil: case deps.Permissions != nil: