Complete Phase 1: policy kernel, REST service, and local smoke tooling
Implements QONTO-WP-0002 (policy-gated Qonto REST service with audit logging, rate limiting, and credential handling) and the ADHOC-2026-07-21 follow-up (fixture-backed local smoke mode, repo classification metadata). Marks QONTO-WP-0001/0002 and the ad-hoc workplan finished, and regenerates WORK-RECORDS.md and the ADHOC workplan's state_hub_workstream_id via fix-consistency. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
parent
eef408bb19
commit
ca12843013
33 changed files with 2533 additions and 30 deletions
15
src/qonto_assistant/auth.py
Normal file
15
src/qonto_assistant/auth.py
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from fastapi import Request
|
||||
|
||||
from qonto_assistant.config import Settings
|
||||
from qonto_assistant.contracts import ActorClaims
|
||||
|
||||
|
||||
def actor_claims_from_request(request: Request, settings: Settings) -> ActorClaims:
|
||||
actor_id = request.headers.get("x-actor-id", "anonymous")
|
||||
tenant_id = request.headers.get("x-tenant-id", settings.default_tenant_id)
|
||||
lane = request.headers.get("x-actor-lane", settings.default_actor_lane)
|
||||
raw_scopes = request.headers.get("x-actor-scopes", "")
|
||||
scopes = frozenset(scope.strip() for scope in raw_scopes.split(",") if scope.strip())
|
||||
return ActorClaims(actor_id=actor_id, tenant_id=tenant_id, lane=lane, scopes=scopes)
|
||||
Loading…
Add table
Add a link
Reference in a new issue