|
|
|
@ -2844,8 +2844,13 @@ func (api objectAPIHandlers) PutObjectRetentionHandler(w http.ResponseWriter, r |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
objInfo.UserDefined[strings.ToLower(xhttp.AmzObjectLockMode)] = string(objRetention.Mode) |
|
|
|
|
objInfo.UserDefined[strings.ToLower(xhttp.AmzObjectLockRetainUntilDate)] = objRetention.RetainUntilDate.UTC().Format(time.RFC3339) |
|
|
|
|
if objRetention.Mode.Valid() { |
|
|
|
|
objInfo.UserDefined[strings.ToLower(xhttp.AmzObjectLockMode)] = string(objRetention.Mode) |
|
|
|
|
objInfo.UserDefined[strings.ToLower(xhttp.AmzObjectLockRetainUntilDate)] = objRetention.RetainUntilDate.UTC().Format(time.RFC3339) |
|
|
|
|
} else { |
|
|
|
|
delete(objInfo.UserDefined, strings.ToLower(xhttp.AmzObjectLockRetainUntilDate)) |
|
|
|
|
delete(objInfo.UserDefined, strings.ToLower(xhttp.AmzObjectLockMode)) |
|
|
|
|
} |
|
|
|
|
if objInfo.UserTags != "" { |
|
|
|
|
objInfo.UserDefined[xhttp.AmzObjectTagging] = objInfo.UserTags |
|
|
|
|
} |
|
|
|
@ -2914,6 +2919,11 @@ func (api objectAPIHandlers) GetObjectRetentionHandler(w http.ResponseWriter, r |
|
|
|
|
|
|
|
|
|
retention := objectlock.GetObjectRetentionMeta(objInfo.UserDefined) |
|
|
|
|
|
|
|
|
|
if !retention.Mode.Valid() { |
|
|
|
|
writeErrorResponse(ctx, w, errorCodes.ToAPIErr(ErrNoSuchObjectLockConfiguration), r.URL, guessIsBrowserReq(r)) |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
writeSuccessResponseXML(w, encodeResponse(retention)) |
|
|
|
|
// Notify object retention accessed via a GET request.
|
|
|
|
|
sendEvent(eventArgs{ |
|
|
|
|