Add typed Access Rule conditions#7962
Draft
Hinton wants to merge 3 commits into
Draft
Conversation
…hierarchies Explicit selectors scoped to [JsonPolymorphic]/[JsonDerivedType] attributes instead of Swashbuckle's default assembly-scanning selector, which pulls the whole ResponseModel tree into the document and collides on same-named ErrorResponseModel classes. The discriminator name selector falls back to System.Text.Json's default "$type" so an opted-in hierarchy never emits oneOf schemas without a discriminator.
…nion Replaces the verbatim-JSON conditions contract with a typed union of human_approval and ip_allowlist, discriminated by 'kind': - 'kind' is accepted at any position (AllowOutOfOrderMetadataProperties), matching the SDK's serde tagging; a missing kind binds to the concrete base type and is rejected by validation with a structured 400 instead of throwing into a 500 - unknown kinds and unknown members fail deserialization (fail-closed 400) - CidrValidator mirrors the SDK's is_valid_cidr rules, including rejection of IPv4-mapped IPv6 CIDRs; null-safe for bound list entries - cidrs capped at 1-100 entries with a per-entry length cap; validation errors are indexed (Conditions[i].Cidrs[j]) and never echo user input - omitting 'conditions' fails [Required]; an explicitly empty array remains valid per the documented contract
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #7962 +/- ##
==========================================
+ Coverage 61.49% 62.08% +0.59%
==========================================
Files 2249 2278 +29
Lines 99057 99546 +489
Branches 8959 9004 +45
==========================================
+ Hits 60917 61808 +891
+ Misses 35989 35564 -425
- Partials 2151 2174 +23 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🎟️ Tracking
📔 Objective
📸 Screenshots