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,
}

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

impl Clone for Limits[src]

impl Copy for Limits[src]

impl Debug for Limits[src]

impl Default for Limits[src]

Auto Trait Implementations

impl RefUnwindSafe for Limits

impl Send for Limits

impl Sync for Limits

impl Unpin for Limits

impl UnwindSafe for Limits

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DynClone for T where
    T: Clone
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,