Validation Profile
Specification
Each key (except those beginning with _) in the specification specifies a
validator that should be used.
Note
The _required key can be used to specify a list of validators that must
pass when executed.
Each validator key is a list of configurations of the validator that should be applied on different sets of files.
exclude- A list of relative paths that should be excluded from the validationinclude- A list of relative paths that should be included in the validationcontext- Specifies how and/or where is the correct value storedoptions- A dict with validator-specific options
Note
XML-variables can be used with the {VARIABLE}-syntax in the
configuration values. See XML Variables for more information.
Built-in validators
ChecksumValidator
- class ESSArch_Core.fixity.validation.backends.checksum.ChecksumValidator(*args, **kwargs)[source]
Validates the checksum of a file against the given
context.contextspecifies how the input is given and must be one ofchecksum_file,checksum_strandxml_fileoptionsalgorithmmust be one ofmd5,sha-1,sha-224,sha-256,sha-384andsha-512. Defaults tomd5block_size: Defaults to 65536
StructureValidator
- class ESSArch_Core.fixity.validation.backends.structure.StructureValidator(context=None, include=None, exclude=None, options=None, data=None, required=True, task=None, ip=None, responsible=None, stylesheet=None)[source]
Validates that the directory has all the required files and no invalid extensions.
The
treeoption specifies a set of rules for directories:typemust be eitherrootorfolderand is only used to specify if we are at the root or not. Iffolderis specified then we also require thenameoption to be specified.nametells us which folder is being describedrequired_filesis a list with files that must be in the directoryvalid_pathsis a list of strings and/or lists that are allowed in the directory. Wildcards can be specified using*.Inner lists are used to specify valid file groups. E.g.
[['*.doc', '*.pdf']]says that for each .doc file there must be a .pdf file with the same name.