Skip to main content

Module validator

Module validator 

Source
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§

BlockSchema
One block type’s registration: its attributes, where it may be nested and an example.
BlockSchemas
The CMS’s export of block registrations, the single source of block schemas, from GET /api/agent/block-schemas.
BlockValidationError
A problem the validator found in a block, with how to fix it.
CmsValidatorClient
HTTP client for the validator routes under the CMS’s /api/agent/.
CourseBlockFeatures
The course settings that make blocks available, named as in the course settings.
PageValidationRequest
One list of blocks to validate: a page’s, or an exercise’s instructions.
RichTextFormat
An inline format rich text may use, and the tag it is stored as.
UnconfiguredValidator
Stands in when the validator isn’t configured: every write fails closed with a retryable error, reads keep working.
ValidateBlocksRequest
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.
ValidateBlocksResponse
The answer of the CMS’s POST /api/agent/validate-blocks, a verdict per page in request order.
ValidationOutcome
The validator’s verdict on one page: valid when errors is empty.
ValidationRequest
The pages one write call validates.

Enums§

BlockValidationErrorCode
What kind of rule a block breaks.
CourseBlockFeature
The name of one of the course settings in CourseBlockFeatures.
ExerciseContext
The exercise block a list of blocks is validated as the children of.
PageType
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.
ValidationTarget
Where the validated blocks sit, which decides the blocks they may use.
ValidatorError
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§

BlockValidator
Checks the blocks agents write against the CMS’s block registrations; CmsValidatorClient in 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.