Skip to content

Commit 050e021

Browse files
committed
refactor: update version to 0.3.6 and enhance S3 client configuration for checksum handling
1 parent 081196d commit 050e021

3 files changed

Lines changed: 18 additions & 1 deletion

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@yinxulai/database-backup",
3-
"version": "0.3.5",
3+
"version": "0.3.6",
44
"description": "Multi-mode database backup tool with CI-first architecture",
55
"type": "module",
66
"bin": {

source/adapters/storage/s3.test.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,21 @@ describe('S3StorageDriver', () => {
8585
expect(typeof driver.delete).toBe('function')
8686
expect(typeof driver.list).toBe('function')
8787
})
88+
89+
it('should configure the S3 client for streaming uploads', async () => {
90+
const driver = new S3StorageDriver(mockConfig)
91+
const internalDriver = driver as unknown as {
92+
client: {
93+
config: {
94+
requestChecksumCalculation?: () => Promise<string>
95+
responseChecksumValidation?: () => Promise<string>
96+
}
97+
}
98+
}
99+
100+
await expect(internalDriver.client.config.requestChecksumCalculation?.()).resolves.toBe('WHEN_REQUIRED')
101+
await expect(internalDriver.client.config.responseChecksumValidation?.()).resolves.toBe('WHEN_REQUIRED')
102+
})
88103
})
89104

90105
describe('upload', () => {

source/adapters/storage/s3.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ export class S3StorageDriver implements StorageDriver {
3737
secretAccessKey: config.secretAccessKey,
3838
},
3939
forcePathStyle: config.forcePathStyle,
40+
requestChecksumCalculation: 'WHEN_REQUIRED',
41+
responseChecksumValidation: 'WHEN_REQUIRED',
4042
})
4143
this.logger = logger ?? createLogger()
4244
}

0 commit comments

Comments
 (0)