From 908d8fd969bac20b51c14d9ae627d4bea7d5be45 Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Sat, 21 Aug 2021 01:25:19 +0200 Subject: [PATCH] Sec: Use app-access-token instead of user-token for schedule fetching Signed-off-by: Knut Ahlers --- mod_streamSchedule.go | 8 ++++---- wiki/Home.md | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/mod_streamSchedule.go b/mod_streamSchedule.go index 7c45463..0f71264 100644 --- a/mod_streamSchedule.go +++ b/mod_streamSchedule.go @@ -48,7 +48,7 @@ func (m *modStreamSchedule) Initialize(id string, crontab *cron.Cron, discord *d "embed_title", "twitch_channel_id", "twitch_client_id", - "twitch_token", + "twitch_client_secret", ); err != nil { return errors.Wrap(err, "validating attributes") } @@ -68,9 +68,9 @@ func (m modStreamSchedule) cronUpdateSchedule() { twitch := newTwitchAdapter( // @attr twitch_client_id required string "" Twitch client ID the token was issued for m.attrs.MustString("twitch_client_id", nil), - "", // No Client Secret used - // @attr twitch_token required string "" Token for the user the `twitch_channel_id` belongs to - m.attrs.MustString("twitch_token", nil), + // @attr twitch_client_secret required string "" Secret for the Twitch app identified with twitch_client_id + m.attrs.MustString("twitch_client_secret", nil), + "", // No User-Token used ) data, err := twitch.GetChannelStreamSchedule( diff --git a/wiki/Home.md b/wiki/Home.md index 294ce57..a6c355f 100644 --- a/wiki/Home.md +++ b/wiki/Home.md @@ -134,7 +134,7 @@ Posts stream schedule derived from Twitch schedule as embed in Discord channel | `embed_title` | ✅ | string | | Title of the embed | | `twitch_channel_id` | ✅ | string | | ID (not name) of the channel to fetch the schedule from | | `twitch_client_id` | ✅ | string | | Twitch client ID the token was issued for | -| `twitch_token` | ✅ | string | | Token for the user the `twitch_channel_id` belongs to | +| `twitch_client_secret` | ✅ | string | | Secret for the Twitch app identified with twitch_client_id | | `cron` | | string | `*/10 * * * *` | When to execute the schedule transfer | | `embed_color` | | int64 | `0x2ECC71` | Integer / HEX representation of the color for the embed | | `embed_description` | | string | | Description for the embed block |