From 893994b7b492b3480a5533983bd62305834ef409 Mon Sep 17 00:00:00 2001 From: Baptiste Foy Date: Thu, 15 Sep 2022 10:19:27 +0200 Subject: [PATCH] refactor(getLocalMeta): Use IsDelegatedTargetsManifest to filter out top metas Signed-off-by: Baptiste Foy --- client/client.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/client/client.go b/client/client.go index 6b93d0a7..87c6d6bc 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" ) @@ -425,10 +426,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] } }