github.com/minio/minio@v0.0.0-20240328213742-3f72439b8a27/internal/http/headers.go (about)

     1  // Copyright (c) 2015-2021 MinIO, Inc.
     2  //
     3  // This file is part of MinIO Object Storage stack
     4  //
     5  // This program is free software: you can redistribute it and/or modify
     6  // it under the terms of the GNU Affero General Public License as published by
     7  // the Free Software Foundation, either version 3 of the License, or
     8  // (at your option) any later version.
     9  //
    10  // This program is distributed in the hope that it will be useful
    11  // but WITHOUT ANY WARRANTY; without even the implied warranty of
    12  // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    13  // GNU Affero General Public License for more details.
    14  //
    15  // You should have received a copy of the GNU Affero General Public License
    16  // along with this program.  If not, see <http://www.gnu.org/licenses/>.
    17  
    18  package http
    19  
    20  // Standard S3 HTTP response constants
    21  const (
    22  	LastModified       = "Last-Modified"
    23  	Date               = "Date"
    24  	ETag               = "ETag"
    25  	ContentType        = "Content-Type"
    26  	ContentMD5         = "Content-Md5"
    27  	ContentEncoding    = "Content-Encoding"
    28  	Expires            = "Expires"
    29  	ContentLength      = "Content-Length"
    30  	ContentLanguage    = "Content-Language"
    31  	ContentRange       = "Content-Range"
    32  	Connection         = "Connection"
    33  	AcceptRanges       = "Accept-Ranges"
    34  	AmzBucketRegion    = "X-Amz-Bucket-Region"
    35  	ServerInfo         = "Server"
    36  	RetryAfter         = "Retry-After"
    37  	Location           = "Location"
    38  	CacheControl       = "Cache-Control"
    39  	ContentDisposition = "Content-Disposition"
    40  	Authorization      = "Authorization"
    41  	Action             = "Action"
    42  	Range              = "Range"
    43  )
    44  
    45  // Non standard S3 HTTP response constants
    46  const (
    47  	XCache       = "X-Cache"
    48  	XCacheLookup = "X-Cache-Lookup"
    49  )
    50  
    51  // Standard S3 HTTP request constants
    52  const (
    53  	IfModifiedSince   = "If-Modified-Since"
    54  	IfUnmodifiedSince = "If-Unmodified-Since"
    55  	IfMatch           = "If-Match"
    56  	IfNoneMatch       = "If-None-Match"
    57  
    58  	// Request tags used in GetObjectAttributes
    59  	Checksum     = "Checksum"
    60  	StorageClass = "StorageClass"
    61  	ObjectSize   = "ObjectSize"
    62  	ObjectParts  = "ObjectParts"
    63  
    64  	// S3 storage class
    65  	AmzStorageClass = "x-amz-storage-class"
    66  
    67  	// S3 object version ID
    68  	AmzVersionID    = "x-amz-version-id"
    69  	AmzDeleteMarker = "x-amz-delete-marker"
    70  
    71  	// S3 object tagging
    72  	AmzObjectTagging = "X-Amz-Tagging"
    73  	AmzTagCount      = "x-amz-tagging-count"
    74  	AmzTagDirective  = "X-Amz-Tagging-Directive"
    75  
    76  	// S3 transition restore
    77  	AmzRestore            = "x-amz-restore"
    78  	AmzRestoreExpiryDays  = "X-Amz-Restore-Expiry-Days"
    79  	AmzRestoreRequestDate = "X-Amz-Restore-Request-Date"
    80  	AmzRestoreOutputPath  = "x-amz-restore-output-path"
    81  
    82  	// S3 extensions
    83  	AmzCopySourceIfModifiedSince   = "x-amz-copy-source-if-modified-since"
    84  	AmzCopySourceIfUnmodifiedSince = "x-amz-copy-source-if-unmodified-since"
    85  
    86  	AmzCopySourceIfNoneMatch = "x-amz-copy-source-if-none-match"
    87  	AmzCopySourceIfMatch     = "x-amz-copy-source-if-match"
    88  
    89  	AmzCopySource                 = "X-Amz-Copy-Source"
    90  	AmzCopySourceVersionID        = "X-Amz-Copy-Source-Version-Id"
    91  	AmzCopySourceRange            = "X-Amz-Copy-Source-Range"
    92  	AmzMetadataDirective          = "X-Amz-Metadata-Directive"
    93  	AmzObjectLockMode             = "X-Amz-Object-Lock-Mode"
    94  	AmzObjectLockRetainUntilDate  = "X-Amz-Object-Lock-Retain-Until-Date"
    95  	AmzObjectLockLegalHold        = "X-Amz-Object-Lock-Legal-Hold"
    96  	AmzObjectLockBypassGovernance = "X-Amz-Bypass-Governance-Retention"
    97  	AmzBucketReplicationStatus    = "X-Amz-Replication-Status"
    98  
    99  	// AmzSnowballExtract will trigger unpacking of an archive content
   100  	AmzSnowballExtract = "X-Amz-Meta-Snowball-Auto-Extract"
   101  	// MinIOSnowballIgnoreDirs will skip creating empty directory objects.
   102  	MinIOSnowballIgnoreDirs = "X-Amz-Meta-Minio-Snowball-Ignore-Dirs"
   103  	// MinIOSnowballIgnoreErrors will ignore recoverable errors, typically single files failing to upload.
   104  	// An error will be printed to console instead.
   105  	MinIOSnowballIgnoreErrors = "X-Amz-Meta-Minio-Snowball-Ignore-Errors"
   106  	// MinIOSnowballPrefix will apply this prefix (plus / at end) to all extracted objects
   107  	MinIOSnowballPrefix = "X-Amz-Meta-Minio-Snowball-Prefix"
   108  
   109  	// Object lock enabled
   110  	AmzObjectLockEnabled = "x-amz-bucket-object-lock-enabled"
   111  
   112  	// Multipart parts count
   113  	AmzMpPartsCount = "x-amz-mp-parts-count"
   114  
   115  	// Object date/time of expiration
   116  	AmzExpiration = "x-amz-expiration"
   117  
   118  	// Dummy putBucketACL
   119  	AmzACL = "x-amz-acl"
   120  
   121  	// Signature V4 related constants.
   122  	AmzContentSha256        = "X-Amz-Content-Sha256"
   123  	AmzDate                 = "X-Amz-Date"
   124  	AmzAlgorithm            = "X-Amz-Algorithm"
   125  	AmzExpires              = "X-Amz-Expires"
   126  	AmzSignedHeaders        = "X-Amz-SignedHeaders"
   127  	AmzSignature            = "X-Amz-Signature"
   128  	AmzCredential           = "X-Amz-Credential"
   129  	AmzSecurityToken        = "X-Amz-Security-Token"
   130  	AmzDecodedContentLength = "X-Amz-Decoded-Content-Length"
   131  	AmzTrailer              = "X-Amz-Trailer"
   132  	AmzMaxParts             = "X-Amz-Max-Parts"
   133  	AmzPartNumberMarker     = "X-Amz-Part-Number-Marker"
   134  
   135  	// Constants used for GetObjectAttributes and GetObjectVersionAttributes
   136  	AmzObjectAttributes = "X-Amz-Object-Attributes"
   137  
   138  	AmzMetaUnencryptedContentLength = "X-Amz-Meta-X-Amz-Unencrypted-Content-Length"
   139  	AmzMetaUnencryptedContentMD5    = "X-Amz-Meta-X-Amz-Unencrypted-Content-Md5"
   140  
   141  	// AWS server-side encryption headers for SSE-S3, SSE-KMS and SSE-C.
   142  	AmzServerSideEncryption                      = "X-Amz-Server-Side-Encryption"
   143  	AmzServerSideEncryptionKmsID                 = AmzServerSideEncryption + "-Aws-Kms-Key-Id"
   144  	AmzServerSideEncryptionKmsContext            = AmzServerSideEncryption + "-Context"
   145  	AmzServerSideEncryptionCustomerAlgorithm     = AmzServerSideEncryption + "-Customer-Algorithm"
   146  	AmzServerSideEncryptionCustomerKey           = AmzServerSideEncryption + "-Customer-Key"
   147  	AmzServerSideEncryptionCustomerKeyMD5        = AmzServerSideEncryption + "-Customer-Key-Md5"
   148  	AmzServerSideEncryptionCopyCustomerAlgorithm = "X-Amz-Copy-Source-Server-Side-Encryption-Customer-Algorithm"
   149  	AmzServerSideEncryptionCopyCustomerKey       = "X-Amz-Copy-Source-Server-Side-Encryption-Customer-Key"
   150  	AmzServerSideEncryptionCopyCustomerKeyMD5    = "X-Amz-Copy-Source-Server-Side-Encryption-Customer-Key-Md5"
   151  
   152  	AmzEncryptionAES = "AES256"
   153  	AmzEncryptionKMS = "aws:kms"
   154  
   155  	// Signature v2 related constants
   156  	AmzSignatureV2 = "Signature"
   157  	AmzAccessKeyID = "AWSAccessKeyId"
   158  
   159  	// Response request id.
   160  	AmzRequestID     = "x-amz-request-id"
   161  	AmzRequestHostID = "x-amz-id-2"
   162  
   163  	// Deployment id.
   164  	MinioDeploymentID = "x-minio-deployment-id"
   165  
   166  	// Peer call
   167  	MinIOPeerCall = "x-minio-from-peer"
   168  
   169  	// Server-Status
   170  	MinIOServerStatus = "x-minio-server-status"
   171  
   172  	// Content Checksums
   173  	AmzChecksumAlgo   = "x-amz-checksum-algorithm"
   174  	AmzChecksumCRC32  = "x-amz-checksum-crc32"
   175  	AmzChecksumCRC32C = "x-amz-checksum-crc32c"
   176  	AmzChecksumSHA1   = "x-amz-checksum-sha1"
   177  	AmzChecksumSHA256 = "x-amz-checksum-sha256"
   178  	AmzChecksumMode   = "x-amz-checksum-mode"
   179  
   180  	// Delete special flag to force delete a bucket or a prefix
   181  	MinIOForceDelete = "x-minio-force-delete"
   182  
   183  	// Create special flag to force create a bucket
   184  	MinIOForceCreate = "x-minio-force-create"
   185  
   186  	// Header indicates if the mtime should be preserved by client
   187  	MinIOSourceMTime = "x-minio-source-mtime"
   188  
   189  	// Header indicates if the etag should be preserved by client
   190  	MinIOSourceETag = "x-minio-source-etag"
   191  
   192  	// Writes expected write quorum
   193  	MinIOWriteQuorum = "x-minio-write-quorum"
   194  
   195  	// Reads expected read quorum
   196  	MinIOReadQuorum = "x-minio-read-quorum"
   197  
   198  	// Indicates if we are using default storage class and there was problem loading config
   199  	// if this header is set to "true"
   200  	MinIOStorageClassDefaults = "x-minio-storage-class-defaults"
   201  
   202  	// Reports number of drives currently healing
   203  	MinIOHealingDrives = "x-minio-healing-drives"
   204  
   205  	// Header indicates if the delete marker should be preserved by client
   206  	MinIOSourceDeleteMarker = "x-minio-source-deletemarker"
   207  
   208  	// Header indicates if the delete marker version needs to be purged.
   209  	MinIOSourceDeleteMarkerDelete = "x-minio-source-deletemarker-delete"
   210  
   211  	// Header indicates permanent delete replication status.
   212  	MinIODeleteReplicationStatus = "X-Minio-Replication-Delete-Status"
   213  	// Header indicates delete-marker replication status.
   214  	MinIODeleteMarkerReplicationStatus = "X-Minio-Replication-DeleteMarker-Status"
   215  	// Header indicates if its a GET/HEAD proxy request for active-active replication
   216  	MinIOSourceProxyRequest = "X-Minio-Source-Proxy-Request"
   217  	// Header indicates that this request is a replication request to create a REPLICA
   218  	MinIOSourceReplicationRequest = "X-Minio-Source-Replication-Request"
   219  	// Header checks replication permissions without actually completing replication
   220  	MinIOSourceReplicationCheck = "X-Minio-Source-Replication-Check"
   221  	// Header indicates replication reset status.
   222  	MinIOReplicationResetStatus = "X-Minio-Replication-Reset-Status"
   223  	// Header indicating target cluster can receive delete marker replication requests because object has been replicated
   224  	MinIOTargetReplicationReady = "X-Minio-Replication-Ready"
   225  	// Header asking if cluster can receive delete marker replication request now.
   226  	MinIOCheckDMReplicationReady = "X-Minio-Check-Replication-Ready"
   227  	// Header indiicates last tag update time on source
   228  	MinIOSourceTaggingTimestamp = "X-Minio-Source-Replication-Tagging-Timestamp"
   229  	// Header indiicates last rtention update time on source
   230  	MinIOSourceObjectRetentionTimestamp = "X-Minio-Source-Replication-Retention-Timestamp"
   231  	// Header indiicates last rtention update time on source
   232  	MinIOSourceObjectLegalHoldTimestamp = "X-Minio-Source-Replication-LegalHold-Timestamp"
   233  	// Header indicates a Tag operation was performed on one/more peers successfully, though the
   234  	// current cluster does not have the object yet. This is in a site/bucket replication scenario.
   235  	MinIOTaggingProxied = "X-Minio-Tagging-Proxied"
   236  	// Header indicates the actual replicated object size
   237  	// In case of SSEC objects getting replicated (multipart) actual size would be needed at target
   238  	MinIOReplicationActualObjectSize = "X-Minio-Replication-Actual-Object-Size"
   239  
   240  	// predicted date/time of transition
   241  	MinIOTransition            = "X-Minio-Transition"
   242  	MinIOLifecycleCfgUpdatedAt = "X-Minio-LifecycleConfig-UpdatedAt"
   243  	// MinIOCompressed is returned when object is compressed
   244  	MinIOCompressed = "X-Minio-Compressed"
   245  
   246  	// SUBNET related
   247  	SubnetAPIKey = "x-subnet-api-key"
   248  )
   249  
   250  // Common http query params S3 API
   251  const (
   252  	VersionID = "versionId"
   253  
   254  	PartNumber = "partNumber"
   255  
   256  	UploadID = "uploadId"
   257  )
   258  
   259  // http headers sent to webhook targets
   260  const (
   261  	// Reports the version of MinIO server
   262  	MinIOVersion = "x-minio-version"
   263  )