diff --git a/pkg/acl/eacl/target.go b/pkg/acl/eacl/target.go index 09fdfa71..73a7bf22 100644 --- a/pkg/acl/eacl/target.go +++ b/pkg/acl/eacl/target.go @@ -32,7 +32,7 @@ func (t *Target) ToV2() *v2acl.Target { target := new(v2acl.Target) target.SetRole(t.role.ToV2()) - target.SetKeyList(keys) + target.SetKeys(keys) return target } @@ -45,7 +45,7 @@ func NewTargetFromV2(target *v2acl.Target) *Target { } t.role = RoleFromV2(target.GetRole()) - v2keys := target.GetKeyList() + v2keys := target.GetKeys() t.keys = make([]ecdsa.PublicKey, 0, len(v2keys)) for i := range v2keys { key := crypto.UnmarshalPublicKey(v2keys[i]) diff --git a/pkg/acl/eacl/target_test.go b/pkg/acl/eacl/target_test.go index dd26f4b4..077dbf4c 100644 --- a/pkg/acl/eacl/target_test.go +++ b/pkg/acl/eacl/target_test.go @@ -24,8 +24,8 @@ func TestTarget(t *testing.T) { v2 := target.ToV2() require.NotNil(t, v2) require.Equal(t, v2acl.RoleSystem, v2.GetRole()) - require.Len(t, v2.GetKeyList(), len(keys)) - for i, key := range v2.GetKeyList() { + require.Len(t, v2.GetKeys(), len(keys)) + for i, key := range v2.GetKeys() { require.Equal(t, key, crypto.MarshalPublicKey(&keys[i])) } diff --git a/v2/acl/convert.go b/v2/acl/convert.go index b28eba2c..0a005fe5 100644 --- a/v2/acl/convert.go +++ b/v2/acl/convert.go @@ -205,7 +205,7 @@ func TargetToGRPCMessage(t *Target) *acl.EACLRecord_Target { RoleToGRPCField(t.GetRole()), ) - m.SetKeyList(t.GetKeyList()) + m.SetKeys(t.GetKeys()) return m } @@ -222,7 +222,7 @@ func TargetInfoFromGRPCMessage(m *acl.EACLRecord_Target) *Target { RoleFromGRPCField(m.GetRole()), ) - t.SetKeyList(m.GetKeyList()) + t.SetKeys(m.GetKeys()) return t } diff --git a/v2/acl/grpc/types.go b/v2/acl/grpc/types.go index adc43394..341b760b 100644 --- a/v2/acl/grpc/types.go +++ b/v2/acl/grpc/types.go @@ -88,10 +88,10 @@ func (m *EACLRecord_Target) SetRole(v Role) { } } -// SetKeyList sets key list of the eACL target. -func (m *EACLRecord_Target) SetKeyList(v [][]byte) { +// SetKeys of the eACL target. +func (m *EACLRecord_Target) SetKeys(v [][]byte) { if m != nil { - m.KeyList = v + m.Keys = v } } diff --git a/v2/acl/marshal_test.go b/v2/acl/marshal_test.go index ecaecc89..16663d8e 100644 --- a/v2/acl/marshal_test.go +++ b/v2/acl/marshal_test.go @@ -141,7 +141,7 @@ func TestTargetInfo_StableMarshal(t *testing.T) { t.Run("non empty", func(t *testing.T) { targetFrom.SetRole(acl.RoleUser) - targetFrom.SetKeyList([][]byte{ + targetFrom.SetKeys([][]byte{ []byte("Public Key 1"), []byte("Public Key 2"), }) diff --git a/v2/acl/types.go b/v2/acl/types.go index 83b7fd23..e5ed3a20 100644 --- a/v2/acl/types.go +++ b/v2/acl/types.go @@ -181,7 +181,7 @@ func (t *Target) SetRole(v Role) { } } -func (t *Target) GetKeyList() [][]byte { +func (t *Target) GetKeys() [][]byte { if t != nil { return t.keys } @@ -189,7 +189,7 @@ func (t *Target) GetKeyList() [][]byte { return nil } -func (t *Target) SetKeyList(v [][]byte) { +func (t *Target) SetKeys(v [][]byte) { if t != nil { t.keys = v }