| 
									
										
										
										
											2021-04-19 03:41:13 +08:00
										 |  |  | // Copyright (c) 2015-2021 MinIO, Inc.
 | 
					
						
							|  |  |  | //
 | 
					
						
							|  |  |  | // This file is part of MinIO Object Storage stack
 | 
					
						
							|  |  |  | //
 | 
					
						
							|  |  |  | // This program is free software: you can redistribute it and/or modify
 | 
					
						
							|  |  |  | // it under the terms of the GNU Affero General Public License as published by
 | 
					
						
							|  |  |  | // the Free Software Foundation, either version 3 of the License, or
 | 
					
						
							|  |  |  | // (at your option) any later version.
 | 
					
						
							|  |  |  | //
 | 
					
						
							|  |  |  | // This program is distributed in the hope that it will be useful
 | 
					
						
							|  |  |  | // but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
					
						
							|  |  |  | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 | 
					
						
							|  |  |  | // GNU Affero General Public License for more details.
 | 
					
						
							|  |  |  | //
 | 
					
						
							|  |  |  | // You should have received a copy of the GNU Affero General Public License
 | 
					
						
							|  |  |  | // along with this program.  If not, see <http://www.gnu.org/licenses/>.
 | 
					
						
							| 
									
										
										
										
											2019-07-03 13:34:32 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | package http | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | // Standard S3 HTTP response constants
 | 
					
						
							|  |  |  | const ( | 
					
						
							|  |  |  | 	LastModified       = "Last-Modified" | 
					
						
							|  |  |  | 	Date               = "Date" | 
					
						
							|  |  |  | 	ETag               = "ETag" | 
					
						
							|  |  |  | 	ContentType        = "Content-Type" | 
					
						
							|  |  |  | 	ContentMD5         = "Content-Md5" | 
					
						
							|  |  |  | 	ContentEncoding    = "Content-Encoding" | 
					
						
							|  |  |  | 	Expires            = "Expires" | 
					
						
							|  |  |  | 	ContentLength      = "Content-Length" | 
					
						
							|  |  |  | 	ContentLanguage    = "Content-Language" | 
					
						
							|  |  |  | 	ContentRange       = "Content-Range" | 
					
						
							|  |  |  | 	Connection         = "Connection" | 
					
						
							|  |  |  | 	AcceptRanges       = "Accept-Ranges" | 
					
						
							|  |  |  | 	AmzBucketRegion    = "X-Amz-Bucket-Region" | 
					
						
							|  |  |  | 	ServerInfo         = "Server" | 
					
						
							|  |  |  | 	RetryAfter         = "Retry-After" | 
					
						
							|  |  |  | 	Location           = "Location" | 
					
						
							|  |  |  | 	CacheControl       = "Cache-Control" | 
					
						
							|  |  |  | 	ContentDisposition = "Content-Disposition" | 
					
						
							|  |  |  | 	Authorization      = "Authorization" | 
					
						
							|  |  |  | 	Action             = "Action" | 
					
						
							| 
									
										
										
										
											2020-07-09 08:36:56 +08:00
										 |  |  | 	Range              = "Range" | 
					
						
							| 
									
										
										
										
											2019-07-03 13:34:32 +08:00
										 |  |  | ) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-01-11 12:21:13 +08:00
										 |  |  | // Non standard S3 HTTP response constants
 | 
					
						
							|  |  |  | const ( | 
					
						
							|  |  |  | 	XCache       = "X-Cache" | 
					
						
							|  |  |  | 	XCacheLookup = "X-Cache-Lookup" | 
					
						
							|  |  |  | ) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-07-03 13:34:32 +08:00
										 |  |  | // Standard S3 HTTP request constants
 | 
					
						
							|  |  |  | const ( | 
					
						
							|  |  |  | 	IfModifiedSince   = "If-Modified-Since" | 
					
						
							|  |  |  | 	IfUnmodifiedSince = "If-Unmodified-Since" | 
					
						
							|  |  |  | 	IfMatch           = "If-Match" | 
					
						
							|  |  |  | 	IfNoneMatch       = "If-None-Match" | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-10-07 13:50:24 +08:00
										 |  |  | 	// S3 storage class
 | 
					
						
							|  |  |  | 	AmzStorageClass = "x-amz-storage-class" | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-13 11:04:01 +08:00
										 |  |  | 	// S3 object version ID
 | 
					
						
							|  |  |  | 	AmzVersionID    = "x-amz-version-id" | 
					
						
							|  |  |  | 	AmzDeleteMarker = "x-amz-delete-marker" | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-01-21 00:45:59 +08:00
										 |  |  | 	// S3 object tagging
 | 
					
						
							|  |  |  | 	AmzObjectTagging = "X-Amz-Tagging" | 
					
						
							| 
									
										
										
										
											2020-05-26 07:51:32 +08:00
										 |  |  | 	AmzTagCount      = "x-amz-tagging-count" | 
					
						
							| 
									
										
										
										
											2020-01-21 00:45:59 +08:00
										 |  |  | 	AmzTagDirective  = "X-Amz-Tagging-Directive" | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-11-13 04:12:09 +08:00
										 |  |  | 	// S3 transition restore
 | 
					
						
							|  |  |  | 	AmzRestore            = "x-amz-restore" | 
					
						
							|  |  |  | 	AmzRestoreExpiryDays  = "X-Amz-Restore-Expiry-Days" | 
					
						
							|  |  |  | 	AmzRestoreRequestDate = "X-Amz-Restore-Request-Date" | 
					
						
							|  |  |  | 	AmzRestoreOutputPath  = "x-amz-restore-output-path" | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-07-03 13:34:32 +08:00
										 |  |  | 	// S3 extensions
 | 
					
						
							|  |  |  | 	AmzCopySourceIfModifiedSince   = "x-amz-copy-source-if-modified-since" | 
					
						
							|  |  |  | 	AmzCopySourceIfUnmodifiedSince = "x-amz-copy-source-if-unmodified-since" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	AmzCopySourceIfNoneMatch = "x-amz-copy-source-if-none-match" | 
					
						
							|  |  |  | 	AmzCopySourceIfMatch     = "x-amz-copy-source-if-match" | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-11-21 05:18:09 +08:00
										 |  |  | 	AmzCopySource                 = "X-Amz-Copy-Source" | 
					
						
							|  |  |  | 	AmzCopySourceVersionID        = "X-Amz-Copy-Source-Version-Id" | 
					
						
							|  |  |  | 	AmzCopySourceRange            = "X-Amz-Copy-Source-Range" | 
					
						
							|  |  |  | 	AmzMetadataDirective          = "X-Amz-Metadata-Directive" | 
					
						
							|  |  |  | 	AmzObjectLockMode             = "X-Amz-Object-Lock-Mode" | 
					
						
							|  |  |  | 	AmzObjectLockRetainUntilDate  = "X-Amz-Object-Lock-Retain-Until-Date" | 
					
						
							|  |  |  | 	AmzObjectLockLegalHold        = "X-Amz-Object-Lock-Legal-Hold" | 
					
						
							|  |  |  | 	AmzObjectLockBypassGovernance = "X-Amz-Bypass-Governance-Retention" | 
					
						
							| 
									
										
										
										
											2020-07-22 08:49:56 +08:00
										 |  |  | 	AmzBucketReplicationStatus    = "X-Amz-Replication-Status" | 
					
						
							| 
									
										
										
										
											2021-03-27 08:15:09 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-06-13 00:42:06 +08:00
										 |  |  | 	// AmzSnowballExtract will trigger unpacking of an archive content
 | 
					
						
							|  |  |  | 	AmzSnowballExtract = "X-Amz-Meta-Snowball-Auto-Extract" | 
					
						
							| 
									
										
										
										
											2022-10-19 04:50:21 +08:00
										 |  |  | 	// MinIOSnowballIgnoreDirs will skip creating empty directory objects.
 | 
					
						
							|  |  |  | 	MinIOSnowballIgnoreDirs = "X-Amz-Meta-Minio-Snowball-Ignore-Dirs" | 
					
						
							|  |  |  | 	// MinIOSnowballIgnoreErrors will ignore recoverable errors, typically single files failing to upload.
 | 
					
						
							|  |  |  | 	// An error will be printed to console instead.
 | 
					
						
							|  |  |  | 	MinIOSnowballIgnoreErrors = "X-Amz-Meta-Minio-Snowball-Ignore-Errors" | 
					
						
							|  |  |  | 	// MinIOSnowballPrefix will apply this prefix (plus / at end) to all extracted objects
 | 
					
						
							|  |  |  | 	MinIOSnowballPrefix = "X-Amz-Meta-Minio-Snowball-Prefix" | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-04-27 19:44:07 +08:00
										 |  |  | 	// Object lock enabled
 | 
					
						
							|  |  |  | 	AmzObjectLockEnabled = "x-amz-bucket-object-lock-enabled" | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-03-13 03:37:27 +08:00
										 |  |  | 	// Multipart parts count
 | 
					
						
							|  |  |  | 	AmzMpPartsCount = "x-amz-mp-parts-count" | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-05-22 05:12:52 +08:00
										 |  |  | 	// Object date/time of expiration
 | 
					
						
							|  |  |  | 	AmzExpiration = "x-amz-expiration" | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-02-16 14:07:52 +08:00
										 |  |  | 	// Dummy putBucketACL
 | 
					
						
							|  |  |  | 	AmzACL = "x-amz-acl" | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-07-03 13:34:32 +08:00
										 |  |  | 	// Signature V4 related contants.
 | 
					
						
							|  |  |  | 	AmzContentSha256        = "X-Amz-Content-Sha256" | 
					
						
							|  |  |  | 	AmzDate                 = "X-Amz-Date" | 
					
						
							|  |  |  | 	AmzAlgorithm            = "X-Amz-Algorithm" | 
					
						
							|  |  |  | 	AmzExpires              = "X-Amz-Expires" | 
					
						
							|  |  |  | 	AmzSignedHeaders        = "X-Amz-SignedHeaders" | 
					
						
							|  |  |  | 	AmzSignature            = "X-Amz-Signature" | 
					
						
							|  |  |  | 	AmzCredential           = "X-Amz-Credential" | 
					
						
							|  |  |  | 	AmzSecurityToken        = "X-Amz-Security-Token" | 
					
						
							|  |  |  | 	AmzDecodedContentLength = "X-Amz-Decoded-Content-Length" | 
					
						
							| 
									
										
										
										
											2022-08-30 07:57:16 +08:00
										 |  |  | 	AmzTrailer              = "X-Amz-Trailer" | 
					
						
							| 
									
										
										
										
											2019-07-03 13:34:32 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-08-11 23:29:29 +08:00
										 |  |  | 	AmzMetaUnencryptedContentLength = "X-Amz-Meta-X-Amz-Unencrypted-Content-Length" | 
					
						
							|  |  |  | 	AmzMetaUnencryptedContentMD5    = "X-Amz-Meta-X-Amz-Unencrypted-Content-Md5" | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-12-23 01:19:32 +08:00
										 |  |  | 	// AWS server-side encryption headers for SSE-S3, SSE-KMS and SSE-C.
 | 
					
						
							|  |  |  | 	AmzServerSideEncryption                      = "X-Amz-Server-Side-Encryption" | 
					
						
							|  |  |  | 	AmzServerSideEncryptionKmsID                 = AmzServerSideEncryption + "-Aws-Kms-Key-Id" | 
					
						
							|  |  |  | 	AmzServerSideEncryptionKmsContext            = AmzServerSideEncryption + "-Context" | 
					
						
							|  |  |  | 	AmzServerSideEncryptionCustomerAlgorithm     = AmzServerSideEncryption + "-Customer-Algorithm" | 
					
						
							|  |  |  | 	AmzServerSideEncryptionCustomerKey           = AmzServerSideEncryption + "-Customer-Key" | 
					
						
							|  |  |  | 	AmzServerSideEncryptionCustomerKeyMD5        = AmzServerSideEncryption + "-Customer-Key-Md5" | 
					
						
							|  |  |  | 	AmzServerSideEncryptionCopyCustomerAlgorithm = "X-Amz-Copy-Source-Server-Side-Encryption-Customer-Algorithm" | 
					
						
							|  |  |  | 	AmzServerSideEncryptionCopyCustomerKey       = "X-Amz-Copy-Source-Server-Side-Encryption-Customer-Key" | 
					
						
							|  |  |  | 	AmzServerSideEncryptionCopyCustomerKeyMD5    = "X-Amz-Copy-Source-Server-Side-Encryption-Customer-Key-Md5" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	AmzEncryptionAES = "AES256" | 
					
						
							|  |  |  | 	AmzEncryptionKMS = "aws:kms" | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-07-03 13:34:32 +08:00
										 |  |  | 	// Signature v2 related constants
 | 
					
						
							|  |  |  | 	AmzSignatureV2 = "Signature" | 
					
						
							|  |  |  | 	AmzAccessKeyID = "AWSAccessKeyId" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// Response request id.
 | 
					
						
							| 
									
										
										
										
											2023-01-26 01:14:10 +08:00
										 |  |  | 	AmzRequestID     = "x-amz-request-id" | 
					
						
							| 
									
										
										
										
											2023-02-22 18:11:09 +08:00
										 |  |  | 	AmzRequestHostID = "x-amz-id-2" | 
					
						
							| 
									
										
										
										
											2019-07-03 13:34:32 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	// Deployment id.
 | 
					
						
							|  |  |  | 	MinioDeploymentID = "x-minio-deployment-id" | 
					
						
							| 
									
										
										
										
											2019-09-05 17:20:56 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	// Server-Status
 | 
					
						
							|  |  |  | 	MinIOServerStatus = "x-minio-server-status" | 
					
						
							| 
									
										
										
										
											2020-04-07 08:51:05 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-08-30 07:57:16 +08:00
										 |  |  | 	// Content Checksums
 | 
					
						
							|  |  |  | 	AmzChecksumAlgo   = "x-amz-checksum-algorithm" | 
					
						
							|  |  |  | 	AmzChecksumCRC32  = "x-amz-checksum-crc32" | 
					
						
							|  |  |  | 	AmzChecksumCRC32C = "x-amz-checksum-crc32c" | 
					
						
							|  |  |  | 	AmzChecksumSHA1   = "x-amz-checksum-sha1" | 
					
						
							|  |  |  | 	AmzChecksumSHA256 = "x-amz-checksum-sha256" | 
					
						
							|  |  |  | 	AmzChecksumMode   = "x-amz-checksum-mode" | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-06-16 09:43:14 +08:00
										 |  |  | 	// Delete special flag to force delete a bucket or a prefix
 | 
					
						
							| 
									
										
										
										
											2020-04-07 08:51:05 +08:00
										 |  |  | 	MinIOForceDelete = "x-minio-force-delete" | 
					
						
							| 
									
										
										
										
											2020-07-09 08:36:56 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-04-27 19:44:07 +08:00
										 |  |  | 	// Create special flag to force create a bucket
 | 
					
						
							|  |  |  | 	MinIOForceCreate = "x-minio-force-create" | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-07-09 08:36:56 +08:00
										 |  |  | 	// Header indicates if the mtime should be preserved by client
 | 
					
						
							|  |  |  | 	MinIOSourceMTime = "x-minio-source-mtime" | 
					
						
							| 
									
										
										
										
											2020-08-13 08:32:24 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	// Header indicates if the etag should be preserved by client
 | 
					
						
							|  |  |  | 	MinIOSourceETag = "x-minio-source-etag" | 
					
						
							| 
									
										
										
										
											2020-10-31 03:20:28 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	// Writes expected write quorum
 | 
					
						
							|  |  |  | 	MinIOWriteQuorum = "x-minio-write-quorum" | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-05-05 05:44:30 +08:00
										 |  |  | 	// Indicates if we are using default storage class and there was problem loading config
 | 
					
						
							|  |  |  | 	// if this header is set to "true"
 | 
					
						
							|  |  |  | 	MinIOStorageClassDefaults = "x-minio-storage-class-defaults" | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-10-31 03:20:28 +08:00
										 |  |  | 	// Reports number of drives currently healing
 | 
					
						
							|  |  |  | 	MinIOHealingDrives = "x-minio-healing-drives" | 
					
						
							| 
									
										
										
										
											2020-11-20 10:43:58 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	// Header indicates if the delete marker should be preserved by client
 | 
					
						
							|  |  |  | 	MinIOSourceDeleteMarker = "x-minio-source-deletemarker" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// Header indicates if the delete marker version needs to be purged.
 | 
					
						
							|  |  |  | 	MinIOSourceDeleteMarkerDelete = "x-minio-source-deletemarker-delete" | 
					
						
							| 
									
										
										
										
											2020-11-22 15:48:50 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	// Header indicates permanent delete replication status.
 | 
					
						
							|  |  |  | 	MinIODeleteReplicationStatus = "X-Minio-Replication-Delete-Status" | 
					
						
							|  |  |  | 	// Header indicates delete-marker replication status.
 | 
					
						
							|  |  |  | 	MinIODeleteMarkerReplicationStatus = "X-Minio-Replication-DeleteMarker-Status" | 
					
						
							| 
									
										
										
										
											2021-01-12 14:36:51 +08:00
										 |  |  | 	// Header indicates if its a GET/HEAD proxy request for active-active replication
 | 
					
						
							| 
									
										
										
										
											2021-01-28 03:22:34 +08:00
										 |  |  | 	MinIOSourceProxyRequest = "X-Minio-Source-Proxy-Request" | 
					
						
							| 
									
										
										
										
											2021-03-04 03:13:31 +08:00
										 |  |  | 	// Header indicates that this request is a replication request to create a REPLICA
 | 
					
						
							|  |  |  | 	MinIOSourceReplicationRequest = "X-Minio-Source-Replication-Request" | 
					
						
							| 
									
										
										
										
											2023-07-11 11:09:20 +08:00
										 |  |  | 	// Header checks replication permissions without actually completing replication
 | 
					
						
							|  |  |  | 	MinIOSourceReplicationCheck = "X-Minio-Source-Replication-Check" | 
					
						
							| 
									
										
										
										
											2021-06-02 10:59:11 +08:00
										 |  |  | 	// Header indicates replication reset status.
 | 
					
						
							|  |  |  | 	MinIOReplicationResetStatus = "X-Minio-Replication-Reset-Status" | 
					
						
							| 
									
										
										
										
											2022-10-14 07:43:36 +08:00
										 |  |  | 	// Header indicating target cluster can receive delete marker replication requests because object has been replicated
 | 
					
						
							|  |  |  | 	MinIOTargetReplicationReady = "X-Minio-Replication-Ready" | 
					
						
							| 
									
										
										
										
											2022-10-22 05:45:06 +08:00
										 |  |  | 	// Header asking if cluster can receive delete marker replication request now.
 | 
					
						
							|  |  |  | 	MinIOCheckDMReplicationReady = "X-Minio-Check-Replication-Ready" | 
					
						
							| 
									
										
										
										
											2021-09-19 04:31:35 +08:00
										 |  |  | 	// Header indiicates last tag update time on source
 | 
					
						
							|  |  |  | 	MinIOSourceTaggingTimestamp = "X-Minio-Source-Replication-Tagging-Timestamp" | 
					
						
							|  |  |  | 	// Header indiicates last rtention update time on source
 | 
					
						
							|  |  |  | 	MinIOSourceObjectRetentionTimestamp = "X-Minio-Source-Replication-Retention-Timestamp" | 
					
						
							|  |  |  | 	// Header indiicates last rtention update time on source
 | 
					
						
							|  |  |  | 	MinIOSourceObjectLegalHoldTimestamp = "X-Minio-Source-Replication-LegalHold-Timestamp" | 
					
						
							| 
									
										
										
										
											2021-04-20 01:30:42 +08:00
										 |  |  | 	// predicted date/time of transition
 | 
					
						
							| 
									
										
										
										
											2023-05-25 13:52:39 +08:00
										 |  |  | 	MinIOTransition            = "X-Minio-Transition" | 
					
						
							|  |  |  | 	MinIOLifecycleCfgUpdatedAt = "X-Minio-LifecycleConfig-UpdatedAt" | 
					
						
							| 
									
										
										
										
											2022-07-24 22:15:49 +08:00
										 |  |  | 	// MinIOCompressed is returned when object is compressed
 | 
					
						
							|  |  |  | 	MinIOCompressed = "X-Minio-Compressed" | 
					
						
							| 
									
										
										
										
											2022-11-16 05:53:05 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	// SUBNET related
 | 
					
						
							|  |  |  | 	SubnetAPIKey = "x-subnet-api-key" | 
					
						
							| 
									
										
										
										
											2020-07-09 08:36:56 +08:00
										 |  |  | ) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | // Common http query params S3 API
 | 
					
						
							|  |  |  | const ( | 
					
						
							|  |  |  | 	VersionID = "versionId" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	PartNumber = "partNumber" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	UploadID = "uploadId" | 
					
						
							| 
									
										
										
										
											2019-07-03 13:34:32 +08:00
										 |  |  | ) | 
					
						
							| 
									
										
										
										
											2022-02-24 05:36:01 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | // http headers sent to webhook targets
 | 
					
						
							|  |  |  | const ( | 
					
						
							|  |  |  | 	// Reports the version of MinIO server
 | 
					
						
							|  |  |  | 	MinIOVersion = "x-minio-version" | 
					
						
							|  |  |  | ) |