Skip to content

metadata API: avoid raising securesystemslib exceptions #1646

Closed

Description

@jku

I think Metadata API should not require its users to import securesystemlib exceptions to be able to call Metadata API methods, it just seems weird -- as a user of TUF I am not necessarily directly using securesystemslib at all, yet I need to handle exceptions from it

Current behavior:

sign(), from_file() and to_file() are documented to raise these exceptions

Expected behavior:

I should only need to import modules from tuf to be able to handle tuf exceptions. This could mean either

  • re-exporting the securesystemslib exceptions in tuf metadata or exceptions module or
  • handling the securesystemslib exceptions and raising something in python-tuf: this is what I think verify_delegate() does

Activity

  1. added
    discussion
    on Oct 27, 2021
  2. MVrachev commented on Nov 9, 2021

    @MVrachev
    Collaborator

    I agree with the objective of the issue.
    I think each of the cases should be solved separately as a securesystemslib exception can describe exactly what we want to tell the user in an eventual problem and other times the securesystemslib exception will be an implementational detail.

  3. added
    backlog
    on Nov 10, 2021
  4. added this to the Sprint 14 milestone on Dec 8, 2021
  5. jku commented on Dec 21, 2021

    @jku
    MemberAuthor

    After some discussion last week and looking at this again: I think at least sign() should operate like the verify functions: handle the sslib exceptions and raise just a single exception (UnsignedMetadataError seems appropriate). I've been trying to imagine a scenario where a repository would like to handle the individual errors... and I cannot think of any, they don't seem useful.

  6. added
    1.0.0 blockers
    on Jan 11, 2022
  7. modified the milestones: Sprint 14, Sprint 15 on Jan 12, 2022
  8. modified the milestones: Sprint 15, sprint 16 on Jan 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

1.0.0 blockersbacklogdiscussion

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions