Skip to content

tufclient: skip a repo only when its root.json is missing - #95

Draft
cyphar wants to merge 1 commit into
mainfrom
root-trust-enoent-only
Draft

cyphar wants to merge 1 commit into
mainfrom
root-trust-enoent-only

Conversation

@cyphar

@cyphar cyphar commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

Split out from #82, as I'm not convinced it's correct.


Any failure to fetch a repo's first root.json skipped the repo. A
machine that could not authenticate then updated nothing and still
reported success.

Now only a missing root.json, which means the repo may not exist yet,
skips the repo. Any other failure is an error, so one repo that fails
this way stops the whole run.

Signed-off-by: Joaquim Rocha joaquim@amutable.com
Signed-off-by: Aleksa Sarai aleksa@amutable.com

Any failure to fetch a repo's first root.json skipped the repo. A
machine that could not authenticate then updated nothing and still
reported success.

Now only a missing root.json, which means the repo may not exist yet,
skips the repo. Any other failure is an error, so one repo that fails
this way stops the whole run.

Signed-off-by: Joaquim Rocha <joaquim@amutable.com>
Signed-off-by: Aleksa Sarai <aleksa@amutable.com>
Comment on lines +93 to +99
// Only a missing root.json means the repository may not exist
// yet. Any other failure (auth, network, server error) must not
// look like an empty repository list.
if errors.Is(err, fs.ErrNotExist) {
err = skippableErr(err)
}
return nil, err

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure this is actually correct -- if I configure a repository with broken auth (or a repository where the server hasn't yet allowed access to this client) then I think the behaviour should be the same as if I configured a repository that does not exist.

If the root_trust is configured to wait until the repository is accessible, I don't think 404s are less problematic than 403s. And again, this only applies to first-pull (and eventually this will not be used by AOS anyway).

I've moved this to a separate PR -- #95.

Originally posted by @cyphar in #82

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants