Documentation
¶
Index ¶
- Constants
- Variables
- func New(log *zap.Logger, obj *layer.Layer, cfg Config, policyEngine PolicyEngine, ...) (api.Handler, error)
- type APE
- type AWSACL
- type AccessControlPolicy
- type BodyReader
- type Bucket
- type Checksum
- type CommonPrefix
- type CompleteMultipartUpload
- type CompleteMultipartUploadResponse
- type Config
- type CopyObjectResponse
- type DeleteError
- type DeleteMarkerEntry
- type DeleteObjectsRequest
- type DeleteObjectsResponse
- type DeletedObject
- type ExternalStorage
- type FrostFSID
- type GetObjectAttributesArgs
- type GetObjectAttributesResponse
- type Grant
- type Grantee
- type GranteeType
- type InitiateMultipartUploadResponse
- type Initiator
- type ListBucketsResponse
- type ListMultipartUploadsResponse
- type ListObjectsV1Response
- type ListObjectsV2Response
- type ListObjectsVersionsResponse
- type ListPartsResponse
- type LocationResponse
- type MultipartUpload
- type Object
- type ObjectIdentifier
- type ObjectParts
- type ObjectVersionResponse
- type Owner
- type Part
- type PatchObject
- type PatchObjectResult
- type PolicyEngine
- type PolicyStatus
- type PolicyStatusIsPublic
- type PostResponse
- type RetryStrategy
- type UploadPartCopyResponse
- type VersioningConfiguration
Constants ¶
const ( RetryStrategyExponential = "exponential" RetryStrategyConstant = "constant" )
const ( PolicyStatusIsPublicFalse = "false" PolicyStatusIsPublicTrue = "true" )
According to the AWS documentation (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketPolicyStatus.html), the `IsPublic` tag value should be in uppercase. However, the `aws-cli` utility interprets such responses as always `false`. To avoid incorrect interpretation, we return the tag value in lowercase.
const (
// DefaultMaxAge is a default value of Access-Control-Max-Age if this value is not set in a rule.
DefaultMaxAge = 600
)
Variables ¶
var ErrMFADeleteEnabledInBucketButDisabledInGate = errors.New("mfa delete enabled in bucket, but disabled in gate")
Functions ¶
Types ¶
type APE ¶ added in v0.29.0
type APE interface {
PutBucketPolicy(ns string, cnrID cid.ID, policy []byte, chains []*chain.Chain) error
DeleteBucketPolicy(ns string, cnrID cid.ID, chainIDs []chain.ID) error
GetBucketPolicy(ns string, cnrID cid.ID) ([]byte, error)
SaveACLChains(cid string, chains []*chain.Chain) error
DeleteACLChains(cid string, chainIDs []chain.ID) error
}
APE is Access Policy Engine that needs to save policy and acl info to different places.
type AccessControlPolicy ¶
type AccessControlPolicy struct {
XMLName xml.Name `xml:"http://s3.amazonaws.com/doc/2006-03-01/ AccessControlPolicy" json:"-"`
Owner Owner
AccessControlList []*Grant `xml:"AccessControlList>Grant"`
}
AccessControlPolicy contains ACL.
type BodyReader ¶ added in v0.32.5
type BodyReader interface {
io.ReadCloser
TrailerHeaders() map[string]string
}
type Bucket ¶
type Bucket struct {
Name string `xml:"Name"`
CreationDate string `xml:"CreationDate"` // time string of format "2006-01-02T15:04:05.000Z"
BucketRegion string `xml:"BucketRegion,omitempty"`
}
Bucket container for bucket metadata.
type CommonPrefix ¶
type CommonPrefix struct {
Prefix string
}
CommonPrefix container for prefix response in ListObjects's response.
type CompleteMultipartUpload ¶
type CompleteMultipartUpload struct {
XMLName xml.Name `xml:"http://s3.amazonaws.com/doc/2006-03-01/ CompleteMultipartUpload"`
Parts []*layer.CompletedPart `xml:"Part"`
}
type Config ¶
type Config interface {
DefaultPlacementPolicy(namespace string) (netmap.PlacementPolicy, bool)
PlacementPolicy(namespace, constraint string) (netmap.PlacementPolicy, bool)
CopiesNumbers(namespace, constraint string) ([]uint32, bool)
SufficientCopiesNumbers(namespace, constraint string) ([][]uint32, bool)
DefaultCopiesNumbers(namespace string) []uint32
DefaultSufficientCopiesNumbers(namespace string) [][]uint32
NewXMLDecoder(reader io.Reader, agent string) *xml.Decoder
DefaultMaxAge() int
ResolveZoneList() []string
IsResolveListAllow() bool
BypassContentEncodingInChunks(agent string) bool
MD5Enabled() bool
RetryMaxAttempts() int
RetryMaxBackoff() time.Duration
RetryStrategy() RetryStrategy
TLSTerminationHeader() string
ListingKeepaliveThrottle() time.Duration
CORSCopiesNumbers() []uint32
CORSSufficientCopies() [][]uint32
LifecycleCopiesNumbers() []uint32
LifecycleSufficientCopies() [][]uint32
WebStaticHostingContainer() *data.BucketInfo
LifecycleContainer() *data.BucketInfo
CorsContainer() *data.BucketInfo
MfaManager() *mfa.ReadManager
WebsiteCopiesNumbers() []uint32
WebsiteSufficientCopies() [][]uint32
MultipleRemovalWorkerPoolSize() int
ExpirationHeaderEnabled() bool
BucketType() string
}
Config contains data which handler needs to keep.
type CopyObjectResponse ¶
type CopyObjectResponse struct {
XMLName xml.Name `xml:"http://s3.amazonaws.com/doc/2006-03-01/ CopyObjectResult" json:"-"`
LastModified string // time string of format "2006-01-02T15:04:05.000Z"
ETag string // md5sum of the copied object.
}
CopyObjectResponse container returns ETag and LastModified of the successfully copied object.
type DeleteError ¶
type DeleteError struct {
Code string `xml:"Code,omitempty"`
Message string `xml:"Message,omitempty"`
Key string `xml:"Key,omitempty"`
VersionID string `xml:"VersionId,omitempty"`
}
DeleteError structure.
type DeleteMarkerEntry ¶
type DeleteMarkerEntry struct {
IsLatest bool `xml:"IsLatest"`
Key string `xml:"Key"`
LastModified string `xml:"LastModified"`
Owner Owner `xml:"Owner"`
VersionID string `xml:"VersionId"`
}
DeleteMarkerEntry container for deleted object's version in the response of ListBucketObjectVersionsHandler.
type DeleteObjectsRequest ¶
type DeleteObjectsRequest struct {
XMLName xml.Name `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Delete" json:"-"`
// Element to enable quiet mode for the request
Quiet bool `xml:"Quiet,omitempty"`
// List of objects to be deleted
Objects []ObjectIdentifier `xml:"Object"`
}
DeleteObjectsRequest -- xml carrying the object key names which should be deleted.
type DeleteObjectsResponse ¶
type DeleteObjectsResponse struct {
XMLName xml.Name `xml:"http://s3.amazonaws.com/doc/2006-03-01/ DeleteResult" json:"-"`
// Collection of all deleted objects
DeletedObjects []DeletedObject `xml:"Deleted,omitempty"`
// Collection of errors deleting certain objects.
Errors []DeleteError `xml:"Error,omitempty"`
}
DeleteObjectsResponse container for multiple object deletes.
type DeletedObject ¶
type DeletedObject struct {
ObjectIdentifier
DeleteMarker bool `xml:"DeleteMarker,omitempty"`
DeleteMarkerVersionID string `xml:"DeleteMarkerVersionId,omitempty"`
}
DeletedObject carries the key name for the object to delete.
type ExternalStorage ¶ added in v0.37.0
type ExternalStorage interface {
S3MirroringEnabled() bool
SupportsNamespace(ns string) bool
GetObject(context.Context, *middleware.ReqInfo) (*layer.ExternalObjectPayload, error)
DeleteObject(context.Context, *middleware.ReqInfo) error
ListObjects(ctx context.Context, namespace string, params *layer.ListObjectsParamsV2) (*layer.ListObjectsInfoV2, error)
}
type GetObjectAttributesArgs ¶
type GetObjectAttributesResponse ¶
type GetObjectAttributesResponse struct {
XMLName xml.Name `xml:"http://s3.amazonaws.com/doc/2006-03-01/ GetObjectAttributesResponse"`
ETag string `xml:"ETag,omitempty"`
Checksum *Checksum `xml:"Checksum,omitempty"`
ObjectSize uint64 `xml:"ObjectSize,omitempty"`
StorageClass string `xml:"StorageClass,omitempty"`
ObjectParts *ObjectParts `xml:"ObjectParts,omitempty"`
}
type Grantee ¶
type Grantee struct {
XMLName xml.Name `xml:"Grantee"`
XMLNS string `xml:"xmlns:xsi,attr"`
ID string `xml:"ID,omitempty"`
EmailAddress string `xml:"EmailAddress,omitempty"`
URI string `xml:"URI,omitempty"`
Type GranteeType `xml:"xsi:type,attr"`
}
Grantee is info about access rights of some actor.
func NewGrantee ¶
func NewGrantee(t GranteeType) *Grantee
NewGrantee creates new grantee using workaround https://github.com/golang/go/issues/9519#issuecomment-252196382
type ListBucketsResponse ¶
type ListBucketsResponse struct {
XMLName xml.Name `xml:"http://s3.amazonaws.com/doc/2006-03-01/ ListAllMyBucketsResult" json:"-"`
Owner Owner
// Container for one or more buckets.
Buckets struct {
Buckets []Bucket `xml:"Bucket"`
} // Buckets are nested
ContinuationToken string `xml:"ContinuationToken,omitempty"`
Prefix string `xml:"Prefix,omitempty"`
}
ListBucketsResponse -- format for list buckets response.
type ListMultipartUploadsResponse ¶
type ListMultipartUploadsResponse struct {
XMLName xml.Name `xml:"http://s3.amazonaws.com/doc/2006-03-01/ ListMultipartUploadsResult" json:"-"`
Bucket string `xml:"Bucket"`
CommonPrefixes []CommonPrefix `xml:"CommonPrefixes"`
Delimiter string `xml:"Delimiter,omitempty"`
EncodingType string `xml:"EncodingType,omitempty"`
IsTruncated bool `xml:"IsTruncated"`
KeyMarker string `xml:"KeyMarker"`
MaxUploads int `xml:"MaxUploads"`
NextKeyMarker string `xml:"NextKeyMarker,omitempty"`
NextUploadIDMarker string `xml:"NextUploadIdMarker,omitempty"`
Prefix string `xml:"Prefix"`
Uploads []MultipartUpload `xml:"Upload"`
UploadIDMarker string `xml:"UploadIdMarker,omitempty"`
}
type ListObjectsV1Response ¶
type ListObjectsV1Response struct {
XMLName xml.Name `xml:"http://s3.amazonaws.com/doc/2006-03-01/ ListBucketResult" json:"-"`
CommonPrefixes []CommonPrefix `xml:"CommonPrefixes"`
Contents []Object `xml:"Contents"`
Delimiter string `xml:"Delimiter,omitempty"`
EncodingType string `xml:"EncodingType,omitempty"`
IsTruncated bool `xml:"IsTruncated"`
Marker string `xml:"Marker"`
MaxKeys int `xml:"MaxKeys"`
Name string `xml:"Name"`
NextMarker string `xml:"NextMarker,omitempty"`
Prefix string `xml:"Prefix"`
}
ListObjectsV1Response -- format for ListObjectsV1 response.
type ListObjectsV2Response ¶
type ListObjectsV2Response struct {
XMLName xml.Name `xml:"http://s3.amazonaws.com/doc/2006-03-01/ ListBucketResult" json:"-"`
Mode string `xml:"Type,attr,omitempty"`
CommonPrefixes []CommonPrefix `xml:"CommonPrefixes"`
Contents []Object `xml:"Contents"`
ContinuationToken string `xml:"ContinuationToken,omitempty"`
Delimiter string `xml:"Delimiter,omitempty"`
EncodingType string `xml:"EncodingType,omitempty"`
IsTruncated bool `xml:"IsTruncated"`
KeyCount int `xml:"KeyCount"`
MaxKeys int `xml:"MaxKeys"`
Name string `xml:"Name"`
NextContinuationToken string `xml:"NextContinuationToken,omitempty"`
Prefix string `xml:"Prefix"`
StartAfter string `xml:"StartAfter,omitempty"`
}
ListObjectsV2Response -- format for ListObjectsV2 response.
type ListObjectsVersionsResponse ¶
type ListObjectsVersionsResponse struct {
XMLName xml.Name `xml:"http://s3.amazonaws.com/doc/2006-03-01/ ListVersionsResult" json:"-"`
Mode string `xml:"Type,attr,omitempty"`
EncodingType string `xml:"EncodingType,omitempty"`
Name string `xml:"Name"`
IsTruncated bool `xml:"IsTruncated"`
KeyMarker string `xml:"KeyMarker"`
NextKeyMarker string `xml:"NextKeyMarker,omitempty"`
NextVersionIDMarker string `xml:"NextVersionIdMarker,omitempty"`
VersionIDMarker string `xml:"VersionIdMarker"`
DeleteMarker []DeleteMarkerEntry `xml:"DeleteMarker"`
Version []ObjectVersionResponse `xml:"Version"`
CommonPrefixes []CommonPrefix `xml:"CommonPrefixes"`
Prefix string `xml:"Prefix"`
Delimiter string `xml:"Delimiter,omitempty"`
MaxKeys int `xml:"MaxKeys"`
}
ListObjectsVersionsResponse is a response of ListBucketObjectVersionsHandler.
type ListPartsResponse ¶
type ListPartsResponse struct {
XMLName xml.Name `xml:"http://s3.amazonaws.com/doc/2006-03-01/ ListPartsResult" json:"-"`
Bucket string `xml:"Bucket"`
Initiator Initiator `xml:"Initiator"`
IsTruncated bool `xml:"IsTruncated"`
Key string `xml:"Key"`
MaxParts int `xml:"MaxParts"`
NextPartNumberMarker int `xml:"NextPartNumberMarker"`
Owner Owner `xml:"Owner"`
Parts []*layer.Part `xml:"Part"`
PartNumberMarker int `xml:"PartNumberMarker"`
StorageClass string `xml:"StorageClass"`
UploadID string `xml:"UploadId"`
}
type LocationResponse ¶
type LocationResponse struct {
XMLName xml.Name `xml:"http://s3.amazonaws.com/doc/2006-03-01/ LocationConstraint" json:"-"`
Location string `xml:",chardata"`
}
LocationResponse -- format for location response.
type MultipartUpload ¶
type Object ¶
type Object struct {
Key string
LastModified string // time string of format "2006-01-02T15:04:05.000Z"
ETag string `xml:"ETag,omitempty"`
Size uint64
// Owner of the object.
Owner *Owner `xml:"Owner,omitempty"`
// Class of storage used to store the object.
StorageClass string `xml:"StorageClass"`
}
Object container for object metadata.
type ObjectIdentifier ¶
type ObjectIdentifier struct {
ObjectName string `xml:"Key"`
VersionID string `xml:"VersionId,omitempty"`
ETag string `xml:"ETag,omitempty"`
LastModifiedTime string `xml:"LastModifiedTime,omitempty"`
Size string `xml:"Size,omitempty"`
}
ObjectIdentifier carries the key name for the object to delete.
type ObjectParts ¶
type ObjectVersionResponse ¶
type ObjectVersionResponse struct {
ETag string `xml:"ETag"`
IsLatest bool `xml:"IsLatest"`
Key string `xml:"Key"`
LastModified string `xml:"LastModified"`
Owner Owner `xml:"Owner"`
Size uint64 `xml:"Size"`
StorageClass string `xml:"StorageClass"`
VersionID string `xml:"VersionId"`
}
ObjectVersionResponse container for object version in the response of ListBucketObjectVersionsHandler.
type PatchObject ¶ added in v0.31.0
type PatchObjectResult ¶ added in v0.31.0
type PatchObjectResult struct {
Object PatchObject `xml:"Object"`
}
type PolicyEngine ¶ added in v0.33.0
type PolicyEngine struct {
APE APE
Converter *policyengine.Converter
}
type PolicyStatus ¶ added in v0.30.0
type PolicyStatus struct {
XMLName xml.Name `xml:"http://s3.amazonaws.com/doc/2006-03-01/ PolicyStatus" json:"-"`
IsPublic PolicyStatusIsPublic `xml:"IsPublic"`
}
PolicyStatus contains status of bucket policy.
type PolicyStatusIsPublic ¶ added in v0.30.0
type PolicyStatusIsPublic string
type PostResponse ¶
type PostResponse struct {
Bucket string `xml:"Bucket"`
Key string `xml:"Key"`
ETag string `xml:"Etag"`
}
PostResponse contains result of posting object.
type RetryStrategy ¶ added in v0.29.1
type RetryStrategy string
type UploadPartCopyResponse ¶
type VersioningConfiguration ¶
type VersioningConfiguration struct {
XMLName xml.Name `xml:"http://s3.amazonaws.com/doc/2006-03-01/ VersioningConfiguration"`
Status string `xml:"Status,omitempty"`
MfaDelete string `xml:"MfaDelete,omitempty"`
}
VersioningConfiguration contains VersioningConfiguration XML representation.
Source Files
¶
- access_block.go
- acl.go
- api.go
- attributes.go
- bucket_list.go
- copy.go
- cors.go
- delete.go
- get.go
- head.go
- info.go
- lifecycle.go
- locking.go
- multipart_upload.go
- not_support.go
- object_list.go
- patch.go
- put.go
- response.go
- restore.go
- s3encoder.go
- s3reader.go
- s3unsignedreader.go
- s3v4aReader.go
- tagging.go
- unimplemented.go
- util.go
- versioning.go
- website.go