feat: add oauth provider config

This commit is contained in:
lda
2026-06-13 02:35:03 +07:00 Verified
parent 0d10bbf897
commit 5fde2a69ee
3 changed files with 45 additions and 0 deletions
+4
View File
@@ -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",
+15
View File
@@ -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)