refactor: form-core wiring, JWT sessions, slowapi, packaging, frontend rewrite, test declutter
This commit is contained in:
parent
06ab25fb47
commit
03af41e837
74 changed files with 6089 additions and 5183 deletions
|
|
@ -11,10 +11,11 @@ from app (stdlib only), prints no secret values.
|
|||
|
||||
from __future__ import annotations
|
||||
|
||||
import argparse
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
import typer
|
||||
|
||||
BACKEND = Path(__file__).resolve().parent.parent
|
||||
REPO_ROOT = BACKEND.parent
|
||||
|
||||
|
|
@ -57,6 +58,7 @@ def check(values: dict[str, str]) -> tuple[list[str], list[str]]:
|
|||
|
||||
# Shared + service API keys.
|
||||
secret("CALLBACK_TOKEN", MIN_TOKEN, "callback token")
|
||||
secret("JWT_SECRET", MIN_TOKEN, "session JWT secret")
|
||||
secret("LANGFLOW_API_KEY", MIN_API_KEY, "langflow api key")
|
||||
placeholder("LANGFLOW_API_KEY", ("sk-",))
|
||||
secret("LFX_API_KEY", MIN_API_KEY, "lfx api key")
|
||||
|
|
@ -87,11 +89,9 @@ def check(values: dict[str, str]) -> tuple[list[str], list[str]]:
|
|||
return failures, warnings
|
||||
|
||||
|
||||
def main() -> int:
|
||||
parser = argparse.ArgumentParser(description=__doc__)
|
||||
parser.add_argument("--env", default=str(REPO_ROOT / ".env"))
|
||||
args = parser.parse_args()
|
||||
path = Path(args.env)
|
||||
def main(env: str = typer.Option(str(REPO_ROOT / ".env"), "--env")) -> int:
|
||||
"""Validate a prod .env file (typer CLI; check/parse_env stay importable)."""
|
||||
path = Path(env)
|
||||
if not path.is_file():
|
||||
print(f"no env file at {path}")
|
||||
return 1
|
||||
|
|
@ -108,4 +108,4 @@ def main() -> int:
|
|||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(main())
|
||||
sys.exit(typer.run(main))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue