From fb69e9ef7759b347f367d1d8fc6838ef4d0d7406 Mon Sep 17 00:00:00 2001 From: Eric Gustin <34000337+EricGustin@users.noreply.github.com> Date: Thu, 6 Mar 2025 16:06:52 -0800 Subject: [PATCH] Add Notion Auth Provider (#277) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Screenshot 2025-03-06 at 11 01 24 AM --- arcade/arcade/core/auth.py | 51 ++++++++++++++++++------------ arcade/arcade/sdk/auth/__init__.py | 2 ++ 2 files changed, 32 insertions(+), 21 deletions(-) diff --git a/arcade/arcade/core/auth.py b/arcade/arcade/core/auth.py index 7ff48bc2..a7faf136 100644 --- a/arcade/arcade/core/auth.py +++ b/arcade/arcade/core/auth.py @@ -60,24 +60,6 @@ class Dropbox(OAuth2): super().__init__(id=id, scopes=scopes) -class Google(OAuth2): - """Marks a tool as requiring Google authorization.""" - - provider_id: str = "google" - - 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.""" - - provider_id: str = "slack" - - def __init__(self, *, id: Optional[str] = None, scopes: Optional[list[str]] = None): # noqa: A002 - super().__init__(id=id, scopes=scopes) - - class GitHub(OAuth2): """Marks a tool as requiring GitHub App authorization.""" @@ -87,10 +69,10 @@ class GitHub(OAuth2): super().__init__(id=id, scopes=scopes) -class X(OAuth2): - """Marks a tool as requiring X (Twitter) authorization.""" +class Google(OAuth2): + """Marks a tool as requiring Google authorization.""" - provider_id: str = "x" + provider_id: str = "google" def __init__(self, *, id: Optional[str] = None, scopes: Optional[list[str]] = None): # noqa: A002 super().__init__(id=id, scopes=scopes) @@ -105,6 +87,24 @@ class LinkedIn(OAuth2): super().__init__(id=id, scopes=scopes) +class Notion(OAuth2): + """Marks a tool as requiring Notion authorization.""" + + provider_id: str = "notion" + + 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.""" + + provider_id: str = "slack" + + def __init__(self, *, id: Optional[str] = None, scopes: Optional[list[str]] = None): # noqa: A002 + super().__init__(id=id, scopes=scopes) + + class Spotify(OAuth2): """Marks a tool as requiring Spotify authorization.""" @@ -114,6 +114,15 @@ class Spotify(OAuth2): super().__init__(id=id, scopes=scopes) +class X(OAuth2): + """Marks a tool as requiring X (Twitter) authorization.""" + + provider_id: str = "x" + + def __init__(self, *, id: Optional[str] = None, scopes: Optional[list[str]] = None): # noqa: A002 + super().__init__(id=id, scopes=scopes) + + class Zoom(OAuth2): """Marks a tool as requiring Zoom authorization.""" diff --git a/arcade/arcade/sdk/auth/__init__.py b/arcade/arcade/sdk/auth/__init__.py index 81ddb921..f5121cc7 100644 --- a/arcade/arcade/sdk/auth/__init__.py +++ b/arcade/arcade/sdk/auth/__init__.py @@ -5,6 +5,7 @@ from arcade.core.auth import ( GitHub, Google, LinkedIn, + Notion, OAuth2, Slack, Spotify, @@ -20,6 +21,7 @@ __all__ = [ "GitHub", "Google", "LinkedIn", + "Notion", "OAuth2", "Slack", "Spotify",