ZoneTemplateRecordValidationService
class ZoneTemplateRecordValidationService (View source)
Validates zone template records before they are stored.
A template record is not a finished DNS record - it carries placeholders that are resolved per zone at creation time. It is checked by resolving those placeholders against a sample zone and validating the result with the normal per-type validators, which answers whether the record could ever be valid rather than whether it is valid for one particular zone.
The result reports validity only. Resolved values are sample data and must never be stored, so callers keep the values they were given.
Constants
| private SAMPLE_ZONE |
|
| private SAMPLE_HOSTMASTER |
|
| private SAMPLE_TIMER |
|
| private PLACEHOLDER_SAMPLES |
Stand-ins for the placeholders zone creation resolves. Sample values are used
instead of this install's configuration so a record is judged on its own syntax
and an unset nameserver or hostmaster setting cannot fail an otherwise sound record. |
Methods
Check whether a template record could produce a valid DNS record.
Details
__construct(DnsValidatorRegistry $validatorRegistry)
No description
ValidationResult
validate(string $name, string $type, string $content, mixed $ttl, mixed $prio, int $defaultTtl)
Check whether a template record could produce a valid DNS record.