# Copyright New York University and the in-toto contributors # SPDX-License-Identifier: Apache-2.0 """ formats.py Lukas Puehringer Santiago Torres-Arias November 28, 2017. See LICENSE for licensing information. Format schemas for in-toto metadata, based on securesystemslib.schema. The schemas can be verified using the following methods inherited from securesystemslib.schema: in_toto.formats..check_match() in_toto.formats..matches() `check_match` raises a securesystemslib.exceptions.FormatError and `matches` returns False if the verified object does not match the schema (True otherwise). """ import securesystemslib.schema as ssl_schema PARAMETER_DICTIONARY_KEY = ssl_schema.RegularExpression(r"[a-zA-Z0-9_-]+") PARAMETER_DICTIONARY_SCHEMA = ssl_schema.DictOf( key_schema=PARAMETER_DICTIONARY_KEY, value_schema=ssl_schema.AnyString() )