package s3

import (
	"go.uber.org/zap"

	"codeberg.org/mapleopentech/monorepo/cloud/maplefile-backend/config"
)

// ProvideS3ObjectStorageProvider provides an S3 object storage provider for Wire DI
func ProvideS3ObjectStorageProvider(cfg *config.Config, logger *zap.Logger) S3ObjectStorage {
	s3Config := NewS3ObjectStorageConfigurationProvider(
		cfg.S3.AccessKey,
		cfg.S3.SecretKey,
		cfg.S3.Endpoint,
		cfg.S3.Region,
		cfg.S3.BucketName,
		false,               // isPublicBucket - set to false for security
		cfg.S3.UsePathStyle, // true for SeaweedFS/MinIO, false for DO Spaces/AWS S3
	)
	return NewObjectStorage(s3Config, logger)
}
