From 868e56e5e835c22c83e4a4e6bf027bf15eac3f8b Mon Sep 17 00:00:00 2001 From: ReaperOfVeriod Date: Sun, 25 Oct 2026 05:05:28 +0100 Subject: [PATCH] add OAuth scope status contract --- contracts/v1/twitch-oauth-status-response.json | 16 ++++++++++++++++ fixtures/v1/twitch-oauth-status.response.json | 8 ++++++++ 2 files changed, 24 insertions(+) create mode 100644 contracts/v1/twitch-oauth-status-response.json create mode 100644 fixtures/v1/twitch-oauth-status.response.json diff --git a/contracts/v1/twitch-oauth-status-response.json b/contracts/v1/twitch-oauth-status-response.json new file mode 100644 index 0000000..971b2ca --- /dev/null +++ b/contracts/v1/twitch-oauth-status-response.json @@ -0,0 +1,16 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://trixie.reaperofveriod.nl/contracts/v1/twitch-oauth-status-response.json", + "title": "Twitch OAuth scope status response", + "type": "object", + "additionalProperties": false, + "required": ["identity", "connected", "required_scopes", "granted_scopes", "missing_scopes", "reauthorization_required"], + "properties": { + "identity": { "enum": ["streamer", "bot", "moderator"] }, + "connected": { "type": "boolean" }, + "required_scopes": { "type": "array", "items": { "type": "string" }, "uniqueItems": true }, + "granted_scopes": { "type": "array", "items": { "type": "string" }, "uniqueItems": true }, + "missing_scopes": { "type": "array", "items": { "type": "string" }, "uniqueItems": true }, + "reauthorization_required": { "type": "boolean" } + } +} diff --git a/fixtures/v1/twitch-oauth-status.response.json b/fixtures/v1/twitch-oauth-status.response.json new file mode 100644 index 0000000..78fa7e3 --- /dev/null +++ b/fixtures/v1/twitch-oauth-status.response.json @@ -0,0 +1,8 @@ +{ + "identity": "streamer", + "connected": false, + "required_scopes": ["user:read:chat"], + "granted_scopes": [], + "missing_scopes": ["user:read:chat"], + "reauthorization_required": true +}