fix(medusa-interfaces, medusa-file-*): flag for streaming to a private bucket (#4771)

* wip: unify file service api

* fix: flag type

* fix: update Spaces service

* fix: S3/Spaces - default to private

* fix: MinIO `isPrivate` for `getPresignedDownloadUrl`, add `isPrivate` to `GetUploadedFileType`

* chore: changeset
This commit is contained in:
Frane Polić
2023-08-22 13:05:30 +02:00
committed by GitHub
parent 80d603a63d
commit edf9ed4e59
5 changed files with 29 additions and 14 deletions
+3 -1
View File
@@ -109,9 +109,11 @@ class S3Service extends AbstractFileService implements IFileService {
const client = this.getClient()
const pass = new stream.PassThrough()
const isPrivate = fileData.isPrivate ?? true // default to private
const fileKey = `${fileData.name}.${fileData.ext}`
const params: PutObjectRequest = {
ACL: fileData.acl ?? "private",
ACL: isPrivate ? "private" : "public-read",
Bucket: this.bucket_,
Body: pass,
Key: fileKey,