fix: report truthful compatibility outcomes and verify audit coverage
Assistant: codex Assistant-Model: gpt-6-astra Assistant-Session: 01a0e747-8f27-7242-8df8-8bc44f88c929
This commit is contained in:
parent
c0383c9c2b
commit
72f3513954
7 changed files with 246 additions and 16 deletions
|
|
@ -136,7 +136,7 @@ class SQLCompatibilityStore:
|
|||
)
|
||||
).mappings().one_or_none()
|
||||
if current is None:
|
||||
return {"id": manifest_id, "status": "missing"}
|
||||
raise HTTPException(status_code=404, detail="manifest not found")
|
||||
payload = dict(current["body"] or {})
|
||||
payload.update(body)
|
||||
values = {
|
||||
|
|
@ -296,7 +296,7 @@ class SQLCompatibilityStore:
|
|||
payload={"legacy": body},
|
||||
)
|
||||
accepted = await self.ports.append_interaction(command)
|
||||
return {"id": accepted.id, **body}
|
||||
return {**body, "id": accepted.id}
|
||||
|
||||
|
||||
def create_compatibility_router() -> APIRouter:
|
||||
|
|
@ -407,10 +407,10 @@ def create_compatibility_router() -> APIRouter:
|
|||
await _protected(request, "credentials", authorization, write=True)
|
||||
return await _store(request).create_key(consumer_id, body.get("scopes"))
|
||||
|
||||
@router.post("/api/v2/token")
|
||||
@router.post("/api/v2/token", status_code=501)
|
||||
async def token(request: Request, authorization: AuthorizationHeader = None) -> dict:
|
||||
await _protected(request, "credentials", authorization)
|
||||
return {"access_token": "already-authenticated", "token_type": "bearer"}
|
||||
raise HTTPException(status_code=501, detail="compatibility token issuance is not implemented")
|
||||
|
||||
@router.get("/api/v2/widgets")
|
||||
async def list_widgets(
|
||||
|
|
@ -457,7 +457,7 @@ def create_compatibility_router() -> APIRouter:
|
|||
request: Request, authorization: AuthorizationHeader = None
|
||||
) -> dict:
|
||||
await _protected(request, "deferred", authorization, write=True)
|
||||
return {"data": []}
|
||||
raise HTTPException(status_code=501, detail="compatibility operation is not implemented")
|
||||
|
||||
stem = path.replace("-", "_")
|
||||
router.add_api_route(
|
||||
|
|
@ -470,7 +470,7 @@ def create_compatibility_router() -> APIRouter:
|
|||
f"/api/v2/{path}",
|
||||
accept_deferred,
|
||||
methods=["POST"],
|
||||
status_code=201,
|
||||
status_code=501,
|
||||
operation_id=f"compat_create_{stem}_{index}",
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue