feat: harden gateway with policy engine, secure tools, and governance docs
This commit is contained in:
17
src/aegis_gitea_mcp/request_context.py
Normal file
17
src/aegis_gitea_mcp/request_context.py
Normal file
@@ -0,0 +1,17 @@
|
||||
"""Request context utilities for correlation and logging."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from contextvars import ContextVar
|
||||
|
||||
_REQUEST_ID: ContextVar[str] = ContextVar("request_id", default="-")
|
||||
|
||||
|
||||
def set_request_id(request_id: str) -> None:
|
||||
"""Store request id in context-local state."""
|
||||
_REQUEST_ID.set(request_id)
|
||||
|
||||
|
||||
def get_request_id() -> str:
|
||||
"""Get current request id from context-local state."""
|
||||
return _REQUEST_ID.get()
|
||||
Reference in New Issue
Block a user