feat: harden gateway with policy engine, secure tools, and governance docs
This commit is contained in:
1 parent
e17d34e6d7
commit
5969892af3
55 files changed
+4711
-1587
No files matched your search
@@ -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