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

Remove MetadataWrapper class #1304

Closed
sechkova opened this issue Mar 12, 2021 · 3 comments
Closed

Remove MetadataWrapper class #1304

sechkova opened this issue Mar 12, 2021 · 3 comments
Labels
experimental-client Items related to the development of a new client (see milestone/8 and theexperimental-client branch)

Comments

@sechkova
Copy link
Contributor

sechkova commented Mar 12, 2021

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)

@sechkova sechkova added the experimental-client Items related to the development of a new client (see milestone/8 and theexperimental-client branch) label Mar 12, 2021
@sechkova sechkova added this to the Client Refactor milestone Mar 12, 2021
@sechkova sechkova mentioned this issue Mar 12, 2021
17 tasks
@sechkova
Copy link
Contributor Author

sechkova commented Apr 7, 2021

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

@sechkova
Copy link
Contributor Author

sechkova commented May 18, 2021

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

@sechkova
Copy link
Contributor Author

Done with #1355 and #1396.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
experimental-client Items related to the development of a new client (see milestone/8 and theexperimental-client branch)
Projects
None yet
Development

No branches or pull requests

2 participants