@@ -247,12 +247,12 @@ def _load_root(self) -> None:
247
247
248
248
# Update the root role
249
249
lower_bound = self ._trusted_set .root .signed .version + 1
250
- upper_bound = lower_bound + self .config .MAX_ROOT_ROTATIONS
250
+ upper_bound = lower_bound + self .config .max_root_rotations
251
251
252
252
for next_version in range (lower_bound , upper_bound ):
253
253
try :
254
254
data = self ._download_metadata (
255
- "root" , self .config .DEFAULT_ROOT_MAX_LENGTH , next_version
255
+ "root" , self .config .root_max_length , next_version
256
256
)
257
257
self ._trusted_set .update_root (data )
258
258
self ._persist_metadata ("root" , data )
@@ -277,7 +277,7 @@ def _load_timestamp(self) -> None:
277
277
278
278
# Load from remote (whether local load succeeded or not)
279
279
data = self ._download_metadata (
280
- "timestamp" , self .config .DEFAULT_TIMESTAMP_MAX_LENGTH
280
+ "timestamp" , self .config .timestamp_max_length
281
281
)
282
282
self ._trusted_set .update_timestamp (data )
283
283
self ._persist_metadata ("timestamp" , data )
@@ -293,7 +293,7 @@ def _load_snapshot(self) -> None:
293
293
logger .debug ("Failed to load local snapshot %s" , e )
294
294
295
295
metainfo = self ._trusted_set .timestamp .signed .meta ["snapshot.json" ]
296
- length = metainfo .length or self .config .DEFAULT_SNAPSHOT_MAX_LENGTH
296
+ length = metainfo .length or self .config .snapshot_max_length
297
297
version = None
298
298
if self ._trusted_set .root .signed .consistent_snapshot :
299
299
version = metainfo .version
@@ -313,7 +313,7 @@ def _load_targets(self, role: str, parent_role: str) -> None:
313
313
logger .debug ("Failed to load local %s: %s" , role , e )
314
314
315
315
metainfo = self ._trusted_set .snapshot .signed .meta [f"{ role } .json" ]
316
- length = metainfo .length or self .config .DEFAULT_TARGETS_MAX_LENGTH
316
+ length = metainfo .length or self .config .targets_max_length
317
317
version = None
318
318
if self ._trusted_set .root .signed .consistent_snapshot :
319
319
version = metainfo .version
@@ -332,7 +332,7 @@ def _preorder_depth_first_walk(self, target_filepath) -> Dict:
332
332
target = None
333
333
role_names = [("targets" , "root" )]
334
334
visited_role_names = set ()
335
- number_of_delegations = self .config .MAX_DELEGATIONS
335
+ number_of_delegations = self .config .max_delegations
336
336
337
337
# Preorder depth-first traversal of the graph of target delegations.
338
338
while (
@@ -413,7 +413,7 @@ def _preorder_depth_first_walk(self, target_filepath) -> Dict:
413
413
):
414
414
msg = (
415
415
f"{ len (role_names )} roles left to visit, but allowed to " ,
416
- f"visit at most { self .config .MAX_DELEGATIONS } delegations." ,
416
+ f"visit at most { self .config .max_delegations } delegations." ,
417
417
)
418
418
logger .debug (msg )
419
419
0 commit comments