Skip to content

Remove MetadataWrapper class #1304

Description

@sechkova

I find it a bit paradox that MetadataWrapper is another container on top of Metadata, adding another level of nesting, when most of the methods/properties are actually shortcuts to attributes contained somewhere in Metadata. If we want a client-variant of Metadata, I'd maybe use inheritance instead of composition. 🤷

But maybe we don't even need it. Let's quickly go through the individual methods/properties of here:

On MetadataWrapper:

All the other methods here are either pure shortcuts or filters of attributes contained in Metadata objects (or contained objects).

Originally posted by @lukpueh in #1291 (comment)

Activity

  1. added
    experimental-clientItems related to the development of a new client (see milestone/8 and theexperimental-client branch)
    on Mar 12, 2021
  2. added this to the Client Refactor milestone on Mar 12, 2021
  3. sechkova commented on Apr 7, 2021

    @sechkova
    ContributorAuthor

    Steps that I suggest should be followed for completing this issue:

    • Implement from_object method in Metadata class Implement from_object/from_string method in Metadata class #1336
    • Implement 'expired' method in Signed class Add 'expired' method to Signed class #1305
    • Implement verification by a threshold of keys Implement verification by a threshold of keys  #1306
    • Replace calls to MetadataWrapper.from_json_file with the available Metadata.from_file
    • Replace calls to MetadataWrapper.from_json_object with the newly implemented Metadata.from_object
    • Replace calls to MetadataWrapper.persist with the available Metadata.to_file
    • Replace calls to MetadataWrapper.expires with the newly implemented 'expired'
    • Replace calls to MetadataWrapper.verify with the newly implemented verification
    • Remove shortcuts and filters (see the issue description)
    • Remove the MetadataWrapper class itself
  4. sechkova commented on May 18, 2021

    @sechkova
    ContributorAuthor

    All the steps above will be completed withe the merge of #1355 and #1396.

  5. sechkova commented on May 21, 2021

    @sechkova
    ContributorAuthor

    Done with #1355 and #1396.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    experimental-clientItems related to the development of a new client (see milestone/8 and theexperimental-client branch)

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions