Compare commits

..

2 commits

Author SHA1 Message Date
dce34ddb9b [#553] authmate: Add retryer to create access box
After using AddChain to provide access to container we have to wait:
* tx with APE chain be accepted by blockchain
* cache in storage node be updated

it takes a while. So we add retry
 (the same as when we add bucket settings during bucket creation)

Signed-off-by: Denis Kirillov <d.kirillov@yadro.com>
2024-11-19 15:11:56 +03:00
7c2f247442 [#553] authmate: Don't use basic acl
Signed-off-by: Denis Kirillov <d.kirillov@yadro.com>
2024-11-19 15:11:53 +03:00
2 changed files with 8 additions and 7 deletions

View file

@ -42,6 +42,7 @@ type PrmContainerCreate struct {
AdditionalAttributes [][2]string
}
// PrmAddContainerPolicyChain groups parameter of FrostFS.AddContainerPolicyChain operation.
type PrmAddContainerPolicyChain struct {
ContainerID cid.ID
Chain chain.Chain

View file

@ -137,18 +137,18 @@ func (x *FrostFS) CreateContainer(ctx context.Context, prm frostfs.PrmContainerC
// AddContainerPolicyChain implements frostfs.FrostFS interface method.
func (x *FrostFS) AddContainerPolicyChain(ctx context.Context, prm frostfs.PrmAddContainerPolicyChain) error {
var prmAddAPEChain pool.PrmAddAPEChain
prmAddAPEChain.Target = ape.ChainTarget{
TargetType: ape.TargetTypeContainer,
Name: prm.ContainerID.EncodeToString(),
}
data, err := prm.Chain.MarshalBinary()
if err != nil {
return err
}
prmAddAPEChain.Chain = ape.Chain{Raw: data}
prmAddAPEChain := pool.PrmAddAPEChain{
Target: ape.ChainTarget{
TargetType: ape.TargetTypeContainer,
Name: prm.ContainerID.EncodeToString(),
},
Chain: ape.Chain{Raw: data},
}
err = x.pool.AddAPEChain(ctx, prmAddAPEChain)
return handleObjectError("add ape chain to container", err)