forked from TrueCloudLab/frostfs-s3-gw
[#553] Optimize target formation with multiple keys
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
parent
d6065c64c4
commit
06d043e1eb
1 changed files with 3 additions and 3 deletions
|
@ -800,15 +800,15 @@ func formRecords(operations []*astOperation, resource *astResource) ([]*eacl.Rec
|
||||||
if astOp.IsGroupGrantee() {
|
if astOp.IsGroupGrantee() {
|
||||||
eacl.AddFormedTarget(record, eacl.RoleOthers)
|
eacl.AddFormedTarget(record, eacl.RoleOthers)
|
||||||
} else {
|
} else {
|
||||||
// TODO(av): optimize target
|
targetKeys := make([]ecdsa.PublicKey, 0, len(astOp.Users))
|
||||||
for _, user := range astOp.Users {
|
for _, user := range astOp.Users {
|
||||||
pk, err := keys.NewPublicKeyFromString(user)
|
pk, err := keys.NewPublicKeyFromString(user)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("public key from string: %w", err)
|
return nil, fmt.Errorf("public key from string: %w", err)
|
||||||
}
|
}
|
||||||
// Unknown role is used, because it is ignored when keys are set
|
targetKeys = append(targetKeys, (ecdsa.PublicKey)(*pk))
|
||||||
eacl.AddFormedTarget(record, eacl.RoleUnknown, (ecdsa.PublicKey)(*pk))
|
|
||||||
}
|
}
|
||||||
|
eacl.AddFormedTarget(record, eacl.RoleUnknown, targetKeys...)
|
||||||
}
|
}
|
||||||
if len(resource.Object) != 0 {
|
if len(resource.Object) != 0 {
|
||||||
if len(resource.Version) != 0 {
|
if len(resource.Version) != 0 {
|
||||||
|
|
Loading…
Reference in a new issue