@davidwells/llrt-analyzer 0.1.0 → 0.1.1
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/data/known-quirks.0.8.1-beta.json +10 -0
- package/package.json +1 -1
- package/src/cli.js +8 -2
|
@@ -22,6 +22,16 @@
|
|
|
22
22
|
"fix": "Use a pure-JS constant-time compare (XOR-accumulate over two equal-length buffers, length-check first) instead of timingSafeEqual.",
|
|
23
23
|
"tracking": "https://github.com/honojs/hono/issues/3914"
|
|
24
24
|
},
|
|
25
|
+
{
|
|
26
|
+
"id": "buffer-base64url-encoding",
|
|
27
|
+
"signature": "[\"']base64url[\"']",
|
|
28
|
+
"files": "firstParty",
|
|
29
|
+
"severity": "blocker",
|
|
30
|
+
"api": "Buffer 'base64url' encoding",
|
|
31
|
+
"note": "LLRT 0.8.x does not support the 'base64url' Buffer encoding — Buffer.from(x,'base64url') and Buffer#toString('base64url') throw 'The \"base64url\" encoding is not supported'. Pervasive in JWS/JWT parsing (e.g. verifying a Netlify x-nf-sign header), PKCE, and opaque-token generation, so a single use can 403 every request. Verified on real Lambda: it broke the mcp-gateway proxy assertion check.",
|
|
32
|
+
"fix": "LLRT supports standard 'base64'. Encode: toString('base64') then .replace(/\\+/g,'-').replace(/\\//g,'_').replace(/=+$/,''). Decode: restore (-_ -> +/), re-pad to length%4, then Buffer.from(x,'base64'). Wrap in a small base64url helper and swap the call sites.",
|
|
33
|
+
"tracking": "https://github.com/awslabs/llrt/issues"
|
|
34
|
+
},
|
|
25
35
|
{
|
|
26
36
|
"id": "response-body-rewrap",
|
|
27
37
|
"signature": "new\\s+Response\\s*\\([^)]{0,80}\\.body\\b",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@davidwells/llrt-analyzer",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Per-function analyzer that decides (statically + by actually running under LLRT) whether a Lambda function can switch to AWS LLRT for ~10x faster cold starts, and helps flip it.",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"bin": {
|
package/src/cli.js
CHANGED
|
@@ -36,6 +36,7 @@ function parseArgs(argv) {
|
|
|
36
36
|
else if (a === '--region') args.flags.region = argv[(i += 1)]
|
|
37
37
|
else if (a === '--profile') args.flags.profile = argv[(i += 1)]
|
|
38
38
|
else if (a === '--layer-name') args.flags.layerName = argv[(i += 1)]
|
|
39
|
+
else if (a === '--sdk') args.flags.sdk = argv[(i += 1)]
|
|
39
40
|
else if (a === '--ssm') args.flags.ssm = argv[(i += 1)]
|
|
40
41
|
else if (a === '--stage') args.flags.stage = argv[(i += 1)]
|
|
41
42
|
else args._.push(a)
|
|
@@ -61,6 +62,8 @@ Analyze options:
|
|
|
61
62
|
|
|
62
63
|
publish-layer options:
|
|
63
64
|
--arch <arm64|x64> Layer architecture (default arm64).
|
|
65
|
+
--sdk <full-sdk|no-sdk> SDK bundle variant (default std). Use full-sdk if the
|
|
66
|
+
function imports a client outside LLRT's std bundle.
|
|
64
67
|
--region <region> AWS region (default us-east-1).
|
|
65
68
|
--profile <name> AWS profile.
|
|
66
69
|
--layer-name <name> Layer name (default llrt-<arch>).
|
|
@@ -178,8 +181,11 @@ async function cmdPublishLayer(flags) {
|
|
|
178
181
|
const arch = flags.arch === 'x64' ? 'x64' : 'arm64'
|
|
179
182
|
const region = flags.region || 'us-east-1'
|
|
180
183
|
const version = ORG_PINNED_LLRT_VERSION
|
|
181
|
-
|
|
182
|
-
|
|
184
|
+
// SDK variant: 'std' (default), 'full-sdk' (all @aws-sdk clients), 'no-sdk'.
|
|
185
|
+
// Use full-sdk if the function imports a client outside LLRT's std bundle.
|
|
186
|
+
const sdkSuffix = flags.sdk === 'full-sdk' ? '-full-sdk' : flags.sdk === 'no-sdk' ? '-no-sdk' : ''
|
|
187
|
+
const layerName = flags.layerName || `llrt-${arch}${sdkSuffix}`
|
|
188
|
+
const asset = `llrt-lambda-${arch}${sdkSuffix}.zip`
|
|
183
189
|
const url = `https://github.com/awslabs/llrt/releases/download/v${version}/${asset}`
|
|
184
190
|
const tmp = fs.mkdtempSync(path.join(os.tmpdir(), 'llrt-layer-'))
|
|
185
191
|
const zip = path.join(tmp, asset)
|