From 32b4ad42acd2cf66b0d52480d8f7b675ac383f09 Mon Sep 17 00:00:00 2001 From: Daniel Nephin Date: Wed, 29 Sep 2021 18:32:15 -0400 Subject: [PATCH] acl: remove ACLTokenTypeClient, along with the last test referencing it. --- agent/structs/acl_legacy.go | 3 --- agent/structs/acl_test.go | 23 ----------------------- 2 files changed, 26 deletions(-) diff --git a/agent/structs/acl_legacy.go b/agent/structs/acl_legacy.go index bc3e4bc1d8..a0c879badd 100644 --- a/agent/structs/acl_legacy.go +++ b/agent/structs/acl_legacy.go @@ -7,9 +7,6 @@ package structs const ( - // ACLTokenTypeClient tokens have rules applied - ACLTokenTypeClient = "client" - // ACLTokenTypeManagement tokens have an always allow policy, so they can // make other tokens and can access all resources. ACLTokenTypeManagement = "management" diff --git a/agent/structs/acl_test.go b/agent/structs/acl_test.go index ec52edce0b..39fb5aefc0 100644 --- a/agent/structs/acl_test.go +++ b/agent/structs/acl_test.go @@ -155,7 +155,6 @@ func TestStructs_ACLToken_EstimateSize(t *testing.T) { } func TestStructs_ACLToken_Stub(t *testing.T) { - t.Run("Basic", func(t *testing.T) { token := ACLToken{ @@ -188,28 +187,6 @@ func TestStructs_ACLToken_Stub(t *testing.T) { require.Equal(t, token.ModifyIndex, stub.ModifyIndex) require.False(t, stub.Legacy) }) - - t.Run("Legacy", func(t *testing.T) { - token := ACLToken{ - AccessorID: "09d1c059-961a-46bd-a2e4-76adebe35fa5", - SecretID: "65e98e67-9b29-470c-8ffa-7c5a23cc67c8", - Description: "test", - Type: ACLTokenTypeClient, - Rules: `key "" { policy = "read" }`, - } - - stub := token.Stub() - require.Equal(t, token.AccessorID, stub.AccessorID) - require.Equal(t, token.SecretID, stub.SecretID) - require.Equal(t, token.Description, stub.Description) - require.Equal(t, token.Policies, stub.Policies) - require.Equal(t, token.Local, stub.Local) - require.Equal(t, token.CreateTime, stub.CreateTime) - require.Equal(t, token.Hash, stub.Hash) - require.Equal(t, token.CreateIndex, stub.CreateIndex) - require.Equal(t, token.ModifyIndex, stub.ModifyIndex) - require.True(t, stub.Legacy) - }) } func TestStructs_ACLTokens_Sort(t *testing.T) {