forked from TrueCloudLab/frostfs-s3-gw
[#405] English Check
Signed-off-by: Elizaveta Chichindaeva <elizaveta@nspcc.ru>
This commit is contained in:
parent
a0a04a73bd
commit
bf38007692
42 changed files with 205 additions and 205 deletions
|
@ -357,7 +357,7 @@ func checkOwner(info *data.BucketInfo, owner string) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
// maybe need to convert owner to appropriate format
|
||||
// may need to convert owner to appropriate format
|
||||
if info.Owner.String() != owner {
|
||||
return errors.GetAPIError(errors.ErrAccessDenied)
|
||||
}
|
||||
|
|
|
@ -16,14 +16,14 @@ type (
|
|||
cfg *Config
|
||||
}
|
||||
|
||||
// Config contains data which handler need to keep.
|
||||
// Config contains data which handler needs to keep.
|
||||
Config struct {
|
||||
DefaultPolicy *netmap.PlacementPolicy
|
||||
DefaultMaxAge int
|
||||
}
|
||||
)
|
||||
|
||||
// DefaultPolicy is a default policy of placing container in NeoFS if it's not set at the request.
|
||||
// DefaultPolicy is a default policy of placing containers in NeoFS if it's not set at the request.
|
||||
const DefaultPolicy = "REP 3"
|
||||
|
||||
var _ api.Handler = (*handler)(nil)
|
||||
|
|
|
@ -20,7 +20,7 @@ type copyObjectArgs struct {
|
|||
|
||||
const replaceMetadataDirective = "REPLACE"
|
||||
|
||||
// path2BucketObject returns bucket and object.
|
||||
// path2BucketObject returns a bucket and an object.
|
||||
func path2BucketObject(path string) (bucket, prefix string) {
|
||||
path = strings.TrimPrefix(path, api.SlashSeparator)
|
||||
m := strings.Index(path, api.SlashSeparator)
|
||||
|
|
|
@ -11,7 +11,7 @@ import (
|
|||
)
|
||||
|
||||
const (
|
||||
// DefaultMaxAge -- default value of Access-Control-Max-Age if this value is not set in a rule.
|
||||
// DefaultMaxAge is a default value of Access-Control-Max-Age if this value is not set in a rule.
|
||||
DefaultMaxAge = 600
|
||||
wildcard = "*"
|
||||
)
|
||||
|
|
|
@ -15,7 +15,7 @@ import (
|
|||
"go.uber.org/zap/zapcore"
|
||||
)
|
||||
|
||||
// DeleteObjectsRequest - xml carrying the object key names which needs to be deleted.
|
||||
// DeleteObjectsRequest -- xml carrying the object key names which should be deleted.
|
||||
type DeleteObjectsRequest struct {
|
||||
// Element to enable quiet mode for the request
|
||||
Quiet bool
|
||||
|
@ -23,13 +23,13 @@ type DeleteObjectsRequest struct {
|
|||
Objects []ObjectIdentifier `xml:"Object"`
|
||||
}
|
||||
|
||||
// ObjectIdentifier carries key name for the object to delete.
|
||||
// ObjectIdentifier carries the key name for the object to delete.
|
||||
type ObjectIdentifier struct {
|
||||
ObjectName string `xml:"Key"`
|
||||
VersionID string `xml:"VersionId,omitempty"`
|
||||
}
|
||||
|
||||
// DeletedObject carries key name for the object to delete.
|
||||
// DeletedObject carries the key name for the object to delete.
|
||||
type DeletedObject struct {
|
||||
ObjectIdentifier
|
||||
DeleteMarker bool `xml:"DeleteMarker,omitempty"`
|
||||
|
@ -144,7 +144,7 @@ func (h *handler) DeleteObjectHandler(w http.ResponseWriter, r *http.Request) {
|
|||
func (h *handler) DeleteMultipleObjectsHandler(w http.ResponseWriter, r *http.Request) {
|
||||
reqInfo := api.GetReqInfo(r.Context())
|
||||
|
||||
// Content-Md5 is requied should be set
|
||||
// Content-Md5 is required and should be set
|
||||
// http://docs.aws.amazon.com/AmazonS3/latest/API/multiobjectdeleteapi.html
|
||||
if _, ok := r.Header[api.ContentMD5]; !ok {
|
||||
h.logAndSendError(w, "missing Content-MD5", reqInfo, errors.GetAPIError(errors.ErrMissingContentMD5))
|
||||
|
|
|
@ -480,7 +480,7 @@ func TestObjectLegalHold(t *testing.T) {
|
|||
hc.Handler().GetObjectLegalHoldHandler(w, r)
|
||||
assertLegalHold(t, w, legalHoldOn)
|
||||
|
||||
// to make sure put hold is idempotent operation
|
||||
// to make sure put hold is an idempotent operation
|
||||
w, r = prepareTestRequest(t, bktName, objName, &data.LegalHold{Status: legalHoldOn})
|
||||
hc.Handler().PutObjectLegalHoldHandler(w, r)
|
||||
require.Equal(t, http.StatusOK, w.Code)
|
||||
|
@ -493,7 +493,7 @@ func TestObjectLegalHold(t *testing.T) {
|
|||
hc.Handler().GetObjectLegalHoldHandler(w, r)
|
||||
assertLegalHold(t, w, legalHoldOff)
|
||||
|
||||
// to make sure put hold is idempotent operation
|
||||
// to make sure put hold is an idempotent operation
|
||||
w, r = prepareTestRequest(t, bktName, objName, &data.LegalHold{Status: legalHoldOff})
|
||||
hc.Handler().PutObjectLegalHoldHandler(w, r)
|
||||
require.Equal(t, http.StatusOK, w.Code)
|
||||
|
|
|
@ -2,7 +2,7 @@ package handler
|
|||
|
||||
import "encoding/xml"
|
||||
|
||||
// ListBucketsResponse - format for list buckets response.
|
||||
// ListBucketsResponse -- format for list buckets response.
|
||||
type ListBucketsResponse struct {
|
||||
XMLName xml.Name `xml:"http://s3.amazonaws.com/doc/2006-03-01/ ListAllMyBucketsResult" json:"-"`
|
||||
|
||||
|
@ -85,7 +85,7 @@ func NewGrantee(t GranteeType) *Grantee {
|
|||
}
|
||||
}
|
||||
|
||||
// Owner - bucket owner/principal.
|
||||
// Owner -- bucket owner/principal.
|
||||
type Owner struct {
|
||||
ID string
|
||||
DisplayName string
|
||||
|
@ -106,7 +106,7 @@ type Object struct {
|
|||
// Owner of the object.
|
||||
Owner *Owner `xml:"Owner,omitempty"`
|
||||
|
||||
// The class of storage used to store the object.
|
||||
// Class of storage used to store the object.
|
||||
StorageClass string `xml:"StorageClass,omitempty"`
|
||||
}
|
||||
|
||||
|
@ -134,7 +134,7 @@ type DeleteMarkerEntry struct {
|
|||
// StringMap is a map[string]string.
|
||||
type StringMap map[string]string
|
||||
|
||||
// LocationResponse - format for location response.
|
||||
// LocationResponse -- format for location response.
|
||||
type LocationResponse struct {
|
||||
XMLName xml.Name `xml:"http://s3.amazonaws.com/doc/2006-03-01/ LocationConstraint" json:"-"`
|
||||
Location string `xml:",chardata"`
|
||||
|
@ -182,13 +182,13 @@ type PostResponse struct {
|
|||
ETag string `xml:"Etag"`
|
||||
}
|
||||
|
||||
// Tag is AWS key-value tag.
|
||||
// Tag is an AWS key-value tag.
|
||||
type Tag struct {
|
||||
Key string
|
||||
Value string
|
||||
}
|
||||
|
||||
// MarshalXML - StringMap marshals into XML.
|
||||
// MarshalXML -- StringMap marshals into XML.
|
||||
func (s StringMap) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
|
||||
tokens := []xml.Token{start}
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ func shouldEscape(c byte) bool {
|
|||
return true
|
||||
}
|
||||
|
||||
// s3URLEncode is based on url.QueryEscape() code,
|
||||
// s3URLEncode is based on url.QueryEscape() code
|
||||
// while considering some S3 exceptions.
|
||||
func s3URLEncode(s string, mode encoding) string {
|
||||
spaceCount, hexCount := 0, 0
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue