Bulk-Move für Objects
Mehrfachauswahl in der Objekttabelle (Checkboxen + Alle-auswählen), neues Popup zum Verschieben in einen anderen Bucket, Move via Copy+Delete gegen die bestehende S3-Schnittstelle. sigv4 kann jetzt zusätzliche Header signieren (x-amz-copy-source), sonst nix am Backend angefasst wie gewünscht.
This commit is contained in:
+20
-4
@@ -11,22 +11,38 @@ export async function signS3Get(path: string, accessKey: string, secretKey: stri
|
||||
return signS3('GET', path, await sha256Hex(''), accessKey, secretKey)
|
||||
}
|
||||
|
||||
export async function signS3Put(path: string, accessKey: string, secretKey: string): Promise<SignedHeaders> {
|
||||
return signS3('PUT', path, 'UNSIGNED-PAYLOAD', accessKey, secretKey)
|
||||
export async function signS3Put(
|
||||
path: string,
|
||||
accessKey: string,
|
||||
secretKey: string,
|
||||
extraHeaders?: Record<string, string>,
|
||||
): Promise<SignedHeaders> {
|
||||
return signS3('PUT', path, 'UNSIGNED-PAYLOAD', accessKey, secretKey, extraHeaders)
|
||||
}
|
||||
|
||||
export async function signS3Delete(path: string, accessKey: string, secretKey: string): Promise<SignedHeaders> {
|
||||
return signS3('DELETE', path, await sha256Hex(''), accessKey, secretKey)
|
||||
}
|
||||
|
||||
async function signS3(method: string, path: string, payloadHash: string, accessKey: string, secretKey: string): Promise<SignedHeaders> {
|
||||
async function signS3(
|
||||
method: string,
|
||||
path: string,
|
||||
payloadHash: string,
|
||||
accessKey: string,
|
||||
secretKey: string,
|
||||
extraHeaders?: Record<string, string>,
|
||||
): Promise<SignedHeaders> {
|
||||
const amzDate = toAmzDate(new Date())
|
||||
const dateStamp = amzDate.slice(0, 8)
|
||||
|
||||
const signedHeaderValues: Record<string, string> = {
|
||||
const unsortedHeaderValues: Record<string, string> = {
|
||||
'x-amz-content-sha256': payloadHash,
|
||||
'x-amz-date': amzDate,
|
||||
...extraHeaders,
|
||||
}
|
||||
const signedHeaderValues = Object.fromEntries(
|
||||
Object.entries(unsortedHeaderValues).sort(([a], [b]) => a.localeCompare(b)),
|
||||
)
|
||||
const signedHeaders = Object.keys(signedHeaderValues).join(';')
|
||||
const canonicalHeaders = Object.entries(signedHeaderValues)
|
||||
.map(([name, value]) => `${name}:${value}\n`)
|
||||
|
||||
Reference in New Issue
Block a user