mirror of
https://github.com/bytedance/deer-flow.git
synced 2026-05-20 06:51:03 +00:00
feat(app): add plugin system with auth plugin and static assets
Add new application structure: - app/main.py - application entry point - app/plugins/ - plugin system with auth plugin: - api/ - REST API endpoints and schemas - authorization/ - auth policies, providers, hooks - domain/ - business logic (service, models, jwt, password) - injection/ - route injection and guards - ops/ - operational utilities - runtime/ - runtime configuration - security/ - middleware, CSRF, dependencies - storage/ - user repositories and models - app/static/ - static assets (scalar.js for API docs) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
"""Runtime state utilities for the auth plugin."""
|
||||
|
||||
from app.plugins.auth.runtime.config_state import get_auth_config, reset_auth_config, set_auth_config
|
||||
|
||||
__all__ = ["get_auth_config", "reset_auth_config", "set_auth_config"]
|
||||
@@ -0,0 +1,27 @@
|
||||
"""Runtime state holder for auth configuration."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from app.plugins.auth.domain.config import AuthConfig, load_auth_config_from_env
|
||||
|
||||
_auth_config: AuthConfig | None = None
|
||||
|
||||
|
||||
def get_auth_config() -> AuthConfig:
|
||||
global _auth_config
|
||||
if _auth_config is None:
|
||||
_auth_config = load_auth_config_from_env()
|
||||
return _auth_config
|
||||
|
||||
|
||||
def set_auth_config(config: AuthConfig) -> None:
|
||||
global _auth_config
|
||||
_auth_config = config
|
||||
|
||||
|
||||
def reset_auth_config() -> None:
|
||||
global _auth_config
|
||||
_auth_config = None
|
||||
|
||||
|
||||
__all__ = ["get_auth_config", "reset_auth_config", "set_auth_config"]
|
||||
Reference in New Issue
Block a user