Expand description
Client for the CMS service’s block validator, which runs the real Gutenberg registrations.
Agent writes fail closed: if the validator is slow or down, the write is rejected with a retryable error and nothing unvalidated is staged.
Structs§
- Block
Schema - One block type’s registration: its attributes, where it may be nested and an example.
- Block
Schemas - The CMS’s export of block registrations, the single source of block schemas, from
GET /api/agent/block-schemas. - Block
Validation Error - A problem the validator found in a block, with how to fix it.
- CmsValidator
Client - HTTP client for the validator routes under the CMS’s
/api/agent/. - Course
Block Features - The course settings that make blocks available, named as in the course settings.
- Page
Validation Request - One list of blocks to validate: a page’s, or an exercise’s instructions.
- Rich
Text Format - An inline format rich text may use, and the tag it is stored as.
- Unconfigured
Validator - Stands in when the validator isn’t configured: every write fails closed with a retryable error, reads keep working.
- Validate
Blocks Request - The body of the CMS’s
POST /api/agent/validate-blocks: one HTTP request’s share of the pages a write call validates, its pages already serialized. - Validate
Blocks Response - The answer of the CMS’s
POST /api/agent/validate-blocks, a verdict per page in request order. - Validation
Outcome - The validator’s verdict on one page: valid when
errorsis empty. - Validation
Request - The pages one write call validates.
Enums§
- Block
Validation Error Code - What kind of rule a block breaks.
- Course
Block Feature - The name of one of the course settings in
CourseBlockFeatures. - Exercise
Context - The exercise block a list of blocks is validated as the children of.
- Page
Type - The editor (and validator) context a page’s blocks are checked against. A chapter’s front page takes the same blocks as its other pages.
- Validation
Target - Where the validated blocks sit, which decides the blocks they may use.
- Validator
Error - Why the validator gave no verdict.
Constants§
- CLIENT_
TIMEOUT_ 🔒HEADER - Tells the validator how long this client waits, so that it answers before then.
- VALIDATOR_
TIMEOUT 🔒
Traits§
- Block
Validator - Checks the blocks agents write against the CMS’s block registrations;
CmsValidatorClientin production.
Functions§
- request_
chunks 🔒 - The pages, each serialized once, in consecutive runs that each fit in one request; a page too
large alone gets a request of its own, which the validator answers with
ValidatorError::TooLarge.