Skip to content

Commit 60e28b7

Browse files
committed
docs(middleware): align response result diagnostics
Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com>
1 parent 44e1787 commit 60e28b7

1 file changed

Lines changed: 19 additions & 12 deletions

File tree

proto/supervisor_middleware.proto

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,8 @@ message HttpResponsePreflight {
197197
}
198198

199199
// Selects skip, inspect, or block. Diagnostic fields apply to every action.
200+
// Invalid diagnostics make the entire result a middleware failure handled
201+
// according to on_error.
200202
message HttpResponsePreflightResult {
201203
oneof action {
202204
// Deliver unchanged without invoking on_error.
@@ -209,8 +211,8 @@ message HttpResponsePreflightResult {
209211
// Service diagnostic, never sent to the sandbox or security logs. Maximum
210212
// 4 KiB.
211213
string reason = 3;
212-
// Optional audit code using HttpRequestResult.reason_code format. Returned to
213-
// the sandbox only for block_delivery.
214+
// Optional audit code using the HttpRequestResult.reason_code format and
215+
// 64-byte maximum. Returned to the sandbox only for block_delivery.
214216
string reason_code = 4;
215217
// Up to 32 audit-safe findings, each limited to 4 KiB encoded.
216218
repeated Finding findings = 5;
@@ -295,9 +297,11 @@ message HttpResponseBodyUnit {
295297
}
296298

297299
// Result for one body unit. Units are processed in lockstep; V1 does not
298-
// support ownership transfer. OpenShell enforces input and replacement size
299-
// bounds and validates the event lifecycle. It cannot distinguish bytes
300-
// intentionally deleted from bytes retained privately by middleware.
300+
// support ownership transfer. Diagnostic fields apply to every action. Invalid
301+
// diagnostics make the entire result a middleware failure handled according to
302+
// on_error. OpenShell enforces input and replacement size bounds and validates
303+
// the event lifecycle. It cannot distinguish bytes intentionally deleted from
304+
// bytes retained privately by middleware.
301305
message HttpResponseBodyResult {
302306
// Must match the next unit. Zero, gaps, duplicates, and regressions fail.
303307
uint64 sequence = 1;
@@ -315,9 +319,10 @@ message HttpResponseBodyResult {
315319
// Service diagnostic, never sent to the sandbox or security logs. Maximum
316320
// 4 KiB.
317321
string reason = 4;
318-
// Optional audit code using preflight reason_code format. When OpenShell
319-
// accepts block_delivery before response commitment, it includes this code
320-
// in the canonical denial response. It is never returned after commitment.
322+
// Optional audit code using the HttpRequestResult.reason_code format and
323+
// 64-byte maximum. When OpenShell accepts block_delivery before response
324+
// commitment, it includes this code in the canonical denial response. It is
325+
// never returned after commitment.
321326
string reason_code = 5;
322327
// Up to 32 audit-safe findings, each limited to 4 KiB encoded.
323328
repeated Finding findings = 6;
@@ -368,17 +373,19 @@ message HttpResponseTrailers {
368373
// preserves the current trailers. A write may target only a case-insensitive
369374
// name present in the trailers event; V1 cannot create a trailer name. Removal
370375
// of an absent name is a no-op. Credential, routing, framing, coding, range,
371-
// hop-by-hop, and connection-nominated fields are protected. A violating result
372-
// is a middleware failure handled according to on_error.
376+
// hop-by-hop, and connection-nominated fields are protected. Diagnostic fields
377+
// apply whether mutations are empty or nonempty. Invalid diagnostics or
378+
// mutations make the entire result a middleware failure handled according to
379+
// on_error.
373380
message HttpResponseTrailersResult {
374381
// At most 64 operations, 32 KiB of validated name/value data, and 64 KiB
375382
// encoded are accepted.
376383
repeated HeaderMutation trailer_mutations = 1;
377384
// Service diagnostic, never sent to the sandbox or security logs. Maximum
378385
// 4 KiB.
379386
string reason = 2;
380-
// Optional audit code using preflight reason_code format. Never sent to the
381-
// sandbox.
387+
// Optional audit code using the HttpRequestResult.reason_code format and
388+
// 64-byte maximum. Never sent to the sandbox.
382389
string reason_code = 3;
383390
// Up to 32 audit-safe findings, each limited to 4 KiB encoded.
384391
repeated Finding findings = 4;

0 commit comments

Comments
 (0)