From 466ea933cd9566d8c01255b0ad26fe6842790ef6 Mon Sep 17 00:00:00 2001 From: Wils Dawson Date: Fri, 22 Nov 2024 15:43:44 -0800 Subject: [PATCH] Support Discord as an Auth provider (#161) This supports Discord as an auth provider. It depends on the next release of the Arcade Engine to work, so ~we'll hold off on merging for now.~ we'll do it live! --- README.md | 4 ++-- arcade/arcade/core/auth.py | 6 ++++++ arcade/arcade/sdk/auth/__init__.py | 2 ++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index cdb621e1..ba083acc 100644 --- a/README.md +++ b/README.md @@ -87,7 +87,7 @@ This connects to the Arcade Cloud Engine (`api.arcade-ai.com`) with all pre-buil For example, try: -``` +```text User (dev@arcade-ai.com): > star the ArcadeAI/arcade-ai repo on Github ``` @@ -96,7 +96,7 @@ Arcade AI will prompt you to authorize with GitHub and will star the [ArcadeAI/a You'll see: -``` +```text Assistant (gpt-4o): I starred the ArcadeAI/arcade-ai repo on Github for you! ``` diff --git a/arcade/arcade/core/auth.py b/arcade/arcade/core/auth.py index ad024932..cb95cd95 100644 --- a/arcade/arcade/core/auth.py +++ b/arcade/arcade/core/auth.py @@ -29,6 +29,12 @@ class OAuth2(ToolAuthorization): """The scope(s) needed for the authorized action.""" +class Discord(OAuth2): + """Marks a tool as requiring Discord authorization.""" + + provider_id: str = "discord" + + class Google(OAuth2): """Marks a tool as requiring Google authorization.""" diff --git a/arcade/arcade/sdk/auth/__init__.py b/arcade/arcade/sdk/auth/__init__.py index fb3c43f2..2c09ffed 100644 --- a/arcade/arcade/sdk/auth/__init__.py +++ b/arcade/arcade/sdk/auth/__init__.py @@ -1,4 +1,5 @@ from arcade.core.auth import ( + Discord, GitHub, Google, LinkedIn, @@ -11,6 +12,7 @@ from arcade.core.auth import ( ) __all__ = [ + "Discord", "GitHub", "Google", "LinkedIn",