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

New API: Add DelegationRole and Delegations classes #1370

Merged
merged 4 commits into from
May 12, 2021

Commits on May 11, 2021

  1. Add DelegatedRole and Delegations

    In the top level metadata classes, there are complex attributes such as
    "meta" in Targets and Snapshot, "key" and "roles" in Root etc.
    We want to represent those complex attributes with a class to allow
    easier verification and support for metadata with unrecognized fields.
    For more context read ADR 0004 and ADR 0008 in the docs/adr folder.
    
    DelegatedRole shares a couple of fields with the Role class and that's
    why it inherits it.
    I decided to use a separate Delegations class because I thought it will
    make it easier to read, verify and add additional helper functions.
    Also, I tried to make sure that I test each level of the delegations
    representation for support of storing unrecognized fields.
    
    Signed-off-by: Martin Vrachev <[email protected]>
    MVrachev committed May 11, 2021
    Configuration menu
    Copy the full SHA
    8e4d3b9 View commit details
    Browse the repository at this point in the history
  2. Add Delegation/DelegatednRole specific tests

    Signed-off-by: Martin Vrachev <[email protected]>
    MVrachev committed May 11, 2021
    Configuration menu
    Copy the full SHA
    f98f4f7 View commit details
    Browse the repository at this point in the history
  3. Remove forgotten debug line from a test

    Signed-off-by: Martin Vrachev <[email protected]>
    MVrachev committed May 11, 2021
    Configuration menu
    Copy the full SHA
    42b3269 View commit details
    Browse the repository at this point in the history
  4. Don't use Mapping for mutable dicts

    Stop using Mapping where we actually mean Dict:
    Mapping means "we only need a read-only dict" and most of the time
    this is not really the case.
    
    Signed-off-by: Martin Vrachev <[email protected]>
    MVrachev committed May 11, 2021
    Configuration menu
    Copy the full SHA
    b2cde9b View commit details
    Browse the repository at this point in the history