mirror of
https://github.com/agentrhq/authsome.git
synced 2026-09-19 01:34:19 +08:00
feat: add ProviderType classification and JSONC support for providers
Adds a `type` field (app | llm | mcp) to ProviderDefinition so consumers can filter and display providers by category. Backfills all 71 bundled providers. Also introduces a `parse_jsonc` utility that strips // and /* */ comments before JSON parsing, and wires it into the bundled loader and the CLI register command so both .json and .jsonc provider files are accepted. Closes #362 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -18,9 +18,9 @@ Perform a **web search** to determine what authentication methods the target ser
|
||||
|
||||
---
|
||||
|
||||
## Step 2: Write the provider JSON
|
||||
## Step 2: Write the provider JSON (or JSONC)
|
||||
|
||||
Create a `.json` file using one of the templates below.
|
||||
Create a `.json` or `.jsonc` file using one of the templates below. JSONC files support `//` line comments and `/* */` block comments, which is useful for documenting non-obvious field choices.
|
||||
|
||||
### Template A — OAuth2 Provider
|
||||
|
||||
@@ -31,6 +31,7 @@ Create a `.json` file using one of the templates below.
|
||||
"display_name": "<Service Display Name>",
|
||||
"description": "Short description shown in the dashboard.",
|
||||
"logo": "https://example.com/logo.svg",
|
||||
"type": "app",
|
||||
"auth_type": "oauth2",
|
||||
"flow": "dcr_pkce",
|
||||
"api_url": "https://example.com",
|
||||
@@ -70,6 +71,7 @@ Create a `.json` file using one of the templates below.
|
||||
"display_name": "<Service Display Name>",
|
||||
"description": "Short description shown in the dashboard.",
|
||||
"logo": "https://example.com/logo.svg",
|
||||
"type": "app",
|
||||
"auth_type": "api_key",
|
||||
"flow": "api_key",
|
||||
"api_url": "api.example.com",
|
||||
@@ -98,6 +100,7 @@ Create a `.json` file using one of the templates below.
|
||||
| `display_name` | Human-readable name (e.g., `"GitHub"`). |
|
||||
| `description` | Optional short dashboard description. |
|
||||
| `logo` | Optional logo URL shown in the dashboard. If omitted or unreachable, the dashboard falls back to provider initials. |
|
||||
| `type` | **Recommended.** Provider category: `"app"`, `"llm"`, or `"mcp"`. Used to filter and display providers by category. |
|
||||
| `auth_type` | `"oauth2"` or `"api_key"`. |
|
||||
| `flow` | Default flow. See flow selection guide below. |
|
||||
| `api_url` | **Recommended.** The API host for proxy routing (e.g., `"api.openai.com"`). Can be a bare host, a full URL, or a host regex prefixed with `regex:` (e.g., `"regex:^api[0-9]+\\.github\\.com$"`). |
|
||||
|
||||
@@ -18,7 +18,7 @@ from importlib.metadata import version as _pkg_version
|
||||
from loguru import logger as _logger
|
||||
|
||||
from authsome.auth.models.connection import ConnectionRecord, Sensitive
|
||||
from authsome.auth.models.enums import AuthType, ConnectionStatus, ExportFormat, FlowType
|
||||
from authsome.auth.models.enums import AuthType, ConnectionStatus, ExportFormat, FlowType, ProviderType
|
||||
from authsome.auth.models.provider import ProviderDefinition
|
||||
from authsome.errors import (
|
||||
AuthenticationFailedError,
|
||||
@@ -56,6 +56,7 @@ __all__ = [
|
||||
"ExportFormat",
|
||||
"FlowType",
|
||||
"ProviderDefinition",
|
||||
"ProviderType",
|
||||
"Sensitive",
|
||||
# Errors
|
||||
"AuthsomeError",
|
||||
|
||||
@@ -1,3 +1 @@
|
||||
"""Bundled provider definitions package for authsome."""
|
||||
|
||||
# TODO: Bundled provider definitions can be jsonc - so we can add comments
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"display_name": "Ahrefs",
|
||||
"logo": "img.logo.dev/name/ahrefs",
|
||||
"description": "SEO intelligence, backlink analysis, and keyword research APIs.",
|
||||
"type": "app",
|
||||
"auth_type": "api_key",
|
||||
"flow": "api_key",
|
||||
"api_url": "api.ahrefs.com",
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"display_name": "Apollo",
|
||||
"logo": "img.logo.dev/name/apollo",
|
||||
"description": "Sales intelligence and prospecting data for go-to-market workflows.",
|
||||
"type": "app",
|
||||
"auth_type": "api_key",
|
||||
"flow": "api_key",
|
||||
"api_url": "api.apollo.io",
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"display_name": "Ashby",
|
||||
"logo": "img.logo.dev/name/ashby",
|
||||
"description": "Recruiting operations, candidate data, and hiring workflow automation.",
|
||||
"type": "app",
|
||||
"auth_type": "api_key",
|
||||
"flow": "api_key",
|
||||
"api_url": "api.ashbyhq.com",
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"display_name": "Atlassian",
|
||||
"logo": "img.logo.dev/name/atlassian",
|
||||
"description": "Jira and Atlassian workspace APIs for project and issue management.",
|
||||
"type": "app",
|
||||
"auth_type": "oauth2",
|
||||
"flow": "pkce",
|
||||
"api_url": "api.atlassian.com",
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"display_name": "Beehiiv",
|
||||
"logo": "img.logo.dev/name/beehiiv",
|
||||
"description": "Newsletter publishing, subscribers, and audience growth automation.",
|
||||
"type": "app",
|
||||
"auth_type": "api_key",
|
||||
"flow": "api_key",
|
||||
"api_url": "api.beehiiv.com",
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"display_name": "Brevo",
|
||||
"logo": "img.logo.dev/name/brevo",
|
||||
"description": "Email marketing, transactional messaging, and contact management APIs.",
|
||||
"type": "app",
|
||||
"auth_type": "api_key",
|
||||
"flow": "api_key",
|
||||
"api_url": "api.brevo.com",
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"display_name": "Buffer",
|
||||
"logo": "img.logo.dev/name/buffer",
|
||||
"description": "Social scheduling and publishing workflows for connected channels.",
|
||||
"type": "app",
|
||||
"auth_type": "api_key",
|
||||
"flow": "api_key",
|
||||
"api_url": "api.bufferapp.com",
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"display_name": "Calendly",
|
||||
"logo": "img.logo.dev/name/calendly",
|
||||
"description": "Scheduling links, events, invitees, and calendar booking automation.",
|
||||
"type": "app",
|
||||
"auth_type": "api_key",
|
||||
"flow": "api_key",
|
||||
"api_url": "api.calendly.com",
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"display_name": "Clearbit",
|
||||
"logo": "img.logo.dev/name/clearbit",
|
||||
"description": "Company and contact enrichment data for sales and marketing workflows.",
|
||||
"type": "app",
|
||||
"auth_type": "api_key",
|
||||
"flow": "api_key",
|
||||
"api_url": "api.clearbit.com",
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"display_name": "Cloudflare",
|
||||
"logo": "img.logo.dev/name/cloudflare",
|
||||
"description": "Cloudflare API token access for managing zones, DNS, Workers, and account resources.",
|
||||
"type": "app",
|
||||
"auth_type": "api_key",
|
||||
"flow": "api_key",
|
||||
"api_url": "https://api.cloudflare.com/client/v4",
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"display_name": "Confluence",
|
||||
"logo": "img.logo.dev/name/confluence",
|
||||
"description": "Confluence Cloud access for reading and writing pages, spaces, and content via the Confluence REST API.",
|
||||
"type": "app",
|
||||
"auth_type": "oauth2",
|
||||
"flow": "pkce",
|
||||
"api_url": "https://api.atlassian.com/ex/confluence",
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"display_name": "Discord",
|
||||
"logo": "img.logo.dev/name/discord",
|
||||
"description": "Discord identity, guild, and messaging integrations over OAuth.",
|
||||
"type": "app",
|
||||
"auth_type": "oauth2",
|
||||
"flow": "pkce",
|
||||
"api_url": "discord.com",
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"display_name": "Dub.co",
|
||||
"logo": "img.logo.dev/name/dub",
|
||||
"description": "Short links, conversion tracking, and link analytics from Dub.co.",
|
||||
"type": "app",
|
||||
"auth_type": "api_key",
|
||||
"flow": "api_key",
|
||||
"api_url": "api.dub.co",
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"display_name": "G2",
|
||||
"logo": "img.logo.dev/name/g2",
|
||||
"description": "Review, buyer intent, and marketplace data from G2.",
|
||||
"type": "app",
|
||||
"auth_type": "api_key",
|
||||
"flow": "api_key",
|
||||
"api_url": "api.g2.com",
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"display_name": "GitHub",
|
||||
"logo": "img.logo.dev/name/github",
|
||||
"description": "Connect GitHub to manage repositories, pull requests, users, and developer automation with vault-backed credentials.",
|
||||
"type": "app",
|
||||
"auth_type": "oauth2",
|
||||
"flow": "pkce",
|
||||
"api_url": [
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"display_name": "GitLab",
|
||||
"logo": "img.logo.dev/name/gitlab",
|
||||
"description": "GitLab repositories, user data, and project automation over OAuth.",
|
||||
"type": "app",
|
||||
"auth_type": "oauth2",
|
||||
"flow": "pkce",
|
||||
"api_url": "gitlab.com",
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"display_name": "Google Admin",
|
||||
"logo": "img.logo.dev/name/google",
|
||||
"description": "Google Workspace Admin access for managing users, groups, and organizational units via the Admin SDK.",
|
||||
"type": "app",
|
||||
"auth_type": "oauth2",
|
||||
"flow": "pkce",
|
||||
"api_url": "https://admin.googleapis.com/admin/directory/v1",
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"display_name": "Google Analytics",
|
||||
"logo": "img.logo.dev/name/google-analytics",
|
||||
"description": "Google Analytics access for reading web analytics data via the Analytics Data API.",
|
||||
"type": "app",
|
||||
"auth_type": "oauth2",
|
||||
"flow": "pkce",
|
||||
"api_url": "https://analyticsdata.googleapis.com/v1beta",
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"display_name": "Google Calendar",
|
||||
"logo": "img.logo.dev/name/google-calendar",
|
||||
"description": "Google Calendar access for reading and managing calendar events via the Calendar API.",
|
||||
"type": "app",
|
||||
"auth_type": "oauth2",
|
||||
"flow": "pkce",
|
||||
"api_url": "https://www.googleapis.com/calendar/v3",
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"display_name": "Google Chat",
|
||||
"logo": "img.logo.dev/name/google-chat",
|
||||
"description": "Google Chat access for sending and managing messages and spaces via the Chat API.",
|
||||
"type": "app",
|
||||
"auth_type": "oauth2",
|
||||
"flow": "pkce",
|
||||
"api_url": "https://chat.googleapis.com/v1",
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"display_name": "Google Classroom",
|
||||
"logo": "img.logo.dev/name/google-classroom",
|
||||
"description": "Google Classroom access for managing courses, assignments, and student rosters via the Classroom API.",
|
||||
"type": "app",
|
||||
"auth_type": "oauth2",
|
||||
"flow": "pkce",
|
||||
"api_url": "https://classroom.googleapis.com/v1",
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"display_name": "Google Docs",
|
||||
"logo": "img.logo.dev/name/google-docs",
|
||||
"description": "Google Docs access for reading and editing documents via the Docs API.",
|
||||
"type": "app",
|
||||
"auth_type": "oauth2",
|
||||
"flow": "pkce",
|
||||
"api_url": "https://docs.googleapis.com/v1",
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"display_name": "Google Drive",
|
||||
"logo": "img.logo.dev/name/google-drive",
|
||||
"description": "Google Drive access for managing files and folders via the Drive API.",
|
||||
"type": "app",
|
||||
"auth_type": "oauth2",
|
||||
"flow": "pkce",
|
||||
"api_url": "https://www.googleapis.com/drive/v3",
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"display_name": "Google Forms",
|
||||
"logo": "img.logo.dev/name/google-forms",
|
||||
"description": "Google Forms access for creating forms and reading responses via the Forms API.",
|
||||
"type": "app",
|
||||
"auth_type": "oauth2",
|
||||
"flow": "pkce",
|
||||
"api_url": "https://forms.googleapis.com/v1",
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"display_name": "Gmail",
|
||||
"logo": "img.logo.dev/name/gmail",
|
||||
"description": "Gmail access for reading, composing, and managing email via the Gmail API.",
|
||||
"type": "app",
|
||||
"auth_type": "oauth2",
|
||||
"flow": "pkce",
|
||||
"api_url": "https://gmail.googleapis.com/gmail/v1",
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"display_name": "Google Meet",
|
||||
"logo": "img.logo.dev/name/google-meet",
|
||||
"description": "Google Meet access for creating and managing video meeting spaces via the Meet REST API.",
|
||||
"type": "app",
|
||||
"auth_type": "oauth2",
|
||||
"flow": "pkce",
|
||||
"api_url": "https://meet.googleapis.com/v2",
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"display_name": "Google Photos",
|
||||
"logo": "img.logo.dev/name/google-photos",
|
||||
"description": "Google Photos access for reading and managing photo libraries via the Photos Library API.",
|
||||
"type": "app",
|
||||
"auth_type": "oauth2",
|
||||
"flow": "pkce",
|
||||
"api_url": "https://photoslibrary.googleapis.com/v1",
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"display_name": "Google Search Console",
|
||||
"logo": "img.logo.dev/name/google-search-console",
|
||||
"description": "Google Search Console access for reading search analytics and sitemaps via the Search Console API.",
|
||||
"type": "app",
|
||||
"auth_type": "oauth2",
|
||||
"flow": "pkce",
|
||||
"api_url": "https://searchconsole.googleapis.com/v1",
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"display_name": "Google Sheets",
|
||||
"logo": "img.logo.dev/name/google-sheets",
|
||||
"description": "Google Sheets access for reading and editing spreadsheets via the Sheets API.",
|
||||
"type": "app",
|
||||
"auth_type": "oauth2",
|
||||
"flow": "pkce",
|
||||
"api_url": "https://sheets.googleapis.com/v4",
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"display_name": "Google Slides",
|
||||
"logo": "img.logo.dev/name/google-slides",
|
||||
"description": "Google Slides access for reading and editing presentations via the Slides API.",
|
||||
"type": "app",
|
||||
"auth_type": "oauth2",
|
||||
"flow": "pkce",
|
||||
"api_url": "https://slides.googleapis.com/v1",
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"display_name": "Google Tasks",
|
||||
"logo": "img.logo.dev/name/google-tasks",
|
||||
"description": "Google Tasks access for reading and managing task lists and tasks via the Tasks API.",
|
||||
"type": "app",
|
||||
"auth_type": "oauth2",
|
||||
"flow": "pkce",
|
||||
"api_url": "https://tasks.googleapis.com/tasks/v1",
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"display_name": "Vertex AI",
|
||||
"logo": "img.logo.dev/name/google-cloud",
|
||||
"description": "Google Vertex AI access for generative models, embeddings, and ML pipelines via the Vertex AI API.",
|
||||
"type": "llm",
|
||||
"auth_type": "oauth2",
|
||||
"flow": "pkce",
|
||||
"api_url": "https://us-central1-aiplatform.googleapis.com/v1",
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"display_name": "YouTube",
|
||||
"logo": "img.logo.dev/name/youtube",
|
||||
"description": "YouTube Data API access for managing channels, videos, playlists, and comments.",
|
||||
"type": "app",
|
||||
"auth_type": "oauth2",
|
||||
"flow": "pkce",
|
||||
"api_url": "https://www.googleapis.com/youtube/v3",
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"display_name": "Google",
|
||||
"logo": "img.logo.dev/name/google",
|
||||
"description": "Google identity and Google API access with OAuth-backed credentials.",
|
||||
"type": "app",
|
||||
"auth_type": "oauth2",
|
||||
"flow": "pkce",
|
||||
"api_url": "regex:.*googleapis.*",
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"display_name": "HubSpot",
|
||||
"logo": "img.logo.dev/name/hubspot",
|
||||
"description": "CRM contacts, companies, deals, owners, and HubSpot workflow data.",
|
||||
"type": "app",
|
||||
"auth_type": "oauth2",
|
||||
"flow": "pkce",
|
||||
"api_url": "api.hubapi.com",
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"display_name": "Hunter",
|
||||
"logo": "img.logo.dev/name/hunter",
|
||||
"description": "Email discovery and verification data for outreach workflows.",
|
||||
"type": "app",
|
||||
"auth_type": "api_key",
|
||||
"flow": "api_key",
|
||||
"api_url": "api.hunter.io",
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"display_name": "Instantly",
|
||||
"logo": "img.logo.dev/name/instantly",
|
||||
"description": "Outbound email campaign and lead management automation.",
|
||||
"type": "app",
|
||||
"auth_type": "api_key",
|
||||
"flow": "api_key",
|
||||
"api_url": "api.instantly.ai",
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"display_name": "Intercom",
|
||||
"logo": "img.logo.dev/name/intercom",
|
||||
"description": "Customer conversations, contacts, and support automation APIs.",
|
||||
"type": "app",
|
||||
"auth_type": "api_key",
|
||||
"flow": "api_key",
|
||||
"api_url": "api.intercom.io",
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"display_name": "Jira",
|
||||
"logo": "img.logo.dev/name/jira",
|
||||
"description": "Jira Cloud access for reading and managing issues, projects, and workflows via the Jira REST API.",
|
||||
"type": "app",
|
||||
"auth_type": "oauth2",
|
||||
"flow": "pkce",
|
||||
"api_url": "https://api.atlassian.com/ex/jira",
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"display_name": "Keywords Everywhere",
|
||||
"logo": "img.logo.dev/name/keywords-everywhere",
|
||||
"description": "Keyword volume, CPC, and SEO metrics for search workflows.",
|
||||
"type": "app",
|
||||
"auth_type": "api_key",
|
||||
"flow": "api_key",
|
||||
"api_url": "api.keywordseverywhere.com",
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"display_name": "Klaviyo (OAuth)",
|
||||
"logo": "img.logo.dev/name/klaviyo",
|
||||
"description": "OAuth access for Klaviyo app integrations and account APIs.",
|
||||
"type": "app",
|
||||
"auth_type": "oauth2",
|
||||
"flow": "pkce",
|
||||
"api_url": "a.klaviyo.com",
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"display_name": "Klaviyo",
|
||||
"logo": "img.logo.dev/name/klaviyo",
|
||||
"description": "Klaviyo profiles, campaigns, and marketing automation API access.",
|
||||
"type": "app",
|
||||
"auth_type": "api_key",
|
||||
"flow": "api_key",
|
||||
"api_url": "a.klaviyo.com",
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"display_name": "Lemlist",
|
||||
"logo": "img.logo.dev/name/lemlist",
|
||||
"description": "Cold outreach campaigns, leads, and email engagement workflows.",
|
||||
"type": "app",
|
||||
"auth_type": "api_key",
|
||||
"flow": "api_key",
|
||||
"api_url": "api.lemlist.com",
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"display_name": "Linear",
|
||||
"logo": "img.logo.dev/name/linear",
|
||||
"description": "Issues, teams, projects, and product operations through Linear.",
|
||||
"type": "app",
|
||||
"auth_type": "oauth2",
|
||||
"flow": "pkce",
|
||||
"api_url": "regex:.*\\.linear\\.app",
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
{
|
||||
"schema_version": 1,
|
||||
"name": "linkedin-browser",
|
||||
"display_name": "LinkedIn — Browser Session",
|
||||
"display_name": "LinkedIn \u2014 Browser Session",
|
||||
"logo": "img.logo.dev/name/linkedin",
|
||||
"description": "LinkedIn browser-session credentials for authenticated web workflows.",
|
||||
"type": "app",
|
||||
"auth_type": "browser",
|
||||
"flow": "browser",
|
||||
"api_url": "regex:^(www\\.linkedin\\.com|linkedin\\.com)",
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"display_name": "Livestorm",
|
||||
"logo": "img.logo.dev/name/livestorm",
|
||||
"description": "Webinar, event, registrant, and attendee data from Livestorm.",
|
||||
"type": "app",
|
||||
"auth_type": "api_key",
|
||||
"flow": "api_key",
|
||||
"api_url": "api.livestorm.co",
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"display_name": "Mailchimp",
|
||||
"logo": "img.logo.dev/name/mailchimp",
|
||||
"description": "Audience, campaign, and marketing automation APIs from Mailchimp.",
|
||||
"type": "app",
|
||||
"auth_type": "api_key",
|
||||
"flow": "api_key",
|
||||
"api_url": "api.mailchimp.com",
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"display_name": "Mention Me",
|
||||
"logo": "img.logo.dev/name/mention-me",
|
||||
"description": "Referral marketing campaigns, contacts, and Mention Me data access.",
|
||||
"type": "app",
|
||||
"auth_type": "api_key",
|
||||
"flow": "api_key",
|
||||
"api_url": "mention-me.com",
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"display_name": "Outlook Calendar",
|
||||
"logo": "img.logo.dev/name/microsoft-outlook",
|
||||
"description": "Outlook Calendar access for reading and managing calendar events and schedules via Microsoft Graph.",
|
||||
"type": "app",
|
||||
"auth_type": "oauth2",
|
||||
"flow": "pkce",
|
||||
"api_url": "https://graph.microsoft.com/v1.0/me/calendars",
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"display_name": "Microsoft Outlook",
|
||||
"logo": "img.logo.dev/name/microsoft-outlook",
|
||||
"description": "Microsoft Outlook access for reading, sending, and managing email via Microsoft Graph.",
|
||||
"type": "app",
|
||||
"auth_type": "oauth2",
|
||||
"flow": "pkce",
|
||||
"api_url": "https://graph.microsoft.com/v1.0/me/messages",
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"display_name": "Microsoft Word",
|
||||
"logo": "img.logo.dev/name/microsoft-word",
|
||||
"description": "Microsoft Word document access for reading and editing .docx files stored in OneDrive and SharePoint via Microsoft Graph.",
|
||||
"type": "app",
|
||||
"auth_type": "oauth2",
|
||||
"flow": "pkce",
|
||||
"api_url": "https://graph.microsoft.com/v1.0/me/drive",
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"display_name": "Microsoft",
|
||||
"logo": "img.logo.dev/name/microsoft",
|
||||
"description": "Microsoft Graph access for mail, calendars, files, tasks, and identity.",
|
||||
"type": "app",
|
||||
"auth_type": "oauth2",
|
||||
"flow": "pkce",
|
||||
"api_url": "graph.microsoft.com",
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"display_name": "Notion",
|
||||
"logo": "img.logo.dev/name/notion",
|
||||
"description": "Notion workspace content and integration access over OAuth.",
|
||||
"type": "app",
|
||||
"auth_type": "oauth2",
|
||||
"flow": "pkce",
|
||||
"api_url": "api.notion.com",
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"display_name": "Notion (DCR)",
|
||||
"logo": "img.logo.dev/name/notion",
|
||||
"description": "Notion MCP OAuth access using dynamic client registration.",
|
||||
"type": "app",
|
||||
"auth_type": "oauth2",
|
||||
"flow": "dcr_pkce",
|
||||
"api_url": "mcp.notion.com",
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"display_name": "OpenAI",
|
||||
"logo": "img.logo.dev/name/openai",
|
||||
"description": "OpenAI API keys for model, assistant, and platform automation.",
|
||||
"type": "llm",
|
||||
"auth_type": "api_key",
|
||||
"flow": "api_key",
|
||||
"api_url": "api.openai.com",
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"display_name": "Optimizely",
|
||||
"logo": "img.logo.dev/name/optimizely",
|
||||
"description": "Experimentation, feature flags, and Optimizely platform APIs.",
|
||||
"type": "app",
|
||||
"auth_type": "api_key",
|
||||
"flow": "api_key",
|
||||
"api_url": "api.optimizely.com",
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"display_name": "Postiz",
|
||||
"logo": "img.logo.dev/name/postiz",
|
||||
"description": "Social publishing and Postiz API access through device authorization.",
|
||||
"type": "app",
|
||||
"auth_type": "oauth2",
|
||||
"flow": "device_code",
|
||||
"api_url": "api.postiz.com",
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"display_name": "Postmark",
|
||||
"logo": "img.logo.dev/name/postmark",
|
||||
"description": "Transactional email sending and server token access from Postmark.",
|
||||
"type": "app",
|
||||
"auth_type": "api_key",
|
||||
"flow": "api_key",
|
||||
"api_url": "api.postmarkapp.com",
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"display_name": "Reddit",
|
||||
"logo": "img.logo.dev/name/reddit",
|
||||
"description": "Authenticate with Reddit API.",
|
||||
"type": "app",
|
||||
"auth_type": "oauth2",
|
||||
"flow": "pkce",
|
||||
"oauth": {
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"display_name": "Resend",
|
||||
"logo": "img.logo.dev/name/resend",
|
||||
"description": "Email sending, domains, audiences, and Resend API automation.",
|
||||
"type": "app",
|
||||
"auth_type": "api_key",
|
||||
"flow": "api_key",
|
||||
"api_url": "api.resend.com",
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"display_name": "Rewardful",
|
||||
"logo": "img.logo.dev/name/rewardful",
|
||||
"description": "Affiliate and referral tracking data from Rewardful.",
|
||||
"type": "app",
|
||||
"auth_type": "api_key",
|
||||
"flow": "api_key",
|
||||
"api_url": "api.getrewardful.com",
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"display_name": "SavvyCal",
|
||||
"logo": "img.logo.dev/name/savvycal",
|
||||
"description": "Scheduling links, events, and availability workflows from SavvyCal.",
|
||||
"type": "app",
|
||||
"auth_type": "api_key",
|
||||
"flow": "api_key",
|
||||
"api_url": "api.savvycal.com",
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"display_name": "SEMrush",
|
||||
"logo": "img.logo.dev/name/semrush",
|
||||
"description": "SEO, competitive research, and search analytics from Semrush.",
|
||||
"type": "app",
|
||||
"auth_type": "api_key",
|
||||
"flow": "api_key",
|
||||
"api_url": "api.semrush.com",
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"display_name": "SendGrid",
|
||||
"logo": "img.logo.dev/name/sendgrid",
|
||||
"description": "SendGrid email delivery, templates, and account API access.",
|
||||
"type": "app",
|
||||
"auth_type": "api_key",
|
||||
"flow": "api_key",
|
||||
"api_url": "api.sendgrid.com",
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"display_name": "Slack",
|
||||
"logo": "img.logo.dev/name/slack",
|
||||
"description": "Slack workspace channels, chat, and collaboration workflows over OAuth.",
|
||||
"type": "app",
|
||||
"auth_type": "oauth2",
|
||||
"flow": "pkce",
|
||||
"api_url": "slack.com",
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"display_name": "Todoist",
|
||||
"logo": "img.logo.dev/name/todoist",
|
||||
"description": "Todoist access for managing tasks, projects, and labels via the Todoist REST API.",
|
||||
"type": "app",
|
||||
"auth_type": "oauth2",
|
||||
"flow": "pkce",
|
||||
"api_url": "https://api.todoist.com/rest/v2",
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"display_name": "Tolt",
|
||||
"logo": "img.logo.dev/name/tolt",
|
||||
"description": "Affiliate tracking, partner data, and referral program automation.",
|
||||
"type": "app",
|
||||
"auth_type": "api_key",
|
||||
"flow": "api_key",
|
||||
"api_url": "api.tolt.com",
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"display_name": "Typeform",
|
||||
"logo": "img.logo.dev/name/typeform",
|
||||
"description": "Forms, responses, and Typeform workspace automation.",
|
||||
"type": "app",
|
||||
"auth_type": "api_key",
|
||||
"flow": "api_key",
|
||||
"api_url": "api.typeform.com",
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"display_name": "Wistia",
|
||||
"logo": "img.logo.dev/name/wistia",
|
||||
"description": "Video hosting, media analytics, and Wistia account APIs.",
|
||||
"type": "app",
|
||||
"auth_type": "api_key",
|
||||
"flow": "api_key",
|
||||
"api_url": "api.wistia.com",
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
{
|
||||
"schema_version": 1,
|
||||
"name": "x-browser",
|
||||
"display_name": "X (Twitter) — Browser Session",
|
||||
"display_name": "X (Twitter) \u2014 Browser Session",
|
||||
"logo": "img.logo.dev/name/x",
|
||||
"description": "X browser-session credentials for authenticated web workflows.",
|
||||
"type": "app",
|
||||
"auth_type": "browser",
|
||||
"flow": "browser",
|
||||
"api_url": "regex:^(api\\.twitter\\.com|api\\.x\\.com|x\\.com|twitter\\.com)",
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"display_name": "X (Twitter)",
|
||||
"logo": "img.logo.dev/name/x",
|
||||
"description": "X OAuth access for posts, user data, and social automation.",
|
||||
"type": "app",
|
||||
"auth_type": "oauth2",
|
||||
"flow": "pkce",
|
||||
"api_url": "api.twitter.com",
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"display_name": "Zapier",
|
||||
"logo": "img.logo.dev/name/zapier",
|
||||
"description": "Zapier platform API access for automation and connected workflows.",
|
||||
"type": "app",
|
||||
"auth_type": "api_key",
|
||||
"flow": "api_key",
|
||||
"api_url": "api.zapier.com",
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"display_name": "Zoom",
|
||||
"logo": "img.logo.dev/name/zoom",
|
||||
"description": "Zoom access for creating and managing meetings, users, and recordings via the Zoom API.",
|
||||
"type": "app",
|
||||
"auth_type": "oauth2",
|
||||
"flow": "pkce",
|
||||
"api_url": "https://api.zoom.us/v2",
|
||||
|
||||
@@ -14,6 +14,7 @@ from authsome.auth.models.enums import (
|
||||
ConnectionStatus,
|
||||
ExportFormat,
|
||||
FlowType,
|
||||
ProviderType,
|
||||
)
|
||||
from authsome.auth.models.provider import (
|
||||
ApiKeyConfig,
|
||||
@@ -35,6 +36,7 @@ __all__ = [
|
||||
"ProviderClientRecord",
|
||||
"ProviderDefinition",
|
||||
"ProviderMetadataRecord",
|
||||
"ProviderType",
|
||||
"ProviderStateRecord",
|
||||
"ServerConfig",
|
||||
"Sensitive",
|
||||
|
||||
@@ -31,6 +31,14 @@ class ConnectionStatus(StrEnum):
|
||||
INVALID = "invalid"
|
||||
|
||||
|
||||
class ProviderType(StrEnum):
|
||||
"""High-level category for a provider."""
|
||||
|
||||
APP = "app"
|
||||
LLM = "llm"
|
||||
MCP = "mcp"
|
||||
|
||||
|
||||
class ExportFormat(StrEnum):
|
||||
"""Supported credential export formats."""
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ from typing import Any, Literal, Self
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
from authsome.auth.models.enums import AuthType, FlowType
|
||||
from authsome.auth.models.enums import AuthType, FlowType, ProviderType
|
||||
|
||||
# TODO: Remove hardcoded schema versions everywhere
|
||||
|
||||
@@ -93,6 +93,7 @@ class ProviderDefinition(BaseModel):
|
||||
display_name: str
|
||||
logo: str | None = None
|
||||
description: str | None = None
|
||||
type: ProviderType | None = None
|
||||
auth_type: AuthType
|
||||
flow: FlowType
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
"""Provider CLI commands."""
|
||||
|
||||
import json
|
||||
import pathlib
|
||||
import sys
|
||||
|
||||
@@ -11,7 +10,7 @@ from loguru import logger
|
||||
from authsome.auth.models.provider import ProviderDefinition
|
||||
from authsome.cli.context import ContextObj
|
||||
from authsome.cli.helpers import _validate_provider_endpoints, auth_command
|
||||
from authsome.utils import format_error_code
|
||||
from authsome.utils import format_error_code, parse_jsonc
|
||||
|
||||
|
||||
@click.group(name="provider")
|
||||
@@ -118,7 +117,7 @@ async def register(ctx_obj: ContextObj, path: str, force: bool, yes: bool) -> No
|
||||
sys.exit(1)
|
||||
|
||||
try:
|
||||
data = json.loads(filepath.read_text(encoding="utf-8"))
|
||||
data = parse_jsonc(filepath.read_text(encoding="utf-8"))
|
||||
definition = ProviderDefinition.model_validate(data)
|
||||
|
||||
endpoints_to_check = _validate_provider_endpoints(definition)
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
|
||||
import builtins
|
||||
import importlib.resources
|
||||
import json
|
||||
|
||||
from loguru import logger
|
||||
|
||||
from authsome.auth.models.provider import ProviderDefinition
|
||||
from authsome.errors import ProviderNotFoundError
|
||||
from authsome.server.store.repositories import ProviderDefinitionRepository
|
||||
from authsome.utils import parse_jsonc
|
||||
|
||||
|
||||
class ProviderRepository:
|
||||
@@ -26,9 +26,9 @@ class ProviderRepository:
|
||||
try:
|
||||
files = importlib.resources.files("authsome.auth.bundled_providers")
|
||||
for file in files.iterdir():
|
||||
if file.name.endswith(".json"):
|
||||
if file.name.endswith((".json", ".jsonc")):
|
||||
with file.open("r", encoding="utf-8") as handle:
|
||||
definition = ProviderDefinition.model_validate(json.load(handle))
|
||||
definition = ProviderDefinition.model_validate(parse_jsonc(handle.read()))
|
||||
bundled[definition.name] = definition
|
||||
except Exception as exc:
|
||||
logger.warning("Error loading bundled providers: {}", exc)
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
import ctypes
|
||||
import getpass
|
||||
import json
|
||||
import os
|
||||
import re
|
||||
import shutil
|
||||
@@ -30,6 +31,23 @@ EXIT_ENDPOINT_UNREACHABLE = 8
|
||||
EXIT_DAEMON_UNAVAILABLE = 9
|
||||
|
||||
|
||||
_JSONC_STRIP_RE = re.compile(r'"(?:[^"\\]|\\.)*"|//[^\n]*|/\*.*?\*/', re.DOTALL)
|
||||
|
||||
|
||||
def parse_jsonc(text: str) -> Any:
|
||||
"""Parse JSON with C-style comments (JSONC).
|
||||
|
||||
Strips ``//`` line comments and ``/* */`` block comments before passing
|
||||
to the standard JSON parser. String literals are preserved verbatim so
|
||||
comment-like sequences inside quoted values are never stripped.
|
||||
"""
|
||||
|
||||
def _strip(m: re.Match) -> str:
|
||||
return m.group(0) if m.group(0).startswith('"') else ""
|
||||
|
||||
return json.loads(_JSONC_STRIP_RE.sub(_strip, text))
|
||||
|
||||
|
||||
def utc_now() -> datetime:
|
||||
"""Return the current UTC datetime."""
|
||||
return datetime.now(UTC)
|
||||
|
||||
Reference in New Issue
Block a user