From 7b222130e0b2526ce5064d4e1f94b7ca17c4f9e5 Mon Sep 17 00:00:00 2001 From: Baptiste Foy Date: Thu, 15 Sep 2022 10:19:27 +0200 Subject: [PATCH] refactor(getLocalMeta): Use IsTopLevelManifest to filter out top metas --- client/client.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/client/client.go b/client/client.go index 1ecdee5e..46bb96f3 100644 --- a/client/client.go +++ b/client/client.go @@ -7,6 +7,7 @@ import ( "io" "github.com/theupdateframework/go-tuf/data" + "github.com/theupdateframework/go-tuf/internal/roles" "github.com/theupdateframework/go-tuf/util" "github.com/theupdateframework/go-tuf/verify" ) @@ -419,10 +420,7 @@ func (c *Client) getLocalMeta() error { } for fileName := range meta { - if fileName != "targets.json" && - fileName != "snapshot.json" && - fileName != "root.json" && - fileName != "timestamp.json" { + if roles.IsDelegatedTargetsManifest(fileName) { c.localMeta[fileName] = meta[fileName] } }