mirror of https://github.com/status-im/consul.git
acl: remove ACLTokenTypeClient,
along with the last test referencing it.
This commit is contained in:
parent
aea4cc5a6d
commit
32b4ad42ac
|
@ -7,9 +7,6 @@
|
||||||
package structs
|
package structs
|
||||||
|
|
||||||
const (
|
const (
|
||||||
// ACLTokenTypeClient tokens have rules applied
|
|
||||||
ACLTokenTypeClient = "client"
|
|
||||||
|
|
||||||
// ACLTokenTypeManagement tokens have an always allow policy, so they can
|
// ACLTokenTypeManagement tokens have an always allow policy, so they can
|
||||||
// make other tokens and can access all resources.
|
// make other tokens and can access all resources.
|
||||||
ACLTokenTypeManagement = "management"
|
ACLTokenTypeManagement = "management"
|
||||||
|
|
|
@ -155,7 +155,6 @@ func TestStructs_ACLToken_EstimateSize(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestStructs_ACLToken_Stub(t *testing.T) {
|
func TestStructs_ACLToken_Stub(t *testing.T) {
|
||||||
|
|
||||||
t.Run("Basic", func(t *testing.T) {
|
t.Run("Basic", func(t *testing.T) {
|
||||||
|
|
||||||
token := ACLToken{
|
token := ACLToken{
|
||||||
|
@ -188,28 +187,6 @@ func TestStructs_ACLToken_Stub(t *testing.T) {
|
||||||
require.Equal(t, token.ModifyIndex, stub.ModifyIndex)
|
require.Equal(t, token.ModifyIndex, stub.ModifyIndex)
|
||||||
require.False(t, stub.Legacy)
|
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) {
|
func TestStructs_ACLTokens_Sort(t *testing.T) {
|
||||||
|
|
Loading…
Reference in New Issue