mirror of
https://github.com/bytedance/deer-flow.git
synced 2026-05-20 15:11:09 +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,23 @@
|
||||
"""Registry/build helpers for default authorization evaluators."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Callable
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from app.plugins.auth.authorization.authorization import PolicyEvaluator
|
||||
|
||||
|
||||
PolicyChainBuilder = Callable[[], tuple["PolicyEvaluator", ...]]
|
||||
|
||||
|
||||
def build_default_policy_evaluators() -> tuple["PolicyEvaluator", ...]:
|
||||
"""Return the default policy chain for auth-plugin authorization."""
|
||||
|
||||
from app.plugins.auth.authorization.authorization import evaluate_owner_policy
|
||||
|
||||
return (evaluate_owner_policy,)
|
||||
|
||||
|
||||
__all__ = ["PolicyChainBuilder", "build_default_policy_evaluators"]
|
||||
Reference in New Issue
Block a user