Skip to content

Add bounded Sec-Required-Document-Policy request metadata - #949

Closed
fewensa wants to merge 1 commit into
mainfrom
codeon/fewensa/FWN-371/a1-872f33d25d714a2a9efffc36b57f6bd7
Closed

Add bounded Sec-Required-Document-Policy request metadata#949
fewensa wants to merge 1 commit into
mainfrom
codeon/fewensa/FWN-371/a1-872f33d25d714a2a9efffc36b57f6bd7

Conversation

@fewensa

@fewensa fewensa commented Sep 11, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add SecRequiredDocumentPolicy protocol types that reuse the Document-Policy Structured Fields dictionary parser with distinct errors and the same bounds.
  • Wire HttpClient::sec_required_document_policy pre-I/O validation, server Request/HttpRequest accessors with raw preservation, and rttp facade re-exports.
  • Document non-goals (no enforcement or Document-Policy comparison) and cover HTTP/1.1 typed+raw round-trip.

Test plan

  • cargo test -p rttp-protocol --test sec_required_document_policy --test document_policy --test document_policy_report_only
  • cargo test -p rttp_client --test test_raw_request_capture sec_required_document_policy
  • cargo test -p rttp-server --test metadata_facade and server unit filter sec_required_document_policy
  • cargo test -p rttp --test metadata_facade --test test_server_models
  • cargo test --test http11_client_server_matrix sec_required_document_policy

codeon:
  version: 1
  authority: FWN-371
  description: |-
    Reuse the Document-Policy Structured Fields dictionary parser for Sec-Required-Document-Policy with distinct types and errors. Wire client pre-I/O validation, server request accessors with raw preservation, facade exports, docs, and HTTP/1.1 round-trip coverage without enforcement or Document-Policy comparison.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 11, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-11T09:09:46.729137Z 1517df6 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1517df6182

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

.map(|header| header.value().clone())
.collect();
values.push(value.as_ref().to_string());
let policy = SecRequiredDocumentPolicy::parse_values(values.iter().map(String::as_str))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Include canonical separators in the total-size bound

When this helper combines two valid values whose raw lengths total exactly 64 KiB, parse_values accepts them because the shared parser counts only the input bytes, but header_value() inserts ", " between fields and the resulting single emitted header exceeds the advertised 64 KiB per-field bound. The client can therefore emit a value that SecRequiredDocumentPolicy::parse and the server accessor reject when received as one field; account for separator overhead or validate the canonical value before replacing the headers.

Useful? React with 👍 / 👎.

@fewensa fewensa closed this Sep 13, 2026
@fewensa
fewensa deleted the codeon/fewensa/FWN-371/a1-872f33d25d714a2a9efffc36b57f6bd7 branch September 13, 2026 13:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant