mirror of
https://github.com/openswarm-ai/openswarm.git
synced 2026-10-01 05:54:56 +02:00
[Haik]: cleaned up oauth logic so theres a single OAuthService class that handles logic only, then all endpoints and stores are handled in the tools subapp. Now gonna rename the oauth folder and fix imports
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
from typing_extensions import Dict
|
||||
from pydantic import BaseModel, Field
|
||||
from typing import Optional, Any
|
||||
from uuid import uuid4
|
||||
from backend.core.tools.shared_structs.TOOL_PERMISSIONS import TOOL_PERMISSIONS
|
||||
|
||||
|
||||
# TODO: better type specing of this whole class, also we may not even need this class????
|
||||
class ToolDefinition(BaseModel):
|
||||
model_config = {"extra": "ignore"}
|
||||
|
||||
@@ -11,13 +12,13 @@ class ToolDefinition(BaseModel):
|
||||
name: str
|
||||
description: str = ""
|
||||
command: str = ""
|
||||
mcp_config: dict[str, Any] = Field(default_factory=dict)
|
||||
credentials: dict[str, str] = Field(default_factory=dict)
|
||||
mcp_config: Dict[str, Any] = Field(default_factory=dict)
|
||||
credentials: Dict[str, str] = Field(default_factory=dict)
|
||||
auth_type: str = "none"
|
||||
auth_status: str = "none"
|
||||
oauth_provider: Optional[str] = None
|
||||
oauth_tokens: dict[str, Any] = Field(default_factory=dict)
|
||||
tool_permissions: dict[str, TOOL_PERMISSIONS] = Field(default_factory=dict)
|
||||
tool_descriptions: dict[str, str] = Field(default_factory=dict) # tool_descriptions[tool_name] = tool_description
|
||||
oauth_tokens: Dict[str, Any] = Field(default_factory=dict)
|
||||
tool_permissions: Dict[str, TOOL_PERMISSIONS] = Field(default_factory=dict)
|
||||
tool_descriptions: Dict[str, str] = Field(default_factory=dict) # tool_descriptions[tool_name] = tool_description
|
||||
connected_account_email: Optional[str] = None
|
||||
enabled: bool = True
|
||||
|
||||
Reference in New Issue
Block a user