Configuration

Configuration options for Updater class.

class EnvelopeType(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)

Configures deserialization and verification mode of TUF metadata.

Parameters:
  • METADATA – Traditional canonical JSON -based TUF Metadata.

  • SIMPLE – Dead Simple Signing Envelope. (experimental)

METADATA = 1
SIMPLE = 2
class UpdaterConfig(max_root_rotations=32, max_delegations=32, root_max_length=512000, timestamp_max_length=16384, snapshot_max_length=2000000, targets_max_length=5000000, prefix_targets_with_hash=True, envelope_type=<EnvelopeType.METADATA: 1>, app_user_agent=None)

Used to store Updater configuration.

Parameters:
  • max_root_rotations (int) – Maximum number of root rotations.

  • max_delegations (int) – Maximum number of delegations.

  • root_max_length (int) – Maxmimum length of a root metadata file.

  • timestamp_max_length (int) – Maximum length of a timestamp metadata file.

  • snapshot_max_length (int) – Maximum length of a snapshot metadata file.

  • targets_max_length (int) – Maximum length of a targets metadata file.

  • prefix_targets_with_hash (bool) – When consistent snapshots are used, target download URLs are formed by prefixing the filename with a hash digest of file content by default. This can be overridden by setting prefix_targets_with_hash to False.

  • envelope_type (EnvelopeType) – Configures deserialization and verification mode of TUF metadata. Per default, it is treated as traditional canonical JSON -based TUF Metadata.

  • app_user_agent (str | None) – Application user agent, e.g. “MyApp/1.0.0”. This will be prefixed to ngclient user agent when the default fetcher is used.

app_user_agent: str | None = None
envelope_type: EnvelopeType = 1
max_delegations: int = 32
max_root_rotations: int = 32
prefix_targets_with_hash: bool = True
root_max_length: int = 512000
snapshot_max_length: int = 2000000
targets_max_length: int = 5000000
timestamp_max_length: int = 16384