mirror of
https://github.com/minio/minio.git
synced 2025-11-07 04:42:56 -05:00
Support bucket versioning (#9377)
- Implement a new xl.json 2.0.0 format to support, this moves the entire marshaling logic to POSIX layer, top layer always consumes a common FileInfo construct which simplifies the metadata reads. - Implement list object versions - Migrate to siphash from crchash for new deployments for object placements. Fixes #2111
This commit is contained in:
@@ -125,23 +125,48 @@ const (
|
||||
PutBucketEncryptionAction = "s3:PutEncryptionConfiguration"
|
||||
// GetBucketEncryptionAction - GetBucketEncryption REST API action
|
||||
GetBucketEncryptionAction = "s3:GetEncryptionConfiguration"
|
||||
|
||||
// PutBucketVersioningAction - PutBucketVersioning REST API action
|
||||
PutBucketVersioningAction = "s3:PutBucketVersioning"
|
||||
// GetBucketVersioningAction - GetBucketVersioning REST API action
|
||||
GetBucketVersioningAction = "s3:GetBucketVersioning"
|
||||
|
||||
// DeleteObjectVersionAction - DeleteObjectVersion Rest API action.
|
||||
DeleteObjectVersionAction = "s3:DeleteObjectVersion"
|
||||
|
||||
// DeleteObjectVersionTaggingAction - DeleteObjectVersionTagging Rest API action.
|
||||
DeleteObjectVersionTaggingAction = "s3:DeleteObjectVersionTagging"
|
||||
|
||||
// GetObjectVersionAction - GetObjectVersionAction Rest API action.
|
||||
GetObjectVersionAction = "s3:GetObjectVersion"
|
||||
|
||||
// GetObjectVersionTaggingAction - GetObjectVersionTagging Rest API action.
|
||||
GetObjectVersionTaggingAction = "s3:GetObjectVersionTagging"
|
||||
|
||||
// PutObjectVersionTaggingAction - PutObjectVersionTagging Rest API action.
|
||||
PutObjectVersionTaggingAction = "s3:PutObjectVersionTagging"
|
||||
)
|
||||
|
||||
// List of all supported object actions.
|
||||
var supportedObjectActions = map[Action]struct{}{
|
||||
AbortMultipartUploadAction: {},
|
||||
DeleteObjectAction: {},
|
||||
GetObjectAction: {},
|
||||
ListMultipartUploadPartsAction: {},
|
||||
PutObjectAction: {},
|
||||
BypassGovernanceRetentionAction: {},
|
||||
PutObjectRetentionAction: {},
|
||||
GetObjectRetentionAction: {},
|
||||
PutObjectLegalHoldAction: {},
|
||||
GetObjectLegalHoldAction: {},
|
||||
GetObjectTaggingAction: {},
|
||||
PutObjectTaggingAction: {},
|
||||
DeleteObjectTaggingAction: {},
|
||||
AbortMultipartUploadAction: {},
|
||||
DeleteObjectAction: {},
|
||||
GetObjectAction: {},
|
||||
ListMultipartUploadPartsAction: {},
|
||||
PutObjectAction: {},
|
||||
BypassGovernanceRetentionAction: {},
|
||||
PutObjectRetentionAction: {},
|
||||
GetObjectRetentionAction: {},
|
||||
PutObjectLegalHoldAction: {},
|
||||
GetObjectLegalHoldAction: {},
|
||||
GetObjectTaggingAction: {},
|
||||
PutObjectTaggingAction: {},
|
||||
DeleteObjectTaggingAction: {},
|
||||
GetObjectVersionAction: {},
|
||||
GetObjectVersionTaggingAction: {},
|
||||
DeleteObjectVersionAction: {},
|
||||
DeleteObjectVersionTaggingAction: {},
|
||||
PutObjectVersionTaggingAction: {},
|
||||
}
|
||||
|
||||
// isObjectAction - returns whether action is object type or not.
|
||||
@@ -181,12 +206,19 @@ var supportedActions = map[Action]struct{}{
|
||||
GetBucketObjectLockConfigurationAction: {},
|
||||
PutBucketTaggingAction: {},
|
||||
GetBucketTaggingAction: {},
|
||||
GetObjectVersionAction: {},
|
||||
GetObjectVersionTaggingAction: {},
|
||||
DeleteObjectVersionAction: {},
|
||||
DeleteObjectVersionTaggingAction: {},
|
||||
PutObjectVersionTaggingAction: {},
|
||||
BypassGovernanceRetentionAction: {},
|
||||
GetObjectTaggingAction: {},
|
||||
PutObjectTaggingAction: {},
|
||||
DeleteObjectTaggingAction: {},
|
||||
PutBucketEncryptionAction: {},
|
||||
GetBucketEncryptionAction: {},
|
||||
PutBucketVersioningAction: {},
|
||||
GetBucketVersioningAction: {},
|
||||
}
|
||||
|
||||
// IsValid - checks if action is valid or not.
|
||||
@@ -246,7 +278,6 @@ var actionConditionKeyMap = map[Action]condition.KeySet{
|
||||
append([]condition.Key{
|
||||
condition.S3XAmzServerSideEncryption,
|
||||
condition.S3XAmzServerSideEncryptionCustomerAlgorithm,
|
||||
condition.S3XAmzStorageClass,
|
||||
}, condition.CommonKeys...)...),
|
||||
|
||||
HeadBucketAction: condition.NewKeySet(condition.CommonKeys...),
|
||||
@@ -308,4 +339,22 @@ var actionConditionKeyMap = map[Action]condition.KeySet{
|
||||
PutObjectTaggingAction: condition.NewKeySet(condition.CommonKeys...),
|
||||
GetObjectTaggingAction: condition.NewKeySet(condition.CommonKeys...),
|
||||
DeleteObjectTaggingAction: condition.NewKeySet(condition.CommonKeys...),
|
||||
|
||||
PutObjectVersionTaggingAction: condition.NewKeySet(condition.CommonKeys...),
|
||||
GetObjectVersionAction: condition.NewKeySet(
|
||||
append([]condition.Key{
|
||||
condition.S3VersionID,
|
||||
}, condition.CommonKeys...)...),
|
||||
GetObjectVersionTaggingAction: condition.NewKeySet(
|
||||
append([]condition.Key{
|
||||
condition.S3VersionID,
|
||||
}, condition.CommonKeys...)...),
|
||||
DeleteObjectVersionAction: condition.NewKeySet(
|
||||
append([]condition.Key{
|
||||
condition.S3VersionID,
|
||||
}, condition.CommonKeys...)...),
|
||||
DeleteObjectVersionTaggingAction: condition.NewKeySet(
|
||||
append([]condition.Key{
|
||||
condition.S3VersionID,
|
||||
}, condition.CommonKeys...)...),
|
||||
}
|
||||
|
||||
@@ -59,6 +59,10 @@ const (
|
||||
// S3Delimiter - key representing delimiter query parameter of ListBucket API only.
|
||||
S3Delimiter Key = "s3:delimiter"
|
||||
|
||||
// S3VersionID - Enables you to limit the permission for the
|
||||
// s3:PutObjectVersionTagging action to a specific object version.
|
||||
S3VersionID Key = "s3:versionid"
|
||||
|
||||
// S3MaxKeys - key representing max-keys query parameter of ListBucket API only.
|
||||
S3MaxKeys Key = "s3:max-keys"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user