fix(fulfillment): mark confirmed role observations as bound

This commit is contained in:
yml
2026-11-23 23:05:18 +08:00
parent 23c4b93e9c
commit 58d782643b
7 changed files with 180 additions and 35 deletions
+36
View File
@@ -84,6 +84,42 @@ def test_http_response_keeps_application_cache_control():
assert headers[b"x-content-type-options"] == b"nosniff"
def test_html_response_gets_no_store_cache_control():
async def app(scope, receive, send):
assert scope["type"] == "http"
await send(
{
"type": "http.response.start",
"status": 200,
"headers": [],
}
)
await send({"type": "http.response.body", "body": b"html"})
messages: list[dict] = []
async def send(message):
messages.append(message)
async def receive():
return {"type": "http.request", "body": b"", "more_body": False}
scope = {
"type": "http",
"method": "GET",
"path": "/platform-fulfillment",
"headers": [],
"scheme": "http",
"server": ("testserver", 80),
"client": ("testclient", 123),
"query_string": b"",
}
asyncio.run(SecurityHeadersMiddleware(app)(scope, receive, send))
headers = dict(messages[0]["headers"])
assert headers[b"cache-control"] == b"no-store, max-age=0"
def test_asset_response_gets_immutable_cache_control():
message = _run_http("/assets/index-abc123.js")
headers = dict(message["headers"])