[#458] *: Refactor working with NeoFS identities

Pull latest changes from NeoFS SDK Go library. Decrease redundant and
unsafe usage of ID pointers. Use `EncodeToString` method in order to
calculate protocol strings.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2022-05-25 20:25:43 +03:00 committed by Kira
parent 3f0dbcc995
commit 087d500c5f
34 changed files with 259 additions and 280 deletions

View file

@ -162,7 +162,7 @@ func (h *handler) PutObjectLegalHoldHandler(w http.ResponseWriter, r *http.Reque
ps := &layer.PutSystemObjectParams{
BktInfo: bktInfo,
ObjName: objInfo.LegalHoldObject(),
Lock: &data.ObjectLock{LegalHold: true, Objects: []oid.ID{*objInfo.ID}},
Lock: &data.ObjectLock{LegalHold: true, Objects: []oid.ID{objInfo.ID}},
Metadata: make(map[string]string),
}
if _, err = h.obj.PutSystemObject(r.Context(), ps); err != nil {
@ -252,7 +252,7 @@ func (h *handler) PutObjectRetentionHandler(w http.ResponseWriter, r *http.Reque
h.logAndSendError(w, "could not get object info", reqInfo, err)
return
}
lock.Objects = append(lock.Objects, *objInfo.ID)
lock.Objects = append(lock.Objects, objInfo.ID)
lockInfo, err := h.obj.HeadSystemObject(r.Context(), bktInfo, objInfo.RetentionObject())
if err != nil && !apiErrors.IsS3Error(err, apiErrors.ErrNoSuchKey) {