fix(ci): fix black/ruff failures, add CoC and PR template
- Fix Python formatting (sync no longer strips blank lines from .py files) - Remove test_community_build.py (tests private sync module) - Fix ruff warnings in test files - Add CODE_OF_CONDUCT.md - Add .github/PULL_REQUEST_TEMPLATE.md Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -12,6 +12,7 @@ from typing import Any
|
||||
# This allows unified handlers to check project access permissions
|
||||
_api_key_context: ContextVar[dict[str, Any] | None] = ContextVar("api_key_context", default=None)
|
||||
|
||||
|
||||
def set_api_key_context(key_id: str, project_id: str, scope: str, is_global: bool) -> None:
|
||||
"""
|
||||
Store API key information in request context.
|
||||
@@ -26,6 +27,7 @@ def set_api_key_context(key_id: str, project_id: str, scope: str, is_global: boo
|
||||
{"key_id": key_id, "project_id": project_id, "scope": scope, "is_global": is_global}
|
||||
)
|
||||
|
||||
|
||||
def get_api_key_context() -> dict[str, Any] | None:
|
||||
"""
|
||||
Retrieve API key information from request context.
|
||||
@@ -35,6 +37,7 @@ def get_api_key_context() -> dict[str, Any] | None:
|
||||
"""
|
||||
return _api_key_context.get()
|
||||
|
||||
|
||||
def clear_api_key_context() -> None:
|
||||
"""Clear API key context (for cleanup)."""
|
||||
_api_key_context.set(None)
|
||||
|
||||
Reference in New Issue
Block a user