Class: Sigstore::TUF::UpdaterConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/sigstore/tuf/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(max_root_rotations: 32, max_delegations: 32, root_max_length: 512_000, timestamp_max_length: 16_384, snapshot_max_length: 2_000_000, targets_max_length: 5_000_000, prefix_targets_with_hash: true, envelope_type: :metadata, app_user_agent: nil) ⇒ UpdaterConfig

Returns a new instance of UpdaterConfig.



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/sigstore/tuf/config.rb', line 23

def initialize(
  max_root_rotations: 32,
  max_delegations: 32,
  root_max_length: 512_000, # bytes
  timestamp_max_length: 16_384, # bytes
  snapshot_max_length: 2_000_000, # bytes
  targets_max_length: 5_000_000, # bytes
  prefix_targets_with_hash: true,
  envelope_type: :metadata,
  app_user_agent: nil
)
  @max_root_rotations = max_root_rotations
  @max_delegations = max_delegations
  @root_max_length = root_max_length
  @timestamp_max_length = timestamp_max_length
  @snapshot_max_length = snapshot_max_length
  @targets_max_length = targets_max_length
  @prefix_targets_with_hash = prefix_targets_with_hash
  @envelope_type = envelope_type
  @app_user_agent = app_user_agent
end

Instance Attribute Details

#app_user_agentObject (readonly)

Returns the value of attribute app_user_agent.



20
21
22
# File 'lib/sigstore/tuf/config.rb', line 20

def app_user_agent
  @app_user_agent
end

#envelope_typeObject (readonly)

Returns the value of attribute envelope_type.



20
21
22
# File 'lib/sigstore/tuf/config.rb', line 20

def envelope_type
  @envelope_type
end

#max_delegationsObject (readonly)

Returns the value of attribute max_delegations.



20
21
22
# File 'lib/sigstore/tuf/config.rb', line 20

def max_delegations
  @max_delegations
end

#max_root_rotationsObject (readonly)

Returns the value of attribute max_root_rotations.



20
21
22
# File 'lib/sigstore/tuf/config.rb', line 20

def max_root_rotations
  @max_root_rotations
end

#prefix_targets_with_hashObject (readonly)

Returns the value of attribute prefix_targets_with_hash.



20
21
22
# File 'lib/sigstore/tuf/config.rb', line 20

def prefix_targets_with_hash
  @prefix_targets_with_hash
end

#root_max_lengthObject (readonly)

Returns the value of attribute root_max_length.



20
21
22
# File 'lib/sigstore/tuf/config.rb', line 20

def root_max_length
  @root_max_length
end

#snapshot_max_lengthObject (readonly)

Returns the value of attribute snapshot_max_length.



20
21
22
# File 'lib/sigstore/tuf/config.rb', line 20

def snapshot_max_length
  @snapshot_max_length
end

#targets_max_lengthObject (readonly)

Returns the value of attribute targets_max_length.



20
21
22
# File 'lib/sigstore/tuf/config.rb', line 20

def targets_max_length
  @targets_max_length
end

#timestamp_max_lengthObject (readonly)

Returns the value of attribute timestamp_max_length.



20
21
22
# File 'lib/sigstore/tuf/config.rb', line 20

def timestamp_max_length
  @timestamp_max_length
end