feat(ngclient): require explicit bootstrap argument#2903
feat(ngclient): require explicit bootstrap argument#29031seal wants to merge 1 commit intotheupdateframework:developfrom
Conversation
make bootstrap required and explicit: callers must pass bootstrap=<root_bytes> or bootstrap=None. also tighten docs, examples, and tests to reflect the explicit trust anchor choice. Signed-off-by: 1seal <security@1seal.org>
jku
left a comment
There was a problem hiding this comment.
This looks good to me, left a couple of suggestions. Let me know what you think.
|
|
||
| # Init trusted root with the latest consistent_snapshot | ||
| with open(os.path.join(self.metadata_dir, "root.json"), "bw") as f: | ||
| f.write(sim.signed_roots[-1]) |
There was a problem hiding this comment.
this could maybe be removed now that _init_updater() does the right thing?
This probably applies to most test files using the repository simulator
| python3 -m pip install -r requirements/dev.txt | ||
|
|
||
|
|
||
| Bootstrap root metadata |
There was a problem hiding this comment.
This file is otherwise mostly about developer installs... Maybe we could rename this section to "Application deployment" or something to make it clearer that this is another subject completely?
|
removed the redundant root.json writes in tests where Updater(..., bootstrap=) is already passed (incl. test_updater_consistent_snapshot and other repository simulator tests). i kept the distinction for bootstrap=None: tests that require cached root still write it, and ‘no cache + bootstrap=None’ cases keep the cache absent. also renamed the INSTALLATION section to ‘Application deployment’ to clarify the context |
Description of the changes being introduced by the pull request:
This PR makes the trust anchor choice explicit in tuf.ngclient.Updater().
Migration:
Tests:
Ref: GHSA-9pfj-pjv5-22gj