api

package
v0.0.0-...-79da9bc Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 12, 2026 License: Apache-2.0 Imports: 56 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ACLFromRequest

func ACLFromRequest(req *http.Request, ownerID string) (*s3types.AccessControlList, *s3err.ErrorCode)

ACLFromRequest builds an ACL from request headers. It checks x-amz-acl (canned ACL) and x-amz-grant-* headers. Returns nil if no ACL headers are present.

func RegisterUsageService

func RegisterUsageService(server *grpc.Server, cfg UsageServiceConfig)

RegisterUsageService registers the usage reporting gRPC service. The implementation differs between enterprise (full functionality) and community (returns Unimplemented errors) editions.

func ValidateACLForOwnership

func ValidateACLForOwnership(req *http.Request, bucket *s3types.Bucket) *s3err.ErrorCode

ValidateACLForOwnership checks if the ACL is allowed given the bucket's ownership controls. When BucketOwnerEnforced is set, only bucket-owner-full-control or no ACL is allowed. Returns nil if allowed, error code if not allowed.

Types

type AccessLogCollector

type AccessLogCollector interface {
	Record(event *AccessLogEvent)
}

AccessLogCollector is the interface for collecting access log events. This is implemented by enterprise/accesslog.Collector.

type AccessLogEvent

type AccessLogEvent struct {
	EventTime        time.Time
	RequestID        string
	Bucket           string
	ObjectKey        string
	OwnerID          string
	RequesterID      string
	RemoteIP         net.IP
	Operation        string
	HTTPMethod       string
	HTTPStatus       int
	BytesSent        uint64
	ObjectSize       uint64
	TotalTimeMs      uint32
	TurnAroundMs     uint32
	SignatureVersion string
	TLSVersion       string
	AuthType         string
	UserAgent        string
	Referer          string
	HostHeader       string
	RequestURI       string
	ErrorCode        string
	VersionID        string
}

AccessLogEvent represents a single S3 access log entry. This mirrors enterprise/accesslog.AccessLogEvent for use in the API layer.

type BucketAccessResult

type BucketAccessResult struct {
	Bucket  *s3types.Bucket  // The bucket info, or nil if not found
	ErrCode *s3err.ErrorCode // Error code if validation failed, nil if OK
}

BucketAccessResult contains the result of a bucket access validation.

type BucketStatusResponse

type BucketStatusResponse struct {
	Bucket            string           `json:"bucket"`
	Mode              string           `json:"mode"` // "local", "passthrough", "migrating"
	DualWriteEnabled  bool             `json:"dual_write_enabled"`
	MigrationPaused   bool             `json:"migration_paused"`
	ObjectsDiscovered int64            `json:"objects_discovered"`
	ObjectsSynced     int64            `json:"objects_synced"`
	BytesSynced       int64            `json:"bytes_synced"`
	ProgressPercent   float64          `json:"progress_percent"`
	External          ExternalS3Config `json:"external"` // credentials redacted
}

BucketStatusResponse is the response for GET /admin/federation/buckets/{bucket}

type BucketStore

type BucketStore interface {
	GetBucket(bucket string) (s3types.Bucket, bool)
}

BucketStore defines the interface for bucket lookup operations. Implemented by cache.BucketStore.

type CRRHook

type CRRHook struct{}

CRRHook is a stub for community edition.

func NewCRRHook

func NewCRRHook(queue any, localRegion string) *CRRHook

NewCRRHook returns nil in community edition.

func (*CRRHook) AfterDeleteObject

func (h *CRRHook) AfterDeleteObject(ctx context.Context, bucket *s3types.Bucket, key string)

func (*CRRHook) AfterPutObject

func (h *CRRHook) AfterPutObject(ctx context.Context, bucket *s3types.Bucket, key, etag string, size int64)

type EncryptionMetadata

type EncryptionMetadata struct {
	SSEAlgorithm      string // "AES256" or "aws:kms"
	SSECustomerKeyMD5 string // For SSE-C validation
	SSEKMSKeyID       string // For SSE-KMS
	SSEKMSContext     string // For SSE-KMS (encryption context JSON)
}

EncryptionMetadata contains encryption information for an object

type ExternalS3Config

type ExternalS3Config struct {
	Endpoint        string `json:"endpoint"`
	Region          string `json:"region"`
	AccessKeyID     string `json:"access_key_id"`
	SecretAccessKey string `json:"secret_access_key"`
	Bucket          string `json:"bucket"`
	PathStyle       bool   `json:"path_style,omitempty"`
}

ExternalS3Config holds external S3 connection details.

type FederationAdminHandler

type FederationAdminHandler struct {
	// contains filtered or unexported fields
}

FederationAdminHandler handles federation admin HTTP endpoints. These endpoints are for managing S3 federation (passthrough/migration).

func NewFederationAdminHandler

func NewFederationAdminHandler(database db.DB) *FederationAdminHandler

NewFederationAdminHandler creates a new federation admin handler.

func (*FederationAdminHandler) RegisterRoutes

func (h *FederationAdminHandler) RegisterRoutes(mux *http.ServeMux)

RegisterRoutes registers federation admin routes on the provided mux. All routes are under /admin/federation/

type GlacierJobParameters

type GlacierJobParameters struct {
	Tier string `xml:"Tier"` // Expedited, Standard, or Bulk
}

GlacierJobParameters specifies the retrieval tier for the restore

type Handler

type Handler func(*data.Data, http.ResponseWriter)

type MetadataServer

type MetadataServer struct {
	metadata_pb.UnimplementedMetadataServiceServer
	// contains filtered or unexported fields
}

func NewMetadataServer

func NewMetadataServer(ctx context.Context, cfg ServerConfig) *MetadataServer

func (*MetadataServer) AbortMultipartUploadHandler

func (s *MetadataServer) AbortMultipartUploadHandler(d *data.Data, w http.ResponseWriter)

AbortMultipartUploadHandler aborts a multipart upload. DELETE /{bucket}/{key}?uploadId={uploadId}

func (*MetadataServer) CompleteMultipartUploadHandler

func (s *MetadataServer) CompleteMultipartUploadHandler(d *data.Data, w http.ResponseWriter)

CompleteMultipartUploadHandler completes a multipart upload. POST /{bucket}/{key}?uploadId={uploadId}

func (*MetadataServer) CopyObjectHandler

func (s *MetadataServer) CopyObjectHandler(d *data.Data, w http.ResponseWriter)

CopyObjectHandler copies an object within/between buckets. PUT /{bucket}/{key} with x-amz-copy-source header

func (*MetadataServer) CreateBucketHandler

func (s *MetadataServer) CreateBucketHandler(d *data.Data, w http.ResponseWriter)

func (*MetadataServer) CreateCollection

CreateCollection is a placeholder. Not currently supported. Use the S3 HTTP API (PUT /{bucket}) instead.

func (*MetadataServer) CreateMultipartUploadHandler

func (s *MetadataServer) CreateMultipartUploadHandler(d *data.Data, w http.ResponseWriter)

CreateMultipartUploadHandler initiates a multipart upload. POST /{bucket}/{key}?uploads

func (*MetadataServer) CreateSessionHandler

func (s *MetadataServer) CreateSessionHandler(d *data.Data, w http.ResponseWriter)

CreateSessionHandler creates an S3 Express session. GET /{bucket}?session

S3 Express One Zone specific feature - not applicable to ZapFS.

func (*MetadataServer) DeleteBucketAnalyticsConfigurationHandler

func (s *MetadataServer) DeleteBucketAnalyticsConfigurationHandler(d *data.Data, w http.ResponseWriter)

DeleteBucketAnalyticsConfigurationHandler removes analytics configuration. DELETE /{bucket}?analytics&id={id}

func (*MetadataServer) DeleteBucketCorsHandler

func (s *MetadataServer) DeleteBucketCorsHandler(d *data.Data, w http.ResponseWriter)

DeleteBucketCorsHandler removes the CORS configuration for a bucket. DELETE /{bucket}?cors

func (*MetadataServer) DeleteBucketEncryptionHandler

func (s *MetadataServer) DeleteBucketEncryptionHandler(d *data.Data, w http.ResponseWriter)

DeleteBucketEncryptionHandler removes the encryption configuration for a bucket. DELETE /{bucket}?encryption

Requires FeatureKMS license.

func (*MetadataServer) DeleteBucketHandler

func (s *MetadataServer) DeleteBucketHandler(d *data.Data, w http.ResponseWriter)

func (*MetadataServer) DeleteBucketIntelligentTieringConfigurationHandler

func (s *MetadataServer) DeleteBucketIntelligentTieringConfigurationHandler(d *data.Data, w http.ResponseWriter)

DeleteBucketIntelligentTieringConfigurationHandler removes intelligent tiering configuration. DELETE /{bucket}?intelligent-tiering&id={id}

Requires FeatureLifecycle license.

func (*MetadataServer) DeleteBucketInventoryConfigurationHandler

func (s *MetadataServer) DeleteBucketInventoryConfigurationHandler(d *data.Data, w http.ResponseWriter)

DeleteBucketInventoryConfigurationHandler removes inventory configuration. DELETE /{bucket}?inventory&id={id}

func (*MetadataServer) DeleteBucketLifecycleHandler

func (s *MetadataServer) DeleteBucketLifecycleHandler(d *data.Data, w http.ResponseWriter)

DeleteBucketLifecycleHandler removes the lifecycle configuration for a bucket. DELETE /{bucket}?lifecycle

Requires FeatureLifecycle license.

func (*MetadataServer) DeleteBucketMetricsConfigurationHandler

func (s *MetadataServer) DeleteBucketMetricsConfigurationHandler(d *data.Data, w http.ResponseWriter)

DeleteBucketMetricsConfigurationHandler removes metrics configuration. DELETE /{bucket}?metrics&id={id}

func (*MetadataServer) DeleteBucketOwnershipControlsHandler

func (s *MetadataServer) DeleteBucketOwnershipControlsHandler(d *data.Data, w http.ResponseWriter)

DeleteBucketOwnershipControlsHandler removes bucket ownership controls. DELETE /{bucket}?ownershipControls

func (*MetadataServer) DeleteBucketPolicyHandler

func (s *MetadataServer) DeleteBucketPolicyHandler(d *data.Data, w http.ResponseWriter)

DeleteBucketPolicyHandler removes the policy of a bucket. DELETE /{bucket}?policy

func (*MetadataServer) DeleteBucketReplicationHandler

func (s *MetadataServer) DeleteBucketReplicationHandler(d *data.Data, w http.ResponseWriter)

DeleteBucketReplicationHandler removes the replication configuration from a bucket. DELETE /{bucket}?replication

Requires FeatureMultiRegion license.

func (*MetadataServer) DeleteBucketTaggingHandler

func (s *MetadataServer) DeleteBucketTaggingHandler(d *data.Data, w http.ResponseWriter)

DeleteBucketTaggingHandler removes the tag set for a bucket. DELETE /{bucket}?tagging

func (*MetadataServer) DeleteBucketWebsiteHandler

func (s *MetadataServer) DeleteBucketWebsiteHandler(d *data.Data, w http.ResponseWriter)

DeleteBucketWebsiteHandler removes the website configuration for a bucket. DELETE /{bucket}?website

func (*MetadataServer) DeleteCollection

DeleteCollection is a placeholder. Not currently supported. Use the S3 HTTP API (DELETE /{bucket}) instead.

func (*MetadataServer) DeleteObject

DeleteObject is a placeholder. Not currently supported. Use the S3 HTTP API (DELETE /{bucket}/{key}) instead.

func (*MetadataServer) DeleteObjectHandler

func (s *MetadataServer) DeleteObjectHandler(d *data.Data, w http.ResponseWriter)

func (*MetadataServer) DeleteObjectTaggingHandler

func (s *MetadataServer) DeleteObjectTaggingHandler(d *data.Data, w http.ResponseWriter)

DeleteObjectTaggingHandler removes the tag set for an object. DELETE /{bucket}/{key}?tagging

func (*MetadataServer) DeleteObjectsHandler

func (s *MetadataServer) DeleteObjectsHandler(d *data.Data, w http.ResponseWriter)

DeleteObjectsHandler deletes multiple objects in a single request. POST /{bucket}?delete

func (*MetadataServer) DeletePublicAccessBlockHandler

func (s *MetadataServer) DeletePublicAccessBlockHandler(d *data.Data, w http.ResponseWriter)

DeletePublicAccessBlockHandler removes the public access block configuration. DELETE /{bucket}?publicAccessBlock

func (*MetadataServer) GetBucketAccelerateConfigurationHandler

func (s *MetadataServer) GetBucketAccelerateConfigurationHandler(d *data.Data, w http.ResponseWriter)

GetBucketAccelerateConfigurationHandler returns transfer acceleration config. GET /{bucket}?accelerate

ZapFS does not support transfer acceleration - returns empty/suspended.

func (*MetadataServer) GetBucketAclHandler

func (s *MetadataServer) GetBucketAclHandler(d *data.Data, w http.ResponseWriter)

GetBucketAclHandler returns the ACL of a bucket. GET /{bucket}?acl

func (*MetadataServer) GetBucketAnalyticsConfigurationHandler

func (s *MetadataServer) GetBucketAnalyticsConfigurationHandler(d *data.Data, w http.ResponseWriter)

GetBucketAnalyticsConfigurationHandler returns analytics configuration. GET /{bucket}?analytics&id={id}

ZapFS does not support analytics - returns NoSuchConfiguration.

func (*MetadataServer) GetBucketCorsHandler

func (s *MetadataServer) GetBucketCorsHandler(d *data.Data, w http.ResponseWriter)

GetBucketCorsHandler returns the CORS configuration for a bucket. GET /{bucket}?cors

func (*MetadataServer) GetBucketEncryptionHandler

func (s *MetadataServer) GetBucketEncryptionHandler(d *data.Data, w http.ResponseWriter)

GetBucketEncryptionHandler returns the encryption configuration for a bucket. GET /{bucket}?encryption

Requires FeatureKMS license.

func (*MetadataServer) GetBucketIntelligentTieringConfigurationHandler

func (s *MetadataServer) GetBucketIntelligentTieringConfigurationHandler(d *data.Data, w http.ResponseWriter)

GetBucketIntelligentTieringConfigurationHandler returns intelligent tiering configuration. GET /{bucket}?intelligent-tiering&id={id}

Requires FeatureLifecycle license.

func (*MetadataServer) GetBucketInventoryConfigurationHandler

func (s *MetadataServer) GetBucketInventoryConfigurationHandler(d *data.Data, w http.ResponseWriter)

GetBucketInventoryConfigurationHandler returns inventory configuration. GET /{bucket}?inventory&id={id}

ZapFS does not support inventory - returns NoSuchConfiguration.

func (*MetadataServer) GetBucketLifecycleConfigurationHandler

func (s *MetadataServer) GetBucketLifecycleConfigurationHandler(d *data.Data, w http.ResponseWriter)

GetBucketLifecycleConfigurationHandler returns the lifecycle configuration for a bucket. GET /{bucket}?lifecycle

Requires FeatureLifecycle license.

func (*MetadataServer) GetBucketLocationHandler

func (s *MetadataServer) GetBucketLocationHandler(d *data.Data, w http.ResponseWriter)

GetBucketLocationHandler returns the region where the bucket resides. GET /{bucket}?location

func (*MetadataServer) GetBucketLoggingHandler

func (s *MetadataServer) GetBucketLoggingHandler(d *data.Data, w http.ResponseWriter)

GetBucketLoggingHandler returns bucket logging configuration. GET /{bucket}?logging

This API works in both community and enterprise editions. Actual log collection and delivery requires enterprise license with FeatureAccessLog.

func (*MetadataServer) GetBucketMetricsConfigurationHandler

func (s *MetadataServer) GetBucketMetricsConfigurationHandler(d *data.Data, w http.ResponseWriter)

GetBucketMetricsConfigurationHandler returns metrics configuration. GET /{bucket}?metrics&id={id}

ZapFS does not support CloudWatch metrics - returns NoSuchConfiguration.

func (*MetadataServer) GetBucketNotificationConfigurationHandler

func (s *MetadataServer) GetBucketNotificationConfigurationHandler(d *data.Data, w http.ResponseWriter)

GetBucketNotificationConfigurationHandler returns notification configuration. GET /{bucket}?notification

Requires FeatureEvents license.

func (*MetadataServer) GetBucketOwnershipControlsHandler

func (s *MetadataServer) GetBucketOwnershipControlsHandler(d *data.Data, w http.ResponseWriter)

GetBucketOwnershipControlsHandler returns bucket ownership controls. GET /{bucket}?ownershipControls

Returns OwnershipControlsNotFoundError if not configured.

func (*MetadataServer) GetBucketPolicyHandler

func (s *MetadataServer) GetBucketPolicyHandler(d *data.Data, w http.ResponseWriter)

GetBucketPolicyHandler returns the policy of a bucket. GET /{bucket}?policy

func (*MetadataServer) GetBucketPolicyStatusHandler

func (s *MetadataServer) GetBucketPolicyStatusHandler(d *data.Data, w http.ResponseWriter)

GetBucketPolicyStatusHandler checks if bucket policy grants public access. GET /{bucket}?policyStatus

Analyzes the bucket policy to determine if it allows public access by checking for Principal: "*" or Principal: {"AWS": "*"} in Allow statements.

See: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketPolicyStatus.html

func (*MetadataServer) GetBucketReplicationHandler

func (s *MetadataServer) GetBucketReplicationHandler(d *data.Data, w http.ResponseWriter)

GetBucketReplicationHandler returns the replication configuration for a bucket. GET /{bucket}?replication

Requires FeatureMultiRegion license.

func (*MetadataServer) GetBucketRequestPaymentHandler

func (s *MetadataServer) GetBucketRequestPaymentHandler(d *data.Data, w http.ResponseWriter)

GetBucketRequestPaymentHandler returns requester pays configuration. GET /{bucket}?requestPayment

ZapFS does not support requester pays - always returns BucketOwner.

func (*MetadataServer) GetBucketTaggingHandler

func (s *MetadataServer) GetBucketTaggingHandler(d *data.Data, w http.ResponseWriter)

GetBucketTaggingHandler returns the tag set for a bucket. GET /{bucket}?tagging

func (*MetadataServer) GetBucketVersioningHandler

func (s *MetadataServer) GetBucketVersioningHandler(d *data.Data, w http.ResponseWriter)

GetBucketVersioningHandler returns the versioning state of a bucket. GET /{bucket}?versioning

func (*MetadataServer) GetBucketWebsiteHandler

func (s *MetadataServer) GetBucketWebsiteHandler(d *data.Data, w http.ResponseWriter)

GetBucketWebsiteHandler returns the website configuration for a bucket. GET /{bucket}?website

func (*MetadataServer) GetChunkReplicas

GetChunkReplicas returns the servers that have a copy of a specific chunk. Used by Manager for re-replication of missing chunks.

func (*MetadataServer) GetObject

GetObject is a placeholder. Not currently supported. Use the S3 HTTP API (GET /{bucket}/{key}) instead.

func (*MetadataServer) GetObjectAclHandler

func (s *MetadataServer) GetObjectAclHandler(d *data.Data, w http.ResponseWriter)

GetObjectAclHandler returns the ACL of an object. GET /{bucket}/{key}?acl

func (*MetadataServer) GetObjectAttributesHandler

func (s *MetadataServer) GetObjectAttributesHandler(d *data.Data, w http.ResponseWriter)

GetObjectAttributesHandler returns object attributes without full GET. GET /{bucket}/{key}?attributes

Returns subset of HeadObject info based on x-amz-object-attributes header. See: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectAttributes.html

func (*MetadataServer) GetObjectHandler

func (s *MetadataServer) GetObjectHandler(d *data.Data, w http.ResponseWriter)

GetObjectHandler retrieves an object. GET /{bucket}/{key}

func (*MetadataServer) GetObjectLegalHoldHandler

func (s *MetadataServer) GetObjectLegalHoldHandler(d *data.Data, w http.ResponseWriter)

GetObjectLegalHoldHandler returns the legal hold status for an object. GET /{bucket}/{key}?legal-hold

Requires FeatureObjectLock license.

func (*MetadataServer) GetObjectLockConfigurationHandler

func (s *MetadataServer) GetObjectLockConfigurationHandler(d *data.Data, w http.ResponseWriter)

GetObjectLockConfigurationHandler returns the Object Lock configuration for a bucket. GET /{bucket}?object-lock

Requires FeatureObjectLock license.

func (*MetadataServer) GetObjectRetentionHandler

func (s *MetadataServer) GetObjectRetentionHandler(d *data.Data, w http.ResponseWriter)

GetObjectRetentionHandler returns the retention settings for an object. GET /{bucket}/{key}?retention

Requires FeatureObjectLock license.

func (*MetadataServer) GetObjectTaggingHandler

func (s *MetadataServer) GetObjectTaggingHandler(d *data.Data, w http.ResponseWriter)

GetObjectTaggingHandler returns the tag set for an object. GET /{bucket}/{key}?tagging

func (*MetadataServer) GetObjectTorrentHandler

func (s *MetadataServer) GetObjectTorrentHandler(d *data.Data, w http.ResponseWriter)

GetObjectTorrentHandler returns torrent file for an object. GET /{bucket}/{key}?torrent

Legacy AWS feature - not commonly used.

func (*MetadataServer) GetPublicAccessBlockHandler

func (s *MetadataServer) GetPublicAccessBlockHandler(d *data.Data, w http.ResponseWriter)

GetPublicAccessBlockHandler returns the public access block configuration. GET /{bucket}?publicAccessBlock

Returns NoSuchPublicAccessBlockConfiguration if not configured.

func (*MetadataServer) HeadBucketHandler

func (s *MetadataServer) HeadBucketHandler(d *data.Data, w http.ResponseWriter)

HeadBucketHandler checks if a bucket exists and the caller has permission. HEAD /{bucket}

func (*MetadataServer) HeadObjectHandler

func (s *MetadataServer) HeadObjectHandler(d *data.Data, w http.ResponseWriter)

HeadObjectHandler returns object metadata without the body. HEAD /{bucket}/{key}

func (*MetadataServer) ListBucketAnalyticsConfigurationsHandler

func (s *MetadataServer) ListBucketAnalyticsConfigurationsHandler(d *data.Data, w http.ResponseWriter)

ListBucketAnalyticsConfigurationsHandler lists analytics configurations. GET /{bucket}?analytics

ZapFS does not support analytics - returns empty list.

func (*MetadataServer) ListBucketIntelligentTieringConfigurationsHandler

func (s *MetadataServer) ListBucketIntelligentTieringConfigurationsHandler(d *data.Data, w http.ResponseWriter)

ListBucketIntelligentTieringConfigurationsHandler lists intelligent tiering configurations. GET /{bucket}?intelligent-tiering

Requires FeatureLifecycle license.

func (*MetadataServer) ListBucketInventoryConfigurationsHandler

func (s *MetadataServer) ListBucketInventoryConfigurationsHandler(d *data.Data, w http.ResponseWriter)

ListBucketInventoryConfigurationsHandler lists inventory configurations. GET /{bucket}?inventory

ZapFS does not support inventory - returns empty list.

func (*MetadataServer) ListBucketMetricsConfigurationsHandler

func (s *MetadataServer) ListBucketMetricsConfigurationsHandler(d *data.Data, w http.ResponseWriter)

ListBucketMetricsConfigurationsHandler lists metrics configurations. GET /{bucket}?metrics

ZapFS does not support CloudWatch metrics - returns empty list.

func (*MetadataServer) ListBucketsHandler

func (s *MetadataServer) ListBucketsHandler(d *data.Data, w http.ResponseWriter)

ListBucketsHandler lists all buckets owned by the authenticated user. GET /?max-buckets={max}&prefix={prefix}&continuation-token={token}&bucket-region={region}

func (*MetadataServer) ListCollections

ListCollections is a placeholder. Not currently supported. Use the S3 HTTP API (GET /) instead.

func (*MetadataServer) ListMultipartUploadsHandler

func (s *MetadataServer) ListMultipartUploadsHandler(d *data.Data, w http.ResponseWriter)

ListMultipartUploadsHandler lists in-progress multipart uploads. GET /{bucket}?uploads

func (*MetadataServer) ListObjectVersionsHandler

func (s *MetadataServer) ListObjectVersionsHandler(d *data.Data, w http.ResponseWriter)

ListObjectVersionsHandler lists all versions of objects in a bucket. GET /{bucket}?versions Note: This handler remains mostly unchanged as it's a complex list operation that should eventually be moved to object service, not config service.

func (*MetadataServer) ListObjects

ListObjects is a placeholder. Not currently supported. Use the S3 HTTP API (GET /{bucket}?list-type=2) instead.

func (*MetadataServer) ListObjectsHandler

func (s *MetadataServer) ListObjectsHandler(d *data.Data, w http.ResponseWriter)

ListObjectsHandler lists objects using the V1 API. GET /{bucket}

func (*MetadataServer) ListObjectsV2Handler

func (s *MetadataServer) ListObjectsV2Handler(d *data.Data, w http.ResponseWriter)

ListObjectsV2Handler lists objects using the V2 API. GET /{bucket}?list-type=2

func (*MetadataServer) ListPartsHandler

func (s *MetadataServer) ListPartsHandler(d *data.Data, w http.ResponseWriter)

ListPartsHandler lists the parts of a multipart upload. GET /{bucket}/{key}?uploadId={uploadId}

func (*MetadataServer) OptionsPreflightHandler

func (s *MetadataServer) OptionsPreflightHandler(d *data.Data, w http.ResponseWriter)

OptionsPreflightHandler handles CORS preflight OPTIONS requests. OPTIONS /{bucket}/{key}

See: https://docs.aws.amazon.com/AmazonS3/latest/userguide/cors.html

func (*MetadataServer) Ping

Ping is a placeholder for health checks. Not currently supported. Health checks should use the HTTP /health endpoint instead.

func (*MetadataServer) PostObjectHandler

func (s *MetadataServer) PostObjectHandler(d *data.Data, w http.ResponseWriter)

PostObjectHandler handles form-based uploads (browser uploads). POST /{bucket}

Allows uploading objects via HTML form with policy-based authorization. See: https://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectPOST.html

func (*MetadataServer) PutBucketAccelerateConfigurationHandler

func (s *MetadataServer) PutBucketAccelerateConfigurationHandler(d *data.Data, w http.ResponseWriter)

PutBucketAccelerateConfigurationHandler sets transfer acceleration. PUT /{bucket}?accelerate

ZapFS does not support transfer acceleration.

func (*MetadataServer) PutBucketAclHandler

func (s *MetadataServer) PutBucketAclHandler(d *data.Data, w http.ResponseWriter)

PutBucketAclHandler sets the ACL of a bucket. PUT /{bucket}?acl

func (*MetadataServer) PutBucketAnalyticsConfigurationHandler

func (s *MetadataServer) PutBucketAnalyticsConfigurationHandler(d *data.Data, w http.ResponseWriter)

PutBucketAnalyticsConfigurationHandler sets analytics configuration. PUT /{bucket}?analytics&id={id}

ZapFS does not support analytics.

func (*MetadataServer) PutBucketCorsHandler

func (s *MetadataServer) PutBucketCorsHandler(d *data.Data, w http.ResponseWriter)

PutBucketCorsHandler sets the CORS configuration for a bucket. PUT /{bucket}?cors

func (*MetadataServer) PutBucketEncryptionHandler

func (s *MetadataServer) PutBucketEncryptionHandler(d *data.Data, w http.ResponseWriter)

PutBucketEncryptionHandler sets the encryption configuration for a bucket. PUT /{bucket}?encryption

Requires FeatureKMS license.

func (*MetadataServer) PutBucketIntelligentTieringConfigurationHandler

func (s *MetadataServer) PutBucketIntelligentTieringConfigurationHandler(d *data.Data, w http.ResponseWriter)

PutBucketIntelligentTieringConfigurationHandler sets intelligent tiering configuration. PUT /{bucket}?intelligent-tiering&id={id}

Requires FeatureLifecycle license.

func (*MetadataServer) PutBucketInventoryConfigurationHandler

func (s *MetadataServer) PutBucketInventoryConfigurationHandler(d *data.Data, w http.ResponseWriter)

PutBucketInventoryConfigurationHandler sets inventory configuration. PUT /{bucket}?inventory&id={id}

ZapFS does not support inventory.

func (*MetadataServer) PutBucketLifecycleConfigurationHandler

func (s *MetadataServer) PutBucketLifecycleConfigurationHandler(d *data.Data, w http.ResponseWriter)

PutBucketLifecycleConfigurationHandler sets the lifecycle configuration for a bucket. PUT /{bucket}?lifecycle

Requires FeatureLifecycle license.

func (*MetadataServer) PutBucketLoggingHandler

func (s *MetadataServer) PutBucketLoggingHandler(d *data.Data, w http.ResponseWriter)

PutBucketLoggingHandler sets bucket logging configuration. PUT /{bucket}?logging

This API works in both community and enterprise editions. Actual log collection and delivery requires enterprise license with FeatureAccessLog.

func (*MetadataServer) PutBucketMetricsConfigurationHandler

func (s *MetadataServer) PutBucketMetricsConfigurationHandler(d *data.Data, w http.ResponseWriter)

PutBucketMetricsConfigurationHandler sets metrics configuration. PUT /{bucket}?metrics&id={id}

ZapFS does not support CloudWatch metrics.

func (*MetadataServer) PutBucketNotificationConfigurationHandler

func (s *MetadataServer) PutBucketNotificationConfigurationHandler(d *data.Data, w http.ResponseWriter)

PutBucketNotificationConfigurationHandler sets notification configuration. PUT /{bucket}?notification

Requires FeatureEvents license.

func (*MetadataServer) PutBucketOwnershipControlsHandler

func (s *MetadataServer) PutBucketOwnershipControlsHandler(d *data.Data, w http.ResponseWriter)

PutBucketOwnershipControlsHandler sets bucket ownership controls. PUT /{bucket}?ownershipControls

func (*MetadataServer) PutBucketPolicyHandler

func (s *MetadataServer) PutBucketPolicyHandler(d *data.Data, w http.ResponseWriter)

PutBucketPolicyHandler sets the policy of a bucket. PUT /{bucket}?policy

func (*MetadataServer) PutBucketReplicationHandler

func (s *MetadataServer) PutBucketReplicationHandler(d *data.Data, w http.ResponseWriter)

PutBucketReplicationHandler sets the replication configuration for a bucket. PUT /{bucket}?replication

Requires FeatureMultiRegion license.

func (*MetadataServer) PutBucketRequestPaymentHandler

func (s *MetadataServer) PutBucketRequestPaymentHandler(d *data.Data, w http.ResponseWriter)

PutBucketRequestPaymentHandler sets requester pays configuration. PUT /{bucket}?requestPayment

ZapFS does not support requester pays - accepts but ignores.

func (*MetadataServer) PutBucketTaggingHandler

func (s *MetadataServer) PutBucketTaggingHandler(d *data.Data, w http.ResponseWriter)

PutBucketTaggingHandler sets the tag set for a bucket. PUT /{bucket}?tagging

func (*MetadataServer) PutBucketVersioningHandler

func (s *MetadataServer) PutBucketVersioningHandler(d *data.Data, w http.ResponseWriter)

PutBucketVersioningHandler sets the versioning state of a bucket. PUT /{bucket}?versioning

func (*MetadataServer) PutBucketWebsiteHandler

func (s *MetadataServer) PutBucketWebsiteHandler(d *data.Data, w http.ResponseWriter)

PutBucketWebsiteHandler sets the website configuration for a bucket. PUT /{bucket}?website

func (*MetadataServer) PutObjectAclHandler

func (s *MetadataServer) PutObjectAclHandler(d *data.Data, w http.ResponseWriter)

PutObjectAclHandler sets the ACL of an object. PUT /{bucket}/{key}?acl

func (*MetadataServer) PutObjectHandler

func (s *MetadataServer) PutObjectHandler(d *data.Data, w http.ResponseWriter)

PutObjectHandler stores an object. PUT /{bucket}/{key}

func (*MetadataServer) PutObjectLegalHoldHandler

func (s *MetadataServer) PutObjectLegalHoldHandler(d *data.Data, w http.ResponseWriter)

PutObjectLegalHoldHandler sets the legal hold status for an object. PUT /{bucket}/{key}?legal-hold

Requires FeatureObjectLock license.

func (*MetadataServer) PutObjectLockConfigurationHandler

func (s *MetadataServer) PutObjectLockConfigurationHandler(d *data.Data, w http.ResponseWriter)

PutObjectLockConfigurationHandler sets the Object Lock configuration for a bucket. PUT /{bucket}?object-lock

Requires FeatureObjectLock license.

func (*MetadataServer) PutObjectRetentionHandler

func (s *MetadataServer) PutObjectRetentionHandler(d *data.Data, w http.ResponseWriter)

PutObjectRetentionHandler sets the retention settings for an object. PUT /{bucket}/{key}?retention

Requires FeatureObjectLock license.

func (*MetadataServer) PutObjectTaggingHandler

func (s *MetadataServer) PutObjectTaggingHandler(d *data.Data, w http.ResponseWriter)

PutObjectTaggingHandler sets the tag set for an object. PUT /{bucket}/{key}?tagging

func (*MetadataServer) PutPublicAccessBlockHandler

func (s *MetadataServer) PutPublicAccessBlockHandler(d *data.Data, w http.ResponseWriter)

PutPublicAccessBlockHandler sets the public access block configuration. PUT /{bucket}?publicAccessBlock

func (*MetadataServer) RestoreObjectHandler

func (s *MetadataServer) RestoreObjectHandler(d *data.Data, w http.ResponseWriter)

RestoreObjectHandler restores an object from archive storage class. POST /{bucket}/{key}?restore

Requires FeatureLifecycle license. Used to restore objects from archive storage classes (Glacier, Deep Archive).

func (*MetadataServer) SelectObjectContentHandler

func (s *MetadataServer) SelectObjectContentHandler(d *data.Data, w http.ResponseWriter)

SelectObjectContentHandler performs S3 Select queries on objects. POST /{bucket}/{key}?select&select-type=2

S3 Select allows using SQL to filter and project data from CSV, JSON, and Parquet objects. This reduces data transfer by only returning the requested subset of data.

Request Body (XML):

<SelectObjectContentRequest>
  <Expression>SELECT * FROM s3object WHERE age > 25</Expression>
  <ExpressionType>SQL</ExpressionType>
  <InputSerialization>
    <CSV><FileHeaderInfo>USE</FileHeaderInfo></CSV>
  </InputSerialization>
  <OutputSerialization>
    <CSV/>
  </OutputSerialization>
</SelectObjectContentRequest>

Response: Event stream with Records, Stats, Progress, and End events.

func (*MetadataServer) ServeHTTP

func (s *MetadataServer) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*MetadataServer) ServeWebsiteContent

func (s *MetadataServer) ServeWebsiteContent(d *data.Data, w http.ResponseWriter)

ServeWebsiteContent handles GET/HEAD requests for website-hosted buckets. Called from GetObjectHandler when d.IsWebsiteRequest is true.

func (*MetadataServer) Shutdown

func (ms *MetadataServer) Shutdown() error

func (*MetadataServer) StreamChunksForServer

StreamChunksForServer streams all chunk IDs expected on a file server. Used by Manager to coordinate file server reconciliation.

func (*MetadataServer) UploadPartCopyHandler

func (s *MetadataServer) UploadPartCopyHandler(d *data.Data, w http.ResponseWriter)

UploadPartCopyHandler copies data from an existing object as a part. PUT /{bucket}/{key}?partNumber={partNumber}&uploadId={uploadId} with x-amz-copy-source header See: https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPartCopy.html

func (*MetadataServer) UploadPartHandler

func (s *MetadataServer) UploadPartHandler(d *data.Data, w http.ResponseWriter)

UploadPartHandler uploads a part of a multipart upload. PUT /{bucket}/{key}?partNumber={partNumber}&uploadId={uploadId}

func (*MetadataServer) UsageCollector

func (ms *MetadataServer) UsageCollector() usage.Collector

UsageCollector returns the usage collector for recording events.

func (*MetadataServer) UsageConfig

func (ms *MetadataServer) UsageConfig() usage.Config

UsageConfig returns the usage configuration.

func (*MetadataServer) UsageStore

func (ms *MetadataServer) UsageStore() usage.Store

UsageStore returns the usage store for querying usage data.

func (*MetadataServer) WriteGetObjectResponseHandler

func (s *MetadataServer) WriteGetObjectResponseHandler(d *data.Data, w http.ResponseWriter)

WriteGetObjectResponseHandler writes Lambda response for Object Lambda. POST /WriteGetObjectResponse

AWS Lambda-specific feature - not applicable to ZapFS.

type NopAccessLogCollector

type NopAccessLogCollector struct{}

NopAccessLogCollector is a no-op collector for when access logging is disabled.

func (NopAccessLogCollector) Record

type RegionConfig

type RegionConfig = manager.RegionConfig

Type aliases for cross-region replication configuration

type RegisterBucketRequest

type RegisterBucketRequest struct {
	LocalBucket          string           `json:"local_bucket"`
	Mode                 string           `json:"mode"` // "passthrough" or "migrating"
	External             ExternalS3Config `json:"external"`
	StartActiveMigration bool             `json:"start_active_migration,omitempty"`
}

RegisterBucketRequest is the request body for POST /admin/federation/buckets

type RegisterBucketResponse

type RegisterBucketResponse struct {
	Success             bool   `json:"success"`
	Error               string `json:"error,omitempty"`
	ExternalObjectCount int64  `json:"external_object_count,omitempty"`
}

RegisterBucketResponse is the response for POST /admin/federation/buckets

type ReplicationCredentials

type ReplicationCredentials = service.ReplicationCredentials

Type aliases for cross-region replication configuration

type RestoreRequest

type RestoreRequest struct {
	XMLName              xml.Name              `xml:"RestoreRequest"`
	Days                 int                   `xml:"Days"`
	GlacierJobParameters *GlacierJobParameters `xml:"GlacierJobParameters,omitempty"`
}

RestoreRequest is the XML body for POST /{bucket}/{key}?restore

type S3ErrorConverter

type S3ErrorConverter interface {
	error
	ToS3Error() s3err.ErrorCode
}

S3ErrorConverter is an interface for domain errors that can be converted to S3 errors.

type SSECHeaders

type SSECHeaders struct {
	Algorithm string // "AES256"
	Key       []byte // Decoded customer key (32 bytes)
	KeyMD5    string // MD5 hash of the key
}

SSECHeaders contains parsed SSE-C headers from a request

type SSEKMSHeaders

type SSEKMSHeaders struct {
	Algorithm string // "aws:kms"
	KeyID     string // KMS key ID
	Context   string // Optional encryption context (JSON string)
}

SSEKMSHeaders contains parsed SSE-KMS headers from a request

type SSEResponseFields

type SSEResponseFields struct {
	SSEAlgorithm      string
	SSECustomerKeyMD5 string
	SSEKMSKeyID       string
	SSEKMSContext     string
}

SSEResponseFields contains fields needed to write SSE response headers. This interface allows different result types to provide SSE information.

type SelectCSVInput

type SelectCSVInput struct {
	FileHeaderInfo             string `xml:"FileHeaderInfo,omitempty"`             // USE, IGNORE, NONE
	Comments                   string `xml:"Comments,omitempty"`                   // Comment character
	QuoteEscapeCharacter       string `xml:"QuoteEscapeCharacter,omitempty"`       // Quote escape char
	RecordDelimiter            string `xml:"RecordDelimiter,omitempty"`            // Record delimiter
	FieldDelimiter             string `xml:"FieldDelimiter,omitempty"`             // Field delimiter
	QuoteCharacter             string `xml:"QuoteCharacter,omitempty"`             // Quote char
	AllowQuotedRecordDelimiter bool   `xml:"AllowQuotedRecordDelimiter,omitempty"` // Allow delim in quotes
}

SelectCSVInput defines CSV input options.

type SelectCSVOutput

type SelectCSVOutput struct {
	QuoteFields          string `xml:"QuoteFields,omitempty"`          // ALWAYS, ASNEEDED
	QuoteEscapeCharacter string `xml:"QuoteEscapeCharacter,omitempty"` // Quote escape char
	RecordDelimiter      string `xml:"RecordDelimiter,omitempty"`      // Record delimiter
	FieldDelimiter       string `xml:"FieldDelimiter,omitempty"`       // Field delimiter
	QuoteCharacter       string `xml:"QuoteCharacter,omitempty"`       // Quote char
}

SelectCSVOutput defines CSV output options.

type SelectInputSerialization

type SelectInputSerialization struct {
	CompressionType string              `xml:"CompressionType,omitempty"` // NONE, GZIP, BZIP2
	CSV             *SelectCSVInput     `xml:"CSV,omitempty"`
	JSON            *SelectJSONInput    `xml:"JSON,omitempty"`
	Parquet         *SelectParquetInput `xml:"Parquet,omitempty"`
}

SelectInputSerialization defines input data format.

type SelectJSONInput

type SelectJSONInput struct {
	Type string `xml:"Type,omitempty"` // DOCUMENT or LINES
}

SelectJSONInput defines JSON input options.

type SelectJSONOutput

type SelectJSONOutput struct {
	RecordDelimiter string `xml:"RecordDelimiter,omitempty"` // Record delimiter
}

SelectJSONOutput defines JSON output options.

type SelectObjectContentRequest

type SelectObjectContentRequest struct {
	XMLName             xml.Name                  `xml:"SelectObjectContentRequest"`
	Expression          string                    `xml:"Expression"`
	ExpressionType      string                    `xml:"ExpressionType"`
	InputSerialization  SelectInputSerialization  `xml:"InputSerialization"`
	OutputSerialization SelectOutputSerialization `xml:"OutputSerialization"`
	RequestProgress     *SelectRequestProgress    `xml:"RequestProgress,omitempty"`
	ScanRange           *SelectScanRange          `xml:"ScanRange,omitempty"`
}

SelectObjectContentRequest is the XML request body for SelectObjectContent.

type SelectOutputSerialization

type SelectOutputSerialization struct {
	CSV  *SelectCSVOutput  `xml:"CSV,omitempty"`
	JSON *SelectJSONOutput `xml:"JSON,omitempty"`
}

SelectOutputSerialization defines output data format.

type SelectParquetInput

type SelectParquetInput struct {
}

SelectParquetInput defines Parquet input options.

type SelectRequestProgress

type SelectRequestProgress struct {
	Enabled bool `xml:"Enabled"`
}

SelectRequestProgress enables progress reporting.

type SelectScanRange

type SelectScanRange struct {
	Start int64 `xml:"Start"`
	End   int64 `xml:"End"`
}

SelectScanRange specifies byte range to scan.

type ServerConfig

type ServerConfig struct {
	ManagerClient     client.Manager
	Chain             *filter.Chain
	GlobalBucketCache *cache.GlobalBucketCache
	BucketStore       *cache.BucketStore
	Pools             *types.PoolSet
	Profiles          *types.ProfileSet
	ProfilePlacer     *placer.ProfilePlacer
	BackendManager    *backend.Manager
	DB                db.DB
	DefaultProfile    string
	FileClientPool    client.File
	CRRHook           *CRRHook               // Enterprise: cross-region replication hook
	IAMService        *iam.Service           // IAM service for KMS operations (enterprise feature)
	KMSProvider       encryption.KMSProvider // External KMS provider (enterprise: AWS KMS, Vault)
	TaskQueue         taskqueue.Queue        // Optional: for GC decrement retry and background tasks

	// Cross-region replication configuration (enterprise: FeatureMultiRegion)
	RegionConfig           *RegionConfig          // For getting S3 endpoints per region
	ReplicationCredentials ReplicationCredentials // For authenticating to remote regions
	UsageConfig            usage.Config           // Usage reporting configuration
	UsageStore             usage.Store            // Usage data store (nil = use NopStore)
	AccessLogCollector     AccessLogCollector     // Access log collector (enterprise: FeatureAccessLog)
	Emitter                *events.Emitter        // Event emitter for S3 notifications (enterprise: FeatureEvents)

	// Lifecycle scanner configuration (community feature)
	LifecycleScannerEnabled  bool
	LifecycleScanInterval    time.Duration
	LifecycleScanConcurrency int
	LifecycleScanBatchSize   int
	LifecycleMaxTasksPerScan int
}

ServerConfig holds configuration for creating a MetadataServer

type SetDualWriteRequest

type SetDualWriteRequest struct {
	Enabled bool `json:"enabled"`
}

SetDualWriteRequest is the request body for PUT /admin/federation/buckets/{bucket}/dual-write

type SetModeRequest

type SetModeRequest struct {
	Mode                     string `json:"mode"` // "local", "passthrough", "migrating"
	DeleteExternalOnComplete bool   `json:"delete_external_on_complete,omitempty"`
}

SetModeRequest is the request body for PUT /admin/federation/buckets/{bucket}/mode

type UpdateCredentialsRequest

type UpdateCredentialsRequest struct {
	AccessKeyID     string `json:"access_key_id"`
	SecretAccessKey string `json:"secret_access_key"`
}

UpdateCredentialsRequest is the request for PUT /admin/federation/buckets/{bucket}/credentials

type UsageServiceConfig

type UsageServiceConfig struct {
	Store     usage.Store
	Collector usage.Collector
	Config    usage.Config
}

UsageServiceConfig holds dependencies for the usage reporting gRPC service.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL