@constructive-io/bucket-provisioner 0.30.1 → 0.31.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 +3 -2
- package/cors.d.ts +3 -3
- package/cors.js +4 -4
- package/esm/cors.d.ts +3 -3
- package/esm/cors.js +4 -4
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -224,7 +224,8 @@ CORS rules for public/temp buckets (PUT, GET, HEAD).
|
|
|
224
224
|
|
|
225
225
|
#### `buildPrivateCorsRules(allowedOrigins, maxAgeSeconds?)`
|
|
226
226
|
|
|
227
|
-
CORS rules for private buckets (PUT, HEAD
|
|
227
|
+
CORS rules for private buckets (PUT, GET, HEAD for the configured origins).
|
|
228
|
+
Presigned downloads still require browser CORS; allowing GET does not grant unsigned object access.
|
|
228
229
|
|
|
229
230
|
### Lifecycle Builders
|
|
230
231
|
|
|
@@ -273,7 +274,7 @@ Error codes:
|
|
|
273
274
|
|
|
274
275
|
| Access Type | Block Public Access | Bucket Policy | CORS Methods | Lifecycle |
|
|
275
276
|
|-------------|-------------------|---------------|--------------|-----------|
|
|
276
|
-
| `private` | All blocked | None (deleted) | PUT, HEAD | None |
|
|
277
|
+
| `private` | All blocked | None (deleted) | PUT, GET, HEAD | None |
|
|
277
278
|
| `public` | Partially relaxed | Public-read | PUT, GET, HEAD | None |
|
|
278
279
|
| `temp` | All blocked | None (deleted) | PUT, GET, HEAD | Auto-expire (1 day) |
|
|
279
280
|
|
package/cors.d.ts
CHANGED
|
@@ -23,9 +23,9 @@ export declare function buildUploadCorsRules(allowedOrigins: string[], maxAgeSec
|
|
|
23
23
|
/**
|
|
24
24
|
* Build restrictive CORS rules for private-only buckets.
|
|
25
25
|
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
26
|
+
* Presigned GETs still need CORS for browser fetch/preview. Allow reads from
|
|
27
|
+
* the configured origins; S3 authorization and public-access blocking still
|
|
28
|
+
* reject unsigned access to private objects.
|
|
29
29
|
*
|
|
30
30
|
* @param allowedOrigins - Domains allowed to make cross-origin requests.
|
|
31
31
|
* @param maxAgeSeconds - Preflight cache duration (default: 3600 = 1 hour)
|
package/cors.js
CHANGED
|
@@ -53,9 +53,9 @@ function buildUploadCorsRules(allowedOrigins, maxAgeSeconds = 3600) {
|
|
|
53
53
|
/**
|
|
54
54
|
* Build restrictive CORS rules for private-only buckets.
|
|
55
55
|
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
56
|
+
* Presigned GETs still need CORS for browser fetch/preview. Allow reads from
|
|
57
|
+
* the configured origins; S3 authorization and public-access blocking still
|
|
58
|
+
* reject unsigned access to private objects.
|
|
59
59
|
*
|
|
60
60
|
* @param allowedOrigins - Domains allowed to make cross-origin requests.
|
|
61
61
|
* @param maxAgeSeconds - Preflight cache duration (default: 3600 = 1 hour)
|
|
@@ -67,7 +67,7 @@ function buildPrivateCorsRules(allowedOrigins, maxAgeSeconds = 3600) {
|
|
|
67
67
|
return [
|
|
68
68
|
{
|
|
69
69
|
allowedOrigins,
|
|
70
|
-
allowedMethods: ['PUT', 'HEAD'],
|
|
70
|
+
allowedMethods: ['PUT', 'GET', 'HEAD'],
|
|
71
71
|
allowedHeaders: [
|
|
72
72
|
'Content-Type',
|
|
73
73
|
'Content-Length',
|
package/esm/cors.d.ts
CHANGED
|
@@ -23,9 +23,9 @@ export declare function buildUploadCorsRules(allowedOrigins: string[], maxAgeSec
|
|
|
23
23
|
/**
|
|
24
24
|
* Build restrictive CORS rules for private-only buckets.
|
|
25
25
|
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
26
|
+
* Presigned GETs still need CORS for browser fetch/preview. Allow reads from
|
|
27
|
+
* the configured origins; S3 authorization and public-access blocking still
|
|
28
|
+
* reject unsigned access to private objects.
|
|
29
29
|
*
|
|
30
30
|
* @param allowedOrigins - Domains allowed to make cross-origin requests.
|
|
31
31
|
* @param maxAgeSeconds - Preflight cache duration (default: 3600 = 1 hour)
|
package/esm/cors.js
CHANGED
|
@@ -49,9 +49,9 @@ export function buildUploadCorsRules(allowedOrigins, maxAgeSeconds = 3600) {
|
|
|
49
49
|
/**
|
|
50
50
|
* Build restrictive CORS rules for private-only buckets.
|
|
51
51
|
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
52
|
+
* Presigned GETs still need CORS for browser fetch/preview. Allow reads from
|
|
53
|
+
* the configured origins; S3 authorization and public-access blocking still
|
|
54
|
+
* reject unsigned access to private objects.
|
|
55
55
|
*
|
|
56
56
|
* @param allowedOrigins - Domains allowed to make cross-origin requests.
|
|
57
57
|
* @param maxAgeSeconds - Preflight cache duration (default: 3600 = 1 hour)
|
|
@@ -63,7 +63,7 @@ export function buildPrivateCorsRules(allowedOrigins, maxAgeSeconds = 3600) {
|
|
|
63
63
|
return [
|
|
64
64
|
{
|
|
65
65
|
allowedOrigins,
|
|
66
|
-
allowedMethods: ['PUT', 'HEAD'],
|
|
66
|
+
allowedMethods: ['PUT', 'GET', 'HEAD'],
|
|
67
67
|
allowedHeaders: [
|
|
68
68
|
'Content-Type',
|
|
69
69
|
'Content-Length',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@constructive-io/bucket-provisioner",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.31.0",
|
|
4
4
|
"author": "Constructive <developers@constructive.io>",
|
|
5
5
|
"description": "S3-compatible bucket provisioning library — create buckets, configure privacy policies, CORS, and access controls",
|
|
6
6
|
"main": "index.js",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@aws-sdk/client-s3": "^3.1052.0",
|
|
33
|
-
"@constructive-io/s3-utils": "^2.
|
|
33
|
+
"@constructive-io/s3-utils": "^2.35.0"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"makage": "^0.8.0"
|
|
@@ -44,5 +44,5 @@
|
|
|
44
44
|
"storage",
|
|
45
45
|
"constructive"
|
|
46
46
|
],
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "487c4ec9ee997d7da80584a3d41d7120d4354c54"
|
|
48
48
|
}
|