Skip to content

Commit

Permalink
tuf.api: implement metadata.Targtes.read_from_json()
Browse files Browse the repository at this point in the history
Signed-off-by: Teodora Sechkova <[email protected]>
  • Loading branch information
sechkova authored and joshuagl committed Jul 2, 2020
1 parent f2861bf commit 37a235f
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion tuf/api/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,15 @@ def update(self, rolename: str, version: int, length: Optional[int] = None, hash

class Targets(Metadata):
def __init__(self, consistent_snapshot: bool = True, expiration: relativedelta = relativedelta(days=1), keyring: KeyRing = None, version: int = 1):
super().__init__(consistent_snapshot, expiration, relativedelta, keyring, version)
super().__init__(consistent_snapshot, expiration, keyring, version)
self.targets = {}
self.delegations = {}


def read_from_json(self, filename: str) -> None:
super().read_from_json(filename)
self.targets = self.signed['targets']
self.delegations = self.signed.get('delegations', None)

# FIXME
def signable(self):
Expand Down

0 comments on commit 37a235f

Please sign in to comment.