forked from TrueCloudLab/frostfs-api-go
[#283] pkg/eacl: Remove usage of deprecated container ID from src files
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
7314038069
commit
f60f7e0cdb
2 changed files with 10 additions and 10 deletions
|
@ -5,7 +5,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/nspcc-dev/neofs-api-go/pkg"
|
"github.com/nspcc-dev/neofs-api-go/pkg"
|
||||||
"github.com/nspcc-dev/neofs-api-go/pkg/container"
|
cid "github.com/nspcc-dev/neofs-api-go/pkg/container/id"
|
||||||
"github.com/nspcc-dev/neofs-api-go/pkg/owner"
|
"github.com/nspcc-dev/neofs-api-go/pkg/owner"
|
||||||
v2acl "github.com/nspcc-dev/neofs-api-go/v2/acl"
|
v2acl "github.com/nspcc-dev/neofs-api-go/v2/acl"
|
||||||
)
|
)
|
||||||
|
@ -116,7 +116,7 @@ func (r *Record) AddObjectVersionFilter(m Match, v *pkg.Version) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// AddObjectContainerIDFilter adds filter by object container ID.
|
// AddObjectContainerIDFilter adds filter by object container ID.
|
||||||
func (r *Record) AddObjectContainerIDFilter(m Match, id *container.ID) {
|
func (r *Record) AddObjectContainerIDFilter(m Match, id *cid.ID) {
|
||||||
r.addObjectReservedFilter(m, fKeyObjContainerID, id)
|
r.addObjectReservedFilter(m, fKeyObjContainerID, id)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ import (
|
||||||
"crypto/sha256"
|
"crypto/sha256"
|
||||||
|
|
||||||
"github.com/nspcc-dev/neofs-api-go/pkg"
|
"github.com/nspcc-dev/neofs-api-go/pkg"
|
||||||
"github.com/nspcc-dev/neofs-api-go/pkg/container"
|
cid "github.com/nspcc-dev/neofs-api-go/pkg/container/id"
|
||||||
v2acl "github.com/nspcc-dev/neofs-api-go/v2/acl"
|
v2acl "github.com/nspcc-dev/neofs-api-go/v2/acl"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -13,17 +13,17 @@ import (
|
||||||
// Table is compatible with v2 acl.EACLTable message.
|
// Table is compatible with v2 acl.EACLTable message.
|
||||||
type Table struct {
|
type Table struct {
|
||||||
version pkg.Version
|
version pkg.Version
|
||||||
cid *container.ID
|
cid *cid.ID
|
||||||
records []*Record
|
records []*Record
|
||||||
}
|
}
|
||||||
|
|
||||||
// CID returns identifier of the container that should use given access control rules.
|
// CID returns identifier of the container that should use given access control rules.
|
||||||
func (t Table) CID() *container.ID {
|
func (t Table) CID() *cid.ID {
|
||||||
return t.cid
|
return t.cid
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetCID sets identifier of the container that should use given access control rules.
|
// SetCID sets identifier of the container that should use given access control rules.
|
||||||
func (t *Table) SetCID(cid *container.ID) {
|
func (t *Table) SetCID(cid *cid.ID) {
|
||||||
t.cid = cid
|
t.cid = cid
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -77,7 +77,7 @@ func NewTable() *Table {
|
||||||
}
|
}
|
||||||
|
|
||||||
// CreateTable creates, initializes with parameters and returns Table instance.
|
// CreateTable creates, initializes with parameters and returns Table instance.
|
||||||
func CreateTable(cid container.ID) *Table {
|
func CreateTable(cid cid.ID) *Table {
|
||||||
t := NewTable()
|
t := NewTable()
|
||||||
t.SetCID(&cid)
|
t.SetCID(&cid)
|
||||||
|
|
||||||
|
@ -102,14 +102,14 @@ func NewTableFromV2(table *v2acl.Table) *Table {
|
||||||
}
|
}
|
||||||
|
|
||||||
// set container id
|
// set container id
|
||||||
if cid := table.GetContainerID(); cid != nil {
|
if id := table.GetContainerID(); id != nil {
|
||||||
if t.cid == nil {
|
if t.cid == nil {
|
||||||
t.cid = new(container.ID)
|
t.cid = new(cid.ID)
|
||||||
}
|
}
|
||||||
|
|
||||||
var h [sha256.Size]byte
|
var h [sha256.Size]byte
|
||||||
|
|
||||||
copy(h[:], table.GetContainerID().GetValue())
|
copy(h[:], id.GetValue())
|
||||||
t.cid.SetSHA256(h)
|
t.cid.SetSHA256(h)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue