feat(relay): publish runtime config schema#406
Conversation
Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 982882a4fc
ℹ️ 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".
| default = "default_request_timeout", | ||
| deserialize_with = "schema::deserialize_duration" | ||
| )] | ||
| #[schemars(with = "schema::HumantimeDurationSchema")] |
There was a problem hiding this comment.
Emit string defaults for duration schema fields
When clients materialize defaults from this Draft 2020-12 schema, every duration field with a serde default gets an object default like {"secs":30,"nanos":0} even though $defs/HumantimeDuration only accepts strings and runtime now rejects object-form durations. For example server.request_timeout in the committed schema has this object default, so generated configs using the advertised defaults won't validate or start; override/remove these defaults or post-process them to string values for all HumantimeDuration fields.
Useful? React with 👍 / 👎.
| pub(crate) enum AuditWritePolicySchema { | ||
| AvailabilityFirst, | ||
| FailClosed, | ||
| FailClosedRouteFamilies, |
There was a problem hiding this comment.
Omit unsupported audit write-policy variant
When operators follow the newly published schema, it now advertises fail_closed_route_families as a valid audit.write_policy, but the Relay docs still say per-route-family selection is not configurable and the audit middleware only fails requests for the exact FailClosed variant. A config using this schema-accepted value therefore runs effectively best-effort on audit write failures while not being reported as availability_first, so the schema should not expose this variant unless the runtime implements it.
Useful? React with 👍 / 👎.
Summary
Configgraphschemas/registry-relay.config.schema.jsonPart of #227. This is the Relay-first foundation; the Notary runtime schema remains a later packet after final credential configuration settles.
Contract
The schema describes Relay's post-environment-expansion structural configuration contract. Cross-field, activation, and security semantics remain enforced by runtime validation and
doctor; the schema does not claim that structural validity alone proves a deployable configuration.The generated contract is strict at nested boundaries, preserves supported environment references, applies exact Rust integer widths, and uses the portable runtime subsets for socket addresses and human durations. Audit environment names match Rust Unicode whitespace behavior exactly, including the ECMAScript-divergent U+0085 and U+FEFF cases.
User and developer impact
doctorbehavior remains authoritative for semantic validationValidation
a72483fe75d04b7ec68f9a0a6edee4dd8b014852Cargo.lock changes only for Schemars 1.2.1,
schemars_derive, andserde_derive_internals.Merge only after the full remote matrix is green on exact head
982882a4fc6ec97d8be633df8a71920be4ee1392.