mirror of
https://github.com/agentrhq/authsome.git
synced 2026-09-19 01:34:19 +08:00
ea42284ff8
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>
48 lines
950 B
Python
48 lines
950 B
Python
"""Enumerations for auth types, flow types, connection statuses, and export formats."""
|
|
|
|
from enum import StrEnum
|
|
|
|
|
|
class AuthType(StrEnum):
|
|
"""Authentication mechanism used by a provider."""
|
|
|
|
OAUTH2 = "oauth2"
|
|
API_KEY = "api_key"
|
|
BROWSER = "browser"
|
|
|
|
|
|
class FlowType(StrEnum):
|
|
"""Specific authentication flow for a provider."""
|
|
|
|
PKCE = "pkce"
|
|
DEVICE_CODE = "device_code"
|
|
DCR_PKCE = "dcr_pkce"
|
|
API_KEY = "api_key"
|
|
BROWSER = "browser"
|
|
|
|
|
|
class ConnectionStatus(StrEnum):
|
|
"""Status of a credential connection."""
|
|
|
|
NOT_CONNECTED = "not_connected"
|
|
CONNECTED = "connected"
|
|
EXPIRED = "expired"
|
|
REVOKED = "revoked"
|
|
INVALID = "invalid"
|
|
|
|
|
|
class ProviderType(StrEnum):
|
|
"""High-level category for a provider."""
|
|
|
|
APP = "app"
|
|
LLM = "llm"
|
|
MCP = "mcp"
|
|
|
|
|
|
class ExportFormat(StrEnum):
|
|
"""Supported credential export formats."""
|
|
|
|
ENV = "env"
|
|
JSON = "json"
|
|
SHELL = "shell"
|