Skip to content

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

Closed

Description

@MVrachev

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.

Activity

  1. jku commented on Jul 16, 2021

    @jku
    Member

    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.

  2. joshuagl commented on Jul 20, 2021

    @joshuagl
    Member

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

  3. ghost added a commit that references this issue on Jul 23, 2021
  4. ghost added a commit that references this issue on Jul 23, 2021
  5. ghost
    self-assigned this
    on Jul 23, 2021
  6. sechkova commented on Jul 23, 2021

    @sechkova
    Contributor

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

    Done with 2159b88.

  7. ghost added
    backlog
    on Jul 28, 2021
  8. ghost added this to the Sprint 5 milestone on Jul 28, 2021
  9. ghost added a commit that references this issue on Jul 28, 2021
  10. ghost added a commit that references this issue on Aug 6, 2021
  11. ghost added a commit that references this issue on Aug 6, 2021
  12. ghost added a commit that references this issue on Aug 10, 2021
  13. sechkova commented on Aug 10, 2021

    @sechkova
    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.

  14. ghost closed this as completedon Aug 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

backlogngclientspecification-conformance

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions