feat(voice): время жизни токена LiveKit настраивается (по умолчанию 10 минут)
AGENT.md 7.14: токен выдаётся на 10 минут и переиздаётся клиентом до истечения. Значение задаётся LIVEKIT_TOKEN_TTL_SECONDS.
This commit is contained in:
@@ -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) {
|
||||||
|
|||||||
@@ -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:
|
||||||
|
|||||||
Reference in New Issue
Block a user