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
.context
specifies how the input is given and must be one ofchecksum_file
,checksum_str
andxml_file
options
algorithm
must be one ofmd5
,sha-1
,sha-224
,sha-256
,sha-384
andsha-512
. Defaults tomd5
block_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
tree
option specifies a set of rules for directories:type
must be eitherroot
orfolder
and is only used to specify if we are at the root or not. Iffolder
is specified then we also require thename
option to be specified.name
tells us which folder is being describedrequired_files
is a list with files that must be in the directoryvalid_paths
is 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.