From ef5b19b4a2e204a040d1514ff87def02f0dbc77c Mon Sep 17 00:00:00 2001 From: Nate Barbettini Date: Fri, 14 Mar 2025 13:52:46 -0700 Subject: [PATCH] feat: Add Reddit and Twitch named providers (#294) Adding auth support for future Reddit and Twitch tools. --- arcade/arcade/core/auth.py | 18 ++++++++++++++++++ arcade/arcade/sdk/auth/__init__.py | 4 ++++ 2 files changed, 22 insertions(+) diff --git a/arcade/arcade/core/auth.py b/arcade/arcade/core/auth.py index a7faf136..354a3c9a 100644 --- a/arcade/arcade/core/auth.py +++ b/arcade/arcade/core/auth.py @@ -96,6 +96,15 @@ class Notion(OAuth2): super().__init__(id=id, scopes=scopes) +class Reddit(OAuth2): + """Marks a tool as requiring Reddit authorization.""" + + provider_id: str = "reddit" + + def __init__(self, *, id: Optional[str] = None, scopes: Optional[list[str]] = None): # noqa: A002 + super().__init__(id=id, scopes=scopes) + + class Slack(OAuth2): """Marks a tool as requiring Slack (user token) authorization.""" @@ -114,6 +123,15 @@ class Spotify(OAuth2): super().__init__(id=id, scopes=scopes) +class Twitch(OAuth2): + """Marks a tool as requiring Twitch authorization.""" + + provider_id: str = "twitch" + + def __init__(self, *, id: Optional[str] = None, scopes: Optional[list[str]] = None): # noqa: A002 + super().__init__(id=id, scopes=scopes) + + class X(OAuth2): """Marks a tool as requiring X (Twitter) authorization.""" diff --git a/arcade/arcade/sdk/auth/__init__.py b/arcade/arcade/sdk/auth/__init__.py index f5121cc7..0c61297f 100644 --- a/arcade/arcade/sdk/auth/__init__.py +++ b/arcade/arcade/sdk/auth/__init__.py @@ -7,9 +7,11 @@ from arcade.core.auth import ( LinkedIn, Notion, OAuth2, + Reddit, Slack, Spotify, ToolAuthorization, + Twitch, X, Zoom, ) @@ -23,9 +25,11 @@ __all__ = [ "LinkedIn", "Notion", "OAuth2", + "Reddit", "Slack", "Spotify", "ToolAuthorization", + "Twitch", "X", "Zoom", ]