add nginx and temporary client stuff for public url

This commit is contained in:
StarAppeal
2025-09-26 01:31:20 +02:00
parent 7b38ec1660
commit ef7c285dee
6 changed files with 74 additions and 10 deletions
+6 -1
View File
@@ -27,6 +27,7 @@ const testConfig: S3ClientConfig = {
accessKey: "test-key",
secretAccessKey: "test-secret",
bucket: "test-bucket",
publicUrl: "http://test-publicUrl",
};
const MockS3Client = vi.mocked(S3Client);
@@ -46,6 +47,9 @@ describe("S3Service", () => {
}) as never
);
// @ts-ignore
S3Service.instance = undefined;
s3Service = S3Service.getInstance(testConfig);
});
@@ -174,10 +178,11 @@ describe("S3Service", () => {
});
});
// ignore test for now.
describe("getSignedDownloadUrl", () => {
it("should generate a signed URL for a given object key", async () => {
const objectKey = "user-123/image.png";
const fakeSignedUrl = "http://test-minio:9000/test-bucket/user-123/image.png?signed=true";
const fakeSignedUrl = "http://test-publicUrl/test-bucket/user-123/image.png?signed=true";
mockGetSignedUrl.mockResolvedValue(fakeSignedUrl);