From 2bec4f82edd68191d977d768beb4645d50e9f4b0 Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Sat, 9 Sep 2023 11:46:02 +0200 Subject: [PATCH] Mark twitch-token flag / envvar deprecated Signed-off-by: Knut Ahlers --- internal/service/access/access.go | 2 +- main.go | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/internal/service/access/access.go b/internal/service/access/access.go index 56bca78..5c80a40 100644 --- a/internal/service/access/access.go +++ b/internal/service/access/access.go @@ -23,7 +23,7 @@ type ( TwitchClient string TwitchClientSecret string - FallbackToken string + FallbackToken string // DEPRECATED TokenUpdateHook func() } diff --git a/main.go b/main.go index 3458099..8be7169 100644 --- a/main.go +++ b/main.go @@ -51,7 +51,7 @@ var ( StorageEncryptionPass string `flag:"storage-encryption-pass" default:"" description:"Passphrase to encrypt secrets inside storage (defaults to twitch-client:twitch-client-secret)"` TwitchClient string `flag:"twitch-client" default:"" description:"Client ID to act as"` TwitchClientSecret string `flag:"twitch-client-secret" default:"" description:"Secret for the Client ID"` - TwitchToken string `flag:"twitch-token" default:"" description:"OAuth token valid for client (fallback if no token was set in interface)"` + TwitchToken string `flag:"twitch-token" default:"" description:"OAuth token valid for client (fallback if no token was set in interface) -- DEPRECATED"` ValidateConfig bool `flag:"validate-config,v" default:"false" description:"Loads the config, logs any errors and quits with status 0 on success"` VersionAndExit bool `flag:"version" default:"false" description:"Prints current version and exits"` WaitForSelfcheck time.Duration `flag:"wait-for-selfcheck" default:"60s" description:"Maximum time to wait for the self-check to respond when behind load-balancers"` @@ -113,6 +113,10 @@ func initApp() error { }, ":") } + if cfg.TwitchToken != "" { + log.Warn("You are using the DEPRECATED --twitch-token flag / TWITCH_TOKEN env variable, please switch to web-based auth! - This flag will be removed in a later release!") + } + return nil }