Skip to content

fix(policy): validate standalone constraints - #101

Merged
Benoît Cortier (CBenoit) merged 1 commit into
masterfrom
cbenoit-fix-policy-constraints-validation
Sep 3, 2026
Merged

fix(policy): validate standalone constraints#101
Benoît Cortier (CBenoit) merged 1 commit into
masterfrom
cbenoit-fix-policy-constraints-validation

Conversation

@CBenoit

@CBenoit Benoît Cortier (CBenoit) commented Sep 3, 2026

Copy link
Copy Markdown
Member
  • validate standalone PolicyConstraints values through PolicySerializer.Serialize<T> and DeserializeStrict<T>
  • reuse the same four bounded-string checks used for constraints nested in policy rules
  • enforce the checks through direct JsonSerializer use with public PolicySerializer.Options and StrictOptions
  • cover all four collections at empty, maximum, and maximum+1 Unicode-scalar lengths across generic helpers and public options

This is an immediate follow-up to merged #99 for the late Copilot review and its specific finding.

BrokerSerializer needs no additional change: its supported generic APIs expose broker DTO roots, whose embedded policy documents already traverse PolicySerializer validation. It does not expose standalone PolicyConstraints through its generic helper surface.

Changelog: ignore

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings September 3, 2026 16:13

Copilot AI 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.

🟢 Approval recommended

The focused change correctly closes the validation gap with comprehensive boundary coverage.

Pull request overview

Adds standalone PolicyConstraints validation consistent with nested policy rules.

Changes:

  • Reuses bounded-string validation for standalone constraints.
  • Adds boundary tests across generic helpers and public serializer options.
File summaries
File Description
PolicySerializer.cs Validates standalone constraint collections.
PolicyTests.cs Tests empty, maximum, and over-limit values.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 0
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@CBenoit
Benoît Cortier (CBenoit) merged commit e66ea87 into master Sep 3, 2026
10 checks passed
@CBenoit
Benoît Cortier (CBenoit) deleted the cbenoit-fix-policy-constraints-validation branch September 3, 2026 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants