fix(medusa-file-minio): Minio private bucket default (#4540)
* default "getUploadDescriptor" to private (similar to aws + digital ocean) * add changeset
This commit is contained in:
1 parent
4e2e58881a
commit
950a581690
2 files changed
+12
-6
No files matched your search
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"medusa-file-minio": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
fix(medusa-file-minio): default getUploadDescriptor to private
|
||||||
@@ -1,7 +1,3 @@
|
|||||||
import stream from "stream"
|
|
||||||
import aws from "aws-sdk"
|
|
||||||
import { parse } from "path"
|
|
||||||
import fs from "fs"
|
|
||||||
import {
|
import {
|
||||||
AbstractFileService,
|
AbstractFileService,
|
||||||
DeleteFileType,
|
DeleteFileType,
|
||||||
@@ -10,9 +6,14 @@ import {
|
|||||||
IFileService,
|
IFileService,
|
||||||
UploadStreamDescriptorType,
|
UploadStreamDescriptorType,
|
||||||
} from "@medusajs/medusa"
|
} from "@medusajs/medusa"
|
||||||
import { MedusaError } from "medusa-core-utils"
|
|
||||||
import { ClientConfiguration, PutObjectRequest } from "aws-sdk/clients/s3"
|
import { ClientConfiguration, PutObjectRequest } from "aws-sdk/clients/s3"
|
||||||
|
|
||||||
|
import { MedusaError } from "medusa-core-utils"
|
||||||
|
import aws from "aws-sdk"
|
||||||
|
import fs from "fs"
|
||||||
|
import { parse } from "path"
|
||||||
|
import stream from "stream"
|
||||||
|
|
||||||
class MinioService extends AbstractFileService implements IFileService {
|
class MinioService extends AbstractFileService implements IFileService {
|
||||||
protected bucket_: string
|
protected bucket_: string
|
||||||
protected accessKeyId_: string
|
protected accessKeyId_: string
|
||||||
@@ -123,7 +124,7 @@ class MinioService extends AbstractFileService implements IFileService {
|
|||||||
contentType?: string
|
contentType?: string
|
||||||
}
|
}
|
||||||
) {
|
) {
|
||||||
const usePrivateBucket = !!fileData.usePrivateBucket
|
const usePrivateBucket = fileData.usePrivateBucket ?? true
|
||||||
|
|
||||||
this.validatePrivateBucketConfiguration_(usePrivateBucket)
|
this.validatePrivateBucketConfiguration_(usePrivateBucket)
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user