feat: add oauth provider config
This commit is contained in:
@@ -2,11 +2,13 @@ from __future__ import annotations
|
||||
|
||||
from .loader import load_workflow_config
|
||||
from .models import (
|
||||
AuthConfig,
|
||||
ClientConfig,
|
||||
FilesystemStoreConfig,
|
||||
HttpSourceTransportConfig,
|
||||
LocalTargetConfig,
|
||||
McpSourceConfig,
|
||||
OAuthProviderConfig,
|
||||
PythonSourceConfig,
|
||||
RpcHttpTargetConfig,
|
||||
RpcHttpTransportConfig,
|
||||
@@ -21,11 +23,13 @@ from .models import (
|
||||
|
||||
__all__ = [
|
||||
"load_workflow_config",
|
||||
"AuthConfig",
|
||||
"ClientConfig",
|
||||
"FilesystemStoreConfig",
|
||||
"HttpSourceTransportConfig",
|
||||
"LocalTargetConfig",
|
||||
"McpSourceConfig",
|
||||
"OAuthProviderConfig",
|
||||
"PythonSourceConfig",
|
||||
"RpcHttpTargetConfig",
|
||||
"RpcHttpTransportConfig",
|
||||
|
||||
@@ -208,7 +208,22 @@ class ServerConfig(WorkflowConfigModel):
|
||||
return self.stores.catalog_cache or self.store
|
||||
|
||||
|
||||
class OAuthProviderConfig(WorkflowConfigModel):
|
||||
kind: Literal["oauth_authorization_code_pkce"]
|
||||
auth_url: AnyHttpUrl
|
||||
token_url: AnyHttpUrl
|
||||
client_id_env: str
|
||||
client_secret_env: str | None = None
|
||||
scopes: tuple[str, ...] = ()
|
||||
redirect_uri: str = "http://127.0.0.1:0/oauth/callback"
|
||||
|
||||
|
||||
class AuthConfig(WorkflowConfigModel):
|
||||
providers: dict[str, OAuthProviderConfig] = Field(default_factory=dict)
|
||||
|
||||
|
||||
class WorkflowConfigFile(WorkflowConfigModel):
|
||||
version: Literal[1] = 1
|
||||
client: ClientConfig = Field(default_factory=ClientConfig)
|
||||
server: ServerConfig = Field(default_factory=ServerConfig)
|
||||
auth: AuthConfig = Field(default_factory=AuthConfig)
|
||||
|
||||
Reference in New Issue
Block a user