feat(ops): add object storage management and site-mapping CSV import/export
Ship the Ops backstage 对象存储 page (browse / upload / move / delete / folder ops) backed by a new object-storage service + handler, with the shared storage client extended with List/Stat/Copy/Usage/DownloadURL so both MinIO and Aliyun providers cover the new surface. Add ForcePathStyle to the object-storage config and treat r2/s3/custom_s3 as external providers so Cloudflare R2 and other S3-compatibles can share the MinIO client path without spinning up the bundled MinIO. Also add CSV import/export + template download to the site-domain mappings page, raise gin MaxMultipartMemory to 8 MiB for the new multipart endpoints, register Ops swagger routes, and extend the descriptions-parity test to cover the ops router. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -51,3 +51,23 @@ func TestNormalizeObjectKeyPathDecodesEncodedSegments(t *testing.T) {
|
||||
t.Fatalf("object key = %q, want %q", got, want)
|
||||
}
|
||||
}
|
||||
|
||||
func TestDownloadContentDispositionUsesRFC5987FileName(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
got := DownloadContentDisposition("reports/省心推 安装包.zip")
|
||||
want := `attachment; filename="object.zip"; filename*=UTF-8''%E7%9C%81%E5%BF%83%E6%8E%A8%20%E5%AE%89%E8%A3%85%E5%8C%85.zip`
|
||||
if got != want {
|
||||
t.Fatalf("content disposition = %q, want %q", got, want)
|
||||
}
|
||||
}
|
||||
|
||||
func TestDownloadContentDispositionKeepsASCIIFileNameFallback(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
got := DownloadContentDisposition(`reports/report "final".csv`)
|
||||
want := `attachment; filename="report final.csv"; filename*=UTF-8''report%20final.csv`
|
||||
if got != want {
|
||||
t.Fatalf("content disposition = %q, want %q", got, want)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user