@ultimat3/storage 31.50.0 → 31.52.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -1
- package/package.json +2 -2
- package/src/driver-s3-signed.ts +7 -0
package/README.md
CHANGED
|
@@ -86,7 +86,10 @@ option, then `S3_ENDPOINT`/`AWS_ENDPOINT`, `S3_REGION`/`AWS_REGION`,
|
|
|
86
86
|
`<bucket>.<endpoint host>` — or the endpoint as given when its host already starts with
|
|
87
87
|
`<bucket>.` (`https://media.acct.r2.cloudflarestorage.com`), never the bucket twice.
|
|
88
88
|
`s3Driver({ fetch, clock })` inject the signed path's transport and its clock (tests; default the
|
|
89
|
-
global `fetch` and `systemClock`); `S3FetchLike` is the shape.
|
|
89
|
+
global `fetch` and `systemClock`); `S3FetchLike` is the shape. The signed path sends through the
|
|
90
|
+
app-wide egress proxy (`outbound.proxy`; `init.proxy`), an endpoint on loopback or an
|
|
91
|
+
`outbound.direct` host excepted. `Bun.S3Client`'s plain calls do not: it takes no proxy option and
|
|
92
|
+
honours only the process-wide `HTTPS_PROXY` / `HTTP_PROXY` / `NO_PROXY` (measured, Bun 1.4.4).
|
|
90
93
|
`localDriver` keeps content type, etag, `cacheControl` and `metadata` in a `<root>/.meta/`
|
|
91
94
|
sidecar so `get()`/`list()` round-trip everything `put()` was handed; sidecars never appear in
|
|
92
95
|
`list()`. `s3Driver` STORES both — a `put()` carrying `cacheControl`, `metadata`, `retention` or
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ultimat3/storage",
|
|
3
|
-
"version": "31.
|
|
3
|
+
"version": "31.52.0",
|
|
4
4
|
"description": "Named disks over Bun.file and Bun.s3: safe keys, signed URLs, sniffed uploads",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ultimate",
|
|
@@ -43,6 +43,6 @@
|
|
|
43
43
|
"test": "bun test"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@ultimat3/core": "31.
|
|
46
|
+
"@ultimat3/core": "31.52.0"
|
|
47
47
|
}
|
|
48
48
|
}
|
package/src/driver-s3-signed.ts
CHANGED
|
@@ -17,6 +17,7 @@ import {
|
|
|
17
17
|
systemClock,
|
|
18
18
|
trimTrailingSlashes,
|
|
19
19
|
} from '@ultimat3/core';
|
|
20
|
+
import { ambientProxyFor } from '@ultimat3/core/outbound';
|
|
20
21
|
import type { SignedPart } from './signed-url';
|
|
21
22
|
|
|
22
23
|
/** The slice of `fetch` this file uses; injected in tests so no socket is ever opened. */
|
|
@@ -26,6 +27,8 @@ export type S3FetchLike = (
|
|
|
26
27
|
readonly method: string;
|
|
27
28
|
readonly headers: Readonly<Record<string, string>>;
|
|
28
29
|
readonly body?: Uint8Array<ArrayBuffer> | undefined;
|
|
30
|
+
/** The app-wide egress proxy (`outbound.proxy`), when this endpoint takes it. */
|
|
31
|
+
readonly proxy?: string | undefined;
|
|
29
32
|
},
|
|
30
33
|
) => Promise<Response>;
|
|
31
34
|
|
|
@@ -284,9 +287,13 @@ export async function sendSigned(
|
|
|
284
287
|
});
|
|
285
288
|
const send = options.fetch ?? fetch;
|
|
286
289
|
const body = request.body;
|
|
290
|
+
// Not `outbound()` (the provider's XML refusals, streamed bodies), so the app-wide egress proxy
|
|
291
|
+
// is asked here; an in-cluster endpoint named in `outbound.direct`, or loopback, stays direct.
|
|
292
|
+
const proxy = ambientProxyFor(signed.url);
|
|
287
293
|
const response = await send(signed.url, {
|
|
288
294
|
method: signed.method,
|
|
289
295
|
headers: signed.headers,
|
|
296
|
+
...(proxy === undefined ? {} : { proxy }),
|
|
290
297
|
// `fetch` takes an ArrayBuffer-backed view; only a view over shared memory is copied.
|
|
291
298
|
...(body === undefined
|
|
292
299
|
? {}
|