Struct tough::Limits[][src]

pub struct Limits {
    pub max_root_size: u64,
    pub max_targets_size: u64,
    pub max_timestamp_size: u64,
    pub max_root_updates: u64,
}
Expand description

Limits used when fetching repository metadata.

These limits are implemented to prevent endless data attacks. Clients must ensure these values are set higher than what would reasonably be expected by a repository, but not so high that the amount of data could interfere with the system.

max_root_size and max_timestamp_size are the maximum size for the root.json and timestamp.json files, respectively, downloaded from the repository. These must be sufficiently large such that future updates to your repository’s key management strategy will still be supported, but sufficiently small such that you are protected against an endless data attack (defined by TUF as an attacker responding to clients with extremely large files that interfere with the client’s system).

The Default implementation sets the following values:

  • max_root_size: 1 MiB
  • max_targets_size: 10 MiB
  • max_timestamp_size: 1 MiB
  • max_root_updates: 1024

Fields

max_root_size: u64

The maximum allowable size in bytes for downloaded root.json files.

max_targets_size: u64

The maximum allowable size in bytes for downloaded targets.json file if the size is not listed in snapshots.json. This setting is ignored if the size of targets.json is in the signed snapshots.json file.

max_timestamp_size: u64

The maximum allowable size in bytes for the downloaded timestamp.json file.

max_root_updates: u64

The maximum number of updates to root.json to download.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.