Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Metadata API: validate that "paths" or "path_hash_prefixes" is set #1497

Closed
MVrachev opened this issue Jul 15, 2021 · 4 comments
Closed

Metadata API: validate that "paths" or "path_hash_prefixes" is set #1497

MVrachev opened this issue Jul 15, 2021 · 4 comments
Assignees
Labels
backlog Issues to address with priority for current development goals ngclient specification-conformance
Milestone

Comments

@MVrachev
Copy link
Collaborator

MVrachev commented Jul 15, 2021

Description of issue or feature request:
As @sechkova have pointed out in this comment #1463 (comment) in DelegatedRole we are checking if paths and path_hash_prefixes BOTH are set, but we aren't checking
if at least one of them is set:
https://github.com/theupdateframework/tuf/blob/24fa1128116429dc18e185047fbffb009ca509b0/tuf/api/metadata.py#L914

For more context read theupdateframework/specification#156.

Current behavior:
We don't check if BOTH paths and path_hash_prefixes are None.

Expected behavior:
Check if BOTH paths and path_hash_prefixes are None.

@jku
Copy link
Member

jku commented Jul 16, 2021

I don't think there's a clear consensus that that is the expected behaviour theupdateframework/specification#156

I thought paths=None, path_hash_prefixes=None was legal and means "I want to delegate everything" as otherwise that wouldn't be possible at all (well path_hash_prefixes=[""] probably would delegate everything but seems even more like a hack). I don't think there's much in the spec to support either stance.

@joshuagl
Copy link
Member

Let's implement something which replicates the behaviour of the current client until the specification better defines what is expected.

sechkova added a commit to sechkova/tuf that referenced this issue Jul 23, 2021
The specification does not state clearly what is the
behaviour when none of delegation's "paths" and
"path_hash_prefixes" is set. See theupdateframework#1497.

Until this issue is clarified, copy current
Updater which raises an error in such case.

Signed-off-by: Teodora Sechkova <[email protected]>
sechkova added a commit to sechkova/tuf that referenced this issue Jul 23, 2021
The specification does not state clearly what is the
behaviour when none of delegation's "paths" and
"path_hash_prefixes" is set. See theupdateframework#1497.

Until this issue is clarified, copy current
Updater which raises an error in such case.

Signed-off-by: Teodora Sechkova <[email protected]>
@sechkova sechkova self-assigned this Jul 23, 2021
@sechkova
Copy link
Contributor

Let's implement something which replicates the behaviour of the current client until the specification better defines what is expected.

Done with 2159b88.

@joshuagl joshuagl added the backlog Issues to address with priority for current development goals label Jul 28, 2021
@sechkova sechkova added this to the Sprint 5 milestone Jul 28, 2021
sechkova added a commit to sechkova/tuf that referenced this issue Jul 28, 2021
The specification does not state clearly what is the
behaviour when none of delegation's "paths" and
"path_hash_prefixes" is set. See theupdateframework#1497.

Until this issue is clarified, copy current
Updater which raises an error in such case.

Signed-off-by: Teodora Sechkova <[email protected]>
sechkova added a commit to sechkova/tuf that referenced this issue Aug 6, 2021
The specification does not state clearly what is the
behaviour when none of delegation's "paths" and
"path_hash_prefixes" is set. See theupdateframework#1497.

Until this issue is clarified, copy current
Updater which raises an error in such case.

Signed-off-by: Teodora Sechkova <[email protected]>
sechkova added a commit to sechkova/tuf that referenced this issue Aug 6, 2021
The specification does not state clearly what is the
behaviour when none of delegation's "paths" and
"path_hash_prefixes" is set. See theupdateframework#1497.

Until this issue is clarified, copy current
Updater which raises an error in such case.

Signed-off-by: Teodora Sechkova <[email protected]>
sechkova added a commit to sechkova/tuf that referenced this issue Aug 10, 2021
The specification does not state clearly what is the
behaviour when none of delegation's "paths" and
"path_hash_prefixes" is set. See theupdateframework#1497.

Until this issue is clarified, copy current
Updater which raises an error in such case.

Signed-off-by: Teodora Sechkova <[email protected]>
@sechkova
Copy link
Contributor

76d4633 which replicates current client behaviour is merged so until the issue in the specification gets resolved, the client raises an error if none of paths and path_hash_prefixes is set.

Closing this issue and will reopen if an update of the code is needed to conform to the spec.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlog Issues to address with priority for current development goals ngclient specification-conformance
Projects
None yet
Development

No branches or pull requests

4 participants