forked from TrueCloudLab/frostfs-s3-gw
[#230] layer: Change objects_list_cache's key
Remove access_key from objectsListCache key Signed-off-by: Angira Kekteeva <kira@nspcc.ru>
This commit is contained in:
parent
04b7958ab3
commit
dcac1aa3e3
3 changed files with 4 additions and 9 deletions
|
@ -572,7 +572,7 @@ func (n *layer) listAllObjects(ctx context.Context, p ListObjectsParamsCommon) (
|
|||
return nil, err
|
||||
}
|
||||
|
||||
if cacheKey, err = createKey(ctx, bkt.CID, listObjectsMethod, p.Prefix, p.Delimiter); err != nil {
|
||||
if cacheKey, err = createKey(bkt.CID, listObjectsMethod, p.Prefix, p.Delimiter); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package layer
|
||||
|
||||
import (
|
||||
"context"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
|
@ -84,14 +83,10 @@ func (l *listObjectsCache) Put(key cacheOptions, objects []*ObjectInfo) {
|
|||
})
|
||||
}
|
||||
|
||||
func createKey(ctx context.Context, cid *cid.ID, method, prefix, delimiter string) (cacheOptions, error) {
|
||||
box, err := GetBoxData(ctx)
|
||||
if err != nil {
|
||||
return cacheOptions{}, err
|
||||
}
|
||||
func createKey(cid *cid.ID, method, prefix, delimiter string) (cacheOptions, error) {
|
||||
p := cacheOptions{
|
||||
method: method,
|
||||
key: box.Gate.AccessKey + cid.String(),
|
||||
key: cid.String(),
|
||||
delimiter: delimiter,
|
||||
prefix: prefix,
|
||||
}
|
||||
|
|
|
@ -193,7 +193,7 @@ func (n *layer) ListObjectVersions(ctx context.Context, p *ListObjectVersionsPar
|
|||
return nil, err
|
||||
}
|
||||
|
||||
cacheKey, err := createKey(ctx, bkt.CID, listVersionsMethod, p.Prefix, p.Delimiter)
|
||||
cacheKey, err := createKey(bkt.CID, listVersionsMethod, p.Prefix, p.Delimiter)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue