@nitida/asset-compressor-native 0.2.1 → 0.2.2
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/LICENSE +21 -0
- package/README.md +1 -1
- package/SECURITY.md +56 -0
- package/package.json +4 -2
- package/src/index.ts +1 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Espacio Futuro LTD
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Fast, native (iOS + Android) image compression for React Native apps that
|
|
4
4
|
upload to the [aquienpz](https://aquienpz.com) asset platform. Pairs with
|
|
5
|
-
`@
|
|
5
|
+
`@nitida/asset-uploader-expo` and mirrors the API of
|
|
6
6
|
`@nitida/asset-compressor-web` so call sites are identical across
|
|
7
7
|
platforms.
|
|
8
8
|
|
package/SECURITY.md
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# Security
|
|
2
|
+
|
|
3
|
+
## Reporting a vulnerability
|
|
4
|
+
|
|
5
|
+
Email **security@espaciofuturo.io**. Please do not open a public issue — a
|
|
6
|
+
public report is a disclosure, and it reaches attackers at the same moment it
|
|
7
|
+
reaches us.
|
|
8
|
+
|
|
9
|
+
Include what you have: the affected package and version, what you did, and what
|
|
10
|
+
happened. A URL that reproduces it is worth more than a paragraph describing
|
|
11
|
+
one. We will confirm receipt and tell you what we found.
|
|
12
|
+
|
|
13
|
+
## What is in scope
|
|
14
|
+
|
|
15
|
+
The published client packages and the service they talk to:
|
|
16
|
+
|
|
17
|
+
- `@nitida/sdk`, `@nitida/asset-client`
|
|
18
|
+
- `@nitida/asset-compressor-web`, `@nitida/asset-compressor-native`
|
|
19
|
+
- `@nitida/asset-uploader-web`, `@nitida/asset-uploader-expo`
|
|
20
|
+
- the delivery edge (`8ok.uk`) and the API (`api.nitida.gofuture.space`)
|
|
21
|
+
|
|
22
|
+
## Two behaviours that look like bugs and are not
|
|
23
|
+
|
|
24
|
+
Reported often enough to state up front, so a real report is not lost among
|
|
25
|
+
them:
|
|
26
|
+
|
|
27
|
+
**A 404 on a private asset is the feature.** An asset with
|
|
28
|
+
`visibility: "private"` answers 404 on every public URL — the raw path, every
|
|
29
|
+
stored variant, every `/t/` transform and every HLS segment. It is not a
|
|
30
|
+
missing file. Signed access lives at `/a/{tenant}/…?exp&sig`, minted on your
|
|
31
|
+
backend. See the SDK's `getPrivateAssetUrl`.
|
|
32
|
+
|
|
33
|
+
**A presigned upload URL is a bearer credential, on purpose.** The browser
|
|
34
|
+
uploader persists presigned R2 PUT URLs in IndexedDB, because that is what
|
|
35
|
+
resuming after a reload means. They are write-only, scoped to the parts of one
|
|
36
|
+
upload the holder started, expire in 60 minutes, and are deleted on complete
|
|
37
|
+
and on abort.
|
|
38
|
+
|
|
39
|
+
## Credentials, and the one mistake that matters
|
|
40
|
+
|
|
41
|
+
An API key (`amk_rt_*`, `amk_ad_*`, `amk_ci_*`) is a **server-side** credential.
|
|
42
|
+
It must never reach a browser bundle, an `NEXT_PUBLIC_*` variable, or a mobile
|
|
43
|
+
app binary.
|
|
44
|
+
|
|
45
|
+
The same goes for a tenant's **URL signing key**: it mints signed URLs for
|
|
46
|
+
every private asset that tenant owns. Sign on your backend, or pre-sign at
|
|
47
|
+
build time.
|
|
48
|
+
|
|
49
|
+
The client packages are built so this is hard to get wrong — the web entrypoint
|
|
50
|
+
`@nitida/sdk/web` does not accept `apiKey` or `signingKey` at all; the types
|
|
51
|
+
reject them. If you find a path that leaks either one, that is exactly the
|
|
52
|
+
report we want.
|
|
53
|
+
|
|
54
|
+
If you believe a key has been exposed, email the address above and we will
|
|
55
|
+
rotate it. Rotating a signing key invalidates every URL already signed with it,
|
|
56
|
+
so tell us whether you have signed URLs in circulation.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nitida/asset-compressor-native",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "nitida image compression for React Native and Expo. Same JS API as @nitida/asset-compressor-web, so call sites are identical across web and native.",
|
|
5
5
|
"private": false,
|
|
6
6
|
"publishConfig": {
|
|
@@ -13,7 +13,8 @@
|
|
|
13
13
|
"directory": "packages/asset-compressor-native"
|
|
14
14
|
},
|
|
15
15
|
"homepage": "https://nitida.gofuture.space",
|
|
16
|
-
"license": "
|
|
16
|
+
"license": "MIT",
|
|
17
|
+
"author": "Espacio Futuro LTD (https://espaciofuturo.io)",
|
|
17
18
|
"type": "module",
|
|
18
19
|
"sideEffects": false,
|
|
19
20
|
"main": "./dist/index.js",
|
|
@@ -27,6 +28,7 @@
|
|
|
27
28
|
}
|
|
28
29
|
},
|
|
29
30
|
"files": [
|
|
31
|
+
"SECURITY.md",
|
|
30
32
|
"dist/**",
|
|
31
33
|
"src/**"
|
|
32
34
|
],
|
package/src/index.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @nitida/asset-compressor-native — React Native image compression for
|
|
3
|
-
* the @aquienpz upload pipeline. Pairs with @
|
|
3
|
+
* the @aquienpz upload pipeline. Pairs with @nitida/asset-uploader-expo.
|
|
4
4
|
*
|
|
5
5
|
* Public API mirrors @nitida/asset-compressor-web so consumers can
|
|
6
6
|
* write platform-agnostic code:
|