Validation

Core Validation Interfaces.

This module defines the protocols for system validation. Plugins can implement Validator to participate in the bootstrap process without depending directly on the structum-bootstrap package.

class structum.validation.ValidationContext(*args, **kwargs)[source]

Bases: Protocol

Context object passed to validators to collect results.

add_check(name: str, passed: bool, message: str = '') None[source]

Record the result of a specific check.

add_warning(message: str) None[source]

Record a non-fatal warning.

is_valid() bool[source]

Returns True if all checks passed so far.

__init__(*args, **kwargs)
class structum.validation.Validator(*args, **kwargs)[source]

Bases: Protocol

Protocol for any component that can perform validation.

validate(context: ValidationContext) None[source]

Execute validation logic and update the context.

Parameters:
context: ValidationContext

The bootstrap context to record success/failure/warnings.

__init__(*args, **kwargs)