From 06a12a8d03149d08979a04af67d27212869c03af Mon Sep 17 00:00:00 2001 From: Riyaz Faizullabhoy Date: Tue, 19 Jul 2016 14:54:07 -0700 Subject: [PATCH] Remove imported role constant with new keystore Signed-off-by: Riyaz Faizullabhoy --- cmd/notary/main.go | 2 +- cmd/notary/main_test.go | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/cmd/notary/main.go b/cmd/notary/main.go index 85eeb781cd..bdd7ebc6e8 100644 --- a/cmd/notary/main.go +++ b/cmd/notary/main.go @@ -236,7 +236,7 @@ func getPassphraseRetriever() notary.PassRetriever { // Note that we don't check if the role name is for a delegation to allow for names like "user" // since delegation keys can be shared across repositories // This cannot be a base role or imported key, though. - if v := env["delegation"]; !data.IsBaseRole(alias) && !strings.Contains(alias, "imported ") && v != "" { + if v := env["delegation"]; !data.IsBaseRole(alias) && v != "" { return v, numAttempts > 1, nil } return baseRetriever(keyName, alias, createNew, numAttempts) diff --git a/cmd/notary/main_test.go b/cmd/notary/main_test.go index 436d686570..9b3e791a23 100644 --- a/cmd/notary/main_test.go +++ b/cmd/notary/main_test.go @@ -611,8 +611,4 @@ func TestPassphraseRetrieverDelegationRoleCaching(t *testing.T) { require.Error(t, err) passphrase, giveup, err = retriever("key", data.CanonicalSnapshotRole, false, 0) require.Error(t, err) - - // make sure "imported" role fails - passphrase, giveup, err = retriever("key", "imported "+data.CanonicalRootRole, false, 0) - require.Error(t, err) }