@arokodev/cli 0.1.0-alpha.5 → 0.1.0-alpha.8
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/node_modules/@pairmesh/client/dist/build-info.generated.d.ts +12 -12
- package/node_modules/@pairmesh/client/dist/build-info.generated.js +6 -6
- package/node_modules/@pairmesh/client/dist/connectivity/relay/hosted-server.js +1 -1
- package/node_modules/@pairmesh/client/dist/session/schemas.d.ts +10 -10
- package/node_modules/@pairmesh/client/dist/session/schemas.d.ts.map +1 -1
- package/node_modules/@pairmesh/client/package.json +5 -5
- package/node_modules/@pairmesh/coordination/package.json +5 -5
- package/node_modules/@pairmesh/mcp/package.json +5 -5
- package/node_modules/@pairmesh/permissions/package.json +2 -2
- package/node_modules/@pairmesh/protocol/dist/action.d.ts +1 -1
- package/node_modules/@pairmesh/protocol/dist/inspection-execution.d.ts +1 -1
- package/node_modules/@pairmesh/protocol/dist/inspection-thread.d.ts +1 -1
- package/node_modules/@pairmesh/protocol/dist/inspection-thread.d.ts.map +1 -1
- package/node_modules/@pairmesh/protocol/dist/inspection.d.ts +2 -2
- package/node_modules/@pairmesh/protocol/dist/pairing.d.ts +1 -1
- package/node_modules/@pairmesh/protocol/dist/progress-event.d.ts +1 -1
- package/node_modules/@pairmesh/protocol/dist/progress-event.d.ts.map +1 -1
- package/node_modules/@pairmesh/protocol/package.json +2 -2
- package/node_modules/@pairmesh/shared/package.json +1 -1
- package/node_modules/body-parser/README.md +17 -13
- package/node_modules/body-parser/lib/read.js +74 -57
- package/node_modules/body-parser/lib/types/json.js +11 -11
- package/node_modules/body-parser/lib/types/urlencoded.js +5 -5
- package/node_modules/body-parser/lib/utils.js +0 -15
- package/node_modules/body-parser/package.json +7 -12
- package/node_modules/encodeurl/README.md +14 -0
- package/node_modules/encodeurl/index.js +9 -11
- package/node_modules/encodeurl/package.json +13 -6
- package/node_modules/jose/README.md +2 -2
- package/node_modules/jose/dist/types/jwe/compact/decrypt.d.ts +5 -4
- package/node_modules/jose/dist/types/jwe/compact/encrypt.d.ts +4 -4
- package/node_modules/jose/dist/types/jwe/flattened/decrypt.d.ts +5 -4
- package/node_modules/jose/dist/types/jwe/flattened/encrypt.d.ts +5 -5
- package/node_modules/jose/dist/types/jwe/general/decrypt.d.ts +5 -4
- package/node_modules/jose/dist/types/jwe/general/encrypt.d.ts +5 -5
- package/node_modules/jose/dist/types/jws/compact/sign.d.ts +5 -4
- package/node_modules/jose/dist/types/jws/compact/verify.d.ts +5 -5
- package/node_modules/jose/dist/types/jws/flattened/sign.d.ts +5 -4
- package/node_modules/jose/dist/types/jws/flattened/verify.d.ts +6 -5
- package/node_modules/jose/dist/types/jws/general/sign.d.ts +9 -6
- package/node_modules/jose/dist/types/jws/general/verify.d.ts +7 -5
- package/node_modules/jose/dist/types/jwt/decrypt.d.ts +10 -6
- package/node_modules/jose/dist/types/jwt/encrypt.d.ts +1 -1
- package/node_modules/jose/dist/types/jwt/sign.d.ts +1 -1
- package/node_modules/jose/dist/types/jwt/unsecured.d.ts +3 -1
- package/node_modules/jose/dist/types/jwt/verify.d.ts +6 -5
- package/node_modules/jose/dist/types/key/export.d.ts +1 -1
- package/node_modules/jose/dist/types/key/generate_secret.d.ts +1 -1
- package/node_modules/jose/dist/types/key/import.d.ts +2 -2
- package/node_modules/jose/dist/types/types.d.ts +173 -107
- package/node_modules/jose/dist/types/util/decode_jwt.d.ts +3 -2
- package/node_modules/jose/dist/types/util/errors.d.ts +1 -1
- package/node_modules/jose/dist/webapi/jwe/general/decrypt.js +3 -2
- package/node_modules/jose/dist/webapi/jwe/general/encrypt.js +3 -3
- package/node_modules/jose/dist/webapi/jwk/thumbprint.js +8 -8
- package/node_modules/jose/dist/webapi/jwks/local.js +2 -1
- package/node_modules/jose/dist/webapi/jwks/remote.js +6 -4
- package/node_modules/jose/dist/webapi/jws/general/sign.js +3 -3
- package/node_modules/jose/dist/webapi/jws/general/verify.js +5 -11
- package/node_modules/jose/dist/webapi/jwt/encrypt.js +6 -9
- package/node_modules/jose/dist/webapi/jwt/sign.js +2 -2
- package/node_modules/jose/dist/webapi/jwt/unsecured.js +3 -3
- package/node_modules/jose/dist/webapi/key/generate_secret.js +4 -4
- package/node_modules/jose/dist/webapi/lib/asn1.js +2 -2
- package/node_modules/jose/dist/webapi/lib/buffer_utils.js +4 -4
- package/node_modules/jose/dist/webapi/lib/content_encryption.js +8 -8
- package/node_modules/jose/dist/webapi/lib/deflate.js +2 -1
- package/node_modules/jose/dist/webapi/lib/jwe_decrypt.js +26 -23
- package/node_modules/jose/dist/webapi/lib/jwe_encrypt.js +5 -5
- package/node_modules/jose/dist/webapi/lib/jws_algorithms.js +2 -2
- package/node_modules/jose/dist/webapi/lib/jws_sign.js +11 -11
- package/node_modules/jose/dist/webapi/lib/jws_verify.js +19 -16
- package/node_modules/jose/dist/webapi/lib/jwt_claims_set.js +48 -44
- package/node_modules/jose/dist/webapi/lib/key.js +6 -4
- package/node_modules/jose/dist/webapi/lib/key_management.js +17 -18
- package/node_modules/jose/dist/webapi/lib/validate.js +10 -10
- package/node_modules/jose/dist/webapi/util/decode_jwt.js +12 -12
- package/node_modules/jose/dist/webapi/util/decode_protected_header.js +5 -5
- package/node_modules/jose/package.json +1 -1
- package/node_modules/object-inspect/CHANGELOG.md +31 -0
- package/node_modules/object-inspect/index.js +326 -24
- package/node_modules/object-inspect/package.json +22 -13
- package/node_modules/object-inspect/readme.markdown +4 -1
- package/node_modules/object-inspect/stringWidth.js +68 -0
- package/node_modules/object-inspect/stringWidthRanges.js +38 -0
- package/node_modules/on-finished/index.js +14 -2
- package/node_modules/on-finished/package.json +11 -7
- package/node_modules/qs/.editorconfig +1 -1
- package/node_modules/qs/.github/THREAT_MODEL.md +4 -2
- package/node_modules/qs/CHANGELOG.md +103 -14
- package/node_modules/qs/README.md +90 -9
- package/node_modules/qs/dist/qs.js +19 -19
- package/node_modules/qs/eslint.config.mjs +61 -50
- package/node_modules/qs/lib/formats.js +7 -2
- package/node_modules/qs/lib/parse.js +121 -12
- package/node_modules/qs/lib/stringify.js +9 -7
- package/node_modules/qs/lib/utils.js +158 -15
- package/node_modules/qs/package.json +8 -8
- package/node_modules/qs/test/parse.js +509 -2
- package/node_modules/qs/test/stringify.js +485 -33
- package/node_modules/qs/test/utils.js +245 -3
- package/node_modules/router/HISTORY.md +67 -52
- package/node_modules/router/README.md +222 -2
- package/node_modules/router/index.d.ts +188 -0
- package/node_modules/router/index.js +86 -50
- package/node_modules/router/lib/layer.js +154 -47
- package/node_modules/router/lib/param.js +47 -0
- package/node_modules/router/lib/route.d.ts +118 -0
- package/node_modules/router/lib/route.js +14 -8
- package/node_modules/router/lib/symbols.js +4 -0
- package/node_modules/router/lib/tracing.js +173 -0
- package/node_modules/router/package.json +24 -9
- package/node_modules/ws/README.md +22 -31
- package/node_modules/ws/lib/buffer-util.js +13 -2
- package/node_modules/ws/lib/receiver.js +8 -0
- package/node_modules/ws/lib/sender.js +4 -1
- package/node_modules/ws/lib/websocket-server.js +3 -0
- package/node_modules/ws/lib/websocket.js +66 -16
- package/node_modules/ws/package.json +1 -1
- package/node_modules/zod/package.json +1 -1
- package/node_modules/zod/src/v4/classic/tests/array.test.ts +27 -0
- package/node_modules/zod/src/v4/classic/tests/map.test.ts +7 -0
- package/node_modules/zod/src/v4/classic/tests/set.test.ts +6 -0
- package/node_modules/zod/src/v4/core/compile.ts +9 -0
- package/node_modules/zod/src/v4/core/schemas.ts +35 -1
- package/node_modules/zod/src/v4/core/util.ts +13 -0
- package/node_modules/zod/src/v4/core/versions.ts +1 -1
- package/node_modules/zod/v4/core/compile.cjs +8 -0
- package/node_modules/zod/v4/core/compile.js +8 -0
- package/node_modules/zod/v4/core/schemas.cjs +30 -0
- package/node_modules/zod/v4/core/schemas.d.cts +3 -1
- package/node_modules/zod/v4/core/schemas.d.ts +3 -1
- package/node_modules/zod/v4/core/schemas.js +30 -0
- package/node_modules/zod/v4/core/util.cjs +15 -0
- package/node_modules/zod/v4/core/util.d.cts +2 -0
- package/node_modules/zod/v4/core/util.d.ts +2 -0
- package/node_modules/zod/v4/core/util.js +14 -0
- package/node_modules/zod/v4/core/versions.cjs +1 -1
- package/node_modules/zod/v4/core/versions.js +1 -1
- package/package.json +7 -7
- package/node_modules/object-inspect/.eslintrc +0 -53
- package/node_modules/object-inspect/.nycrc +0 -13
- package/node_modules/object-inspect/example/all.js +0 -23
- package/node_modules/object-inspect/example/circular.js +0 -6
- package/node_modules/object-inspect/example/fn.js +0 -5
- package/node_modules/object-inspect/example/inspect.js +0 -10
- package/node_modules/object-inspect/test/bigint.js +0 -58
- package/node_modules/object-inspect/test/browser/dom.js +0 -15
- package/node_modules/object-inspect/test/circular.js +0 -16
- package/node_modules/object-inspect/test/deep.js +0 -12
- package/node_modules/object-inspect/test/element.js +0 -53
- package/node_modules/object-inspect/test/err.js +0 -48
- package/node_modules/object-inspect/test/fakes.js +0 -29
- package/node_modules/object-inspect/test/fn.js +0 -76
- package/node_modules/object-inspect/test/global.js +0 -17
- package/node_modules/object-inspect/test/has.js +0 -15
- package/node_modules/object-inspect/test/holes.js +0 -15
- package/node_modules/object-inspect/test/indent-option.js +0 -271
- package/node_modules/object-inspect/test/inspect.js +0 -139
- package/node_modules/object-inspect/test/lowbyte.js +0 -12
- package/node_modules/object-inspect/test/number.js +0 -58
- package/node_modules/object-inspect/test/quoteStyle.js +0 -26
- package/node_modules/object-inspect/test/toStringTag.js +0 -40
- package/node_modules/object-inspect/test/undef.js +0 -12
- package/node_modules/object-inspect/test/values.js +0 -261
- package/node_modules/object-inspect/test-core-js.js +0 -26
- package/node_modules/on-finished/HISTORY.md +0 -98
|
@@ -17,7 +17,7 @@ const iconv = require('iconv-lite')
|
|
|
17
17
|
const onFinished = require('on-finished')
|
|
18
18
|
const zlib = require('node:zlib')
|
|
19
19
|
const hasBody = require('type-is').hasBody
|
|
20
|
-
const
|
|
20
|
+
const contentType = require('content-type')
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
23
|
* Module exports.
|
|
@@ -25,6 +25,12 @@ const { getCharset } = require('./utils')
|
|
|
25
25
|
|
|
26
26
|
module.exports = read
|
|
27
27
|
|
|
28
|
+
/**
|
|
29
|
+
* @const
|
|
30
|
+
* whether current node version has zstandard support
|
|
31
|
+
*/
|
|
32
|
+
const hasZstandardSupport = 'createZstdDecompress' in zlib
|
|
33
|
+
|
|
28
34
|
/**
|
|
29
35
|
* Read a request into a buffer and parse.
|
|
30
36
|
*
|
|
@@ -79,38 +85,53 @@ function read (req, res, next, parse, debug, options) {
|
|
|
79
85
|
}
|
|
80
86
|
|
|
81
87
|
let length
|
|
82
|
-
const opts = options
|
|
83
88
|
let stream
|
|
84
89
|
|
|
85
|
-
|
|
86
|
-
|
|
90
|
+
const verify = options.verify
|
|
91
|
+
|
|
92
|
+
// assert charset is supported before creating the decompression stream, so an
|
|
93
|
+
// unsupported charset cannot leave a decoder piped with no error listener
|
|
94
|
+
if (verify && encoding !== null && !iconv.encodingExists(encoding)) {
|
|
95
|
+
return next(createError(415, 'unsupported charset "' + encoding.toUpperCase() + '"', {
|
|
96
|
+
charset: encoding.toLowerCase(),
|
|
97
|
+
type: 'charset.unsupported'
|
|
98
|
+
}))
|
|
99
|
+
}
|
|
87
100
|
|
|
88
101
|
try {
|
|
102
|
+
const contentEncoding = (req.headers['content-encoding'] || 'identity').toLowerCase()
|
|
103
|
+
|
|
104
|
+
debug('content-encoding "%s"', contentEncoding)
|
|
105
|
+
|
|
106
|
+
if (options.inflate === false && contentEncoding !== 'identity') {
|
|
107
|
+
throw createError(415, 'content encoding unsupported', {
|
|
108
|
+
encoding: contentEncoding,
|
|
109
|
+
type: 'encoding.unsupported'
|
|
110
|
+
})
|
|
111
|
+
}
|
|
112
|
+
|
|
89
113
|
// get the content stream
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
114
|
+
if (contentEncoding === 'identity') {
|
|
115
|
+
length = req.headers['content-length']
|
|
116
|
+
stream = req
|
|
117
|
+
} else {
|
|
118
|
+
stream = createDecompressionStream(contentEncoding, debug)
|
|
119
|
+
req.pipe(stream)
|
|
120
|
+
}
|
|
93
121
|
} catch (err) {
|
|
94
122
|
return next(err)
|
|
95
123
|
}
|
|
96
124
|
|
|
97
125
|
// set raw-body options
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
? null
|
|
101
|
-
:
|
|
102
|
-
|
|
103
|
-
// assert charset is supported
|
|
104
|
-
if (opts.encoding === null && encoding !== null && !iconv.encodingExists(encoding)) {
|
|
105
|
-
return next(createError(415, 'unsupported charset "' + encoding.toUpperCase() + '"', {
|
|
106
|
-
charset: encoding.toLowerCase(),
|
|
107
|
-
type: 'charset.unsupported'
|
|
108
|
-
}))
|
|
126
|
+
const rawBodyOptions = {
|
|
127
|
+
length,
|
|
128
|
+
encoding: verify ? null : encoding,
|
|
129
|
+
limit: options.limit
|
|
109
130
|
}
|
|
110
131
|
|
|
111
132
|
// read body
|
|
112
133
|
debug('read body')
|
|
113
|
-
getBody(stream,
|
|
134
|
+
getBody(stream, rawBodyOptions, function (error, body) {
|
|
114
135
|
if (error) {
|
|
115
136
|
let _error
|
|
116
137
|
|
|
@@ -138,6 +159,17 @@ function read (req, res, next, parse, debug, options) {
|
|
|
138
159
|
return
|
|
139
160
|
}
|
|
140
161
|
|
|
162
|
+
// detach and destroy the decompression stream to
|
|
163
|
+
// avoid decompression errors on the finished stream
|
|
164
|
+
if (stream !== req) {
|
|
165
|
+
req.unpipe(stream)
|
|
166
|
+
stream.on('error', () => {})
|
|
167
|
+
stream.destroy()
|
|
168
|
+
|
|
169
|
+
// consume any remaining bytes so the HTTP request can finish
|
|
170
|
+
req.resume()
|
|
171
|
+
}
|
|
172
|
+
|
|
141
173
|
// verify
|
|
142
174
|
if (verify) {
|
|
143
175
|
try {
|
|
@@ -145,7 +177,7 @@ function read (req, res, next, parse, debug, options) {
|
|
|
145
177
|
verify(req, res, body, encoding)
|
|
146
178
|
} catch (err) {
|
|
147
179
|
next(createError(403, err, {
|
|
148
|
-
body
|
|
180
|
+
body,
|
|
149
181
|
type: err.type || 'entity.verify.failed'
|
|
150
182
|
}))
|
|
151
183
|
return
|
|
@@ -172,38 +204,6 @@ function read (req, res, next, parse, debug, options) {
|
|
|
172
204
|
})
|
|
173
205
|
}
|
|
174
206
|
|
|
175
|
-
/**
|
|
176
|
-
* Get the content stream of the request.
|
|
177
|
-
*
|
|
178
|
-
* @param {Object} req
|
|
179
|
-
* @param {Function} debug
|
|
180
|
-
* @param {boolean} inflate
|
|
181
|
-
* @returns {Object}
|
|
182
|
-
* @private
|
|
183
|
-
*/
|
|
184
|
-
function contentstream (req, debug, inflate) {
|
|
185
|
-
const encoding = (req.headers['content-encoding'] || 'identity').toLowerCase()
|
|
186
|
-
const length = req.headers['content-length']
|
|
187
|
-
|
|
188
|
-
debug('content-encoding "%s"', encoding)
|
|
189
|
-
|
|
190
|
-
if (inflate === false && encoding !== 'identity') {
|
|
191
|
-
throw createError(415, 'content encoding unsupported', {
|
|
192
|
-
encoding: encoding,
|
|
193
|
-
type: 'encoding.unsupported'
|
|
194
|
-
})
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
if (encoding === 'identity') {
|
|
198
|
-
req.length = length
|
|
199
|
-
return req
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
const stream = createDecompressionStream(encoding, debug)
|
|
203
|
-
req.pipe(stream)
|
|
204
|
-
return stream
|
|
205
|
-
}
|
|
206
|
-
|
|
207
207
|
/**
|
|
208
208
|
* Create a decompression stream for the given encoding.
|
|
209
209
|
* @param {string} encoding
|
|
@@ -222,12 +222,16 @@ function createDecompressionStream (encoding, debug) {
|
|
|
222
222
|
case 'br':
|
|
223
223
|
debug('brotli decompress body')
|
|
224
224
|
return zlib.createBrotliDecompress()
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
}
|
|
225
|
+
case 'zstd':
|
|
226
|
+
if (hasZstandardSupport) {
|
|
227
|
+
debug('zstd decompress body')
|
|
228
|
+
return zlib.createZstdDecompress()
|
|
229
|
+
}
|
|
230
230
|
}
|
|
231
|
+
throw createError(415, 'unsupported content encoding "' + encoding + '"', {
|
|
232
|
+
encoding,
|
|
233
|
+
type: 'encoding.unsupported'
|
|
234
|
+
})
|
|
231
235
|
}
|
|
232
236
|
|
|
233
237
|
/**
|
|
@@ -245,3 +249,16 @@ function dump (req, callback) {
|
|
|
245
249
|
req.resume()
|
|
246
250
|
}
|
|
247
251
|
}
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* Get the charset of a request.
|
|
255
|
+
*
|
|
256
|
+
* @param {Object} req
|
|
257
|
+
* @returns {string | undefined}
|
|
258
|
+
* @private
|
|
259
|
+
*/
|
|
260
|
+
function getCharset (req) {
|
|
261
|
+
const header = req.headers['content-type']
|
|
262
|
+
if (!header) return undefined
|
|
263
|
+
return contentType.parse(header).parameters.charset?.toLowerCase()
|
|
264
|
+
}
|
|
@@ -23,7 +23,7 @@ const { normalizeOptions } = require('../utils')
|
|
|
23
23
|
module.exports = json
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
|
-
* RegExp to match the first non-
|
|
26
|
+
* RegExp to match the first non-whitespace character in a string.
|
|
27
27
|
*
|
|
28
28
|
* Allowed whitespace is defined in RFC 7159:
|
|
29
29
|
*
|
|
@@ -33,7 +33,7 @@ module.exports = json
|
|
|
33
33
|
* %x0A / ; Line feed or New line
|
|
34
34
|
* %x0D ) ; Carriage return
|
|
35
35
|
*/
|
|
36
|
-
const
|
|
36
|
+
const FIRST_NON_WHITESPACE_REGEXP = /^[\x20\x09\x0a\x0d]*([^\x20\x09\x0a\x0d]|$)/ // eslint-disable-line no-control-regex
|
|
37
37
|
|
|
38
38
|
const JSON_SYNTAX_CHAR = '#'
|
|
39
39
|
const JSON_SYNTAX_REGEXP = /#+/g
|
|
@@ -80,10 +80,12 @@ function createJsonParser (options) {
|
|
|
80
80
|
return {}
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
83
|
+
if (body[0] !== '{' && body[0] !== '[') {
|
|
84
|
+
const first = firstNonWhitespaceChar(body)
|
|
85
|
+
if (first !== '{' && first !== '[') {
|
|
86
|
+
debug('strict violation')
|
|
87
|
+
throw createStrictSyntaxError(body, first)
|
|
88
|
+
}
|
|
87
89
|
}
|
|
88
90
|
|
|
89
91
|
try {
|
|
@@ -152,12 +154,10 @@ function createStrictSyntaxError (str, char) {
|
|
|
152
154
|
* @returns {string|undefined}
|
|
153
155
|
* @private
|
|
154
156
|
*/
|
|
155
|
-
function
|
|
156
|
-
const match =
|
|
157
|
+
function firstNonWhitespaceChar (str) {
|
|
158
|
+
const match = FIRST_NON_WHITESPACE_REGEXP.exec(str)
|
|
157
159
|
|
|
158
|
-
return match
|
|
159
|
-
? match[1]
|
|
160
|
-
: undefined
|
|
160
|
+
return match && match[1] ? match[1] : undefined
|
|
161
161
|
}
|
|
162
162
|
|
|
163
163
|
/**
|
|
@@ -98,12 +98,12 @@ function createQueryParser (options) {
|
|
|
98
98
|
try {
|
|
99
99
|
return qs.parse(body, {
|
|
100
100
|
allowPrototypes: true,
|
|
101
|
-
arrayLimit
|
|
102
|
-
depth
|
|
103
|
-
charsetSentinel
|
|
104
|
-
interpretNumericEntities
|
|
101
|
+
arrayLimit,
|
|
102
|
+
depth,
|
|
103
|
+
charsetSentinel,
|
|
104
|
+
interpretNumericEntities,
|
|
105
105
|
charset: encoding,
|
|
106
|
-
parameterLimit
|
|
106
|
+
parameterLimit,
|
|
107
107
|
strictDepth: true
|
|
108
108
|
})
|
|
109
109
|
} catch (err) {
|
|
@@ -5,31 +5,16 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
const bytes = require('bytes')
|
|
8
|
-
const contentType = require('content-type')
|
|
9
8
|
const typeis = require('type-is')
|
|
10
9
|
|
|
11
10
|
/**
|
|
12
11
|
* Module exports.
|
|
13
12
|
*/
|
|
14
13
|
module.exports = {
|
|
15
|
-
getCharset,
|
|
16
14
|
normalizeOptions,
|
|
17
15
|
passthrough
|
|
18
16
|
}
|
|
19
17
|
|
|
20
|
-
/**
|
|
21
|
-
* Get the charset of a request.
|
|
22
|
-
*
|
|
23
|
-
* @param {Object} req
|
|
24
|
-
* @returns {string | undefined}
|
|
25
|
-
* @private
|
|
26
|
-
*/
|
|
27
|
-
function getCharset (req) {
|
|
28
|
-
const header = req.headers['content-type']
|
|
29
|
-
if (!header) return undefined
|
|
30
|
-
return contentType.parse(header).parameters.charset?.toLowerCase()
|
|
31
|
-
}
|
|
32
|
-
|
|
33
18
|
/**
|
|
34
19
|
* Get the simple type checker.
|
|
35
20
|
*
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "body-parser",
|
|
3
3
|
"description": "Node.js body parsing middleware",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.4.0",
|
|
5
5
|
"contributors": [
|
|
6
6
|
"Douglas Christopher Wilson <doug@somethingdoug.com>",
|
|
7
7
|
"Jonathan Ong <me@jongleberry.com> (http://jongleberry.com)"
|
|
@@ -27,26 +27,21 @@
|
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"bytes": "^3.1.2",
|
|
30
|
-
"content-type": "^2.
|
|
30
|
+
"content-type": "^2.1.0",
|
|
31
31
|
"debug": "^4.4.3",
|
|
32
32
|
"http-errors": "^2.0.1",
|
|
33
|
-
"iconv-lite": "^0.7.
|
|
33
|
+
"iconv-lite": "^0.7.3",
|
|
34
34
|
"on-finished": "^2.4.1",
|
|
35
|
-
"qs": "^6.
|
|
35
|
+
"qs": "^6.16.1",
|
|
36
36
|
"raw-body": "^3.0.2",
|
|
37
37
|
"type-is": "^2.1.0"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"eslint": "^
|
|
41
|
-
"eslint-config-standard": "^14.1.1",
|
|
42
|
-
"eslint-plugin-import": "^2.32.0",
|
|
43
|
-
"eslint-plugin-markdown": "^3.0.1",
|
|
44
|
-
"eslint-plugin-node": "^11.1.0",
|
|
45
|
-
"eslint-plugin-promise": "^6.6.0",
|
|
46
|
-
"eslint-plugin-standard": "^4.1.0",
|
|
40
|
+
"eslint": "^9.39.5",
|
|
47
41
|
"mocha": "^11.7.6",
|
|
42
|
+
"neostandard": "^0.13.0",
|
|
48
43
|
"nyc": "^17.1.0",
|
|
49
|
-
"supertest": "
|
|
44
|
+
"supertest": "7.3.0"
|
|
50
45
|
},
|
|
51
46
|
"files": [
|
|
52
47
|
"lib/",
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# Encode URL
|
|
2
2
|
|
|
3
|
+
[![NPM Version][npm-image]][npm-url]
|
|
4
|
+
[![NPM Downloads][downloads-image]][downloads-url]
|
|
5
|
+
[![Build Status][ci-image]][ci-url]
|
|
6
|
+
[![Test Coverage][coveralls-image]][coveralls-url]
|
|
7
|
+
|
|
3
8
|
Encode a URL to a percent-encoded form, excluding already-encoded sequences.
|
|
4
9
|
|
|
5
10
|
## Installation
|
|
@@ -107,3 +112,12 @@ $ npm run lint
|
|
|
107
112
|
## License
|
|
108
113
|
|
|
109
114
|
[MIT](LICENSE)
|
|
115
|
+
|
|
116
|
+
[npm-image]: https://img.shields.io/npm/v/encodeurl
|
|
117
|
+
[npm-url]: https://npmjs.org/package/encodeurl
|
|
118
|
+
[downloads-image]: https://img.shields.io/npm/dm/encodeurl
|
|
119
|
+
[downloads-url]: https://npmcharts.com/compare/encodeurl?minimal=true
|
|
120
|
+
[ci-image]: https://img.shields.io/github/actions/workflow/status/pillarjs/encodeurl/ci.yml?branch=master
|
|
121
|
+
[ci-url]: https://github.com/pillarjs/encodeurl/actions/workflows/ci.yml
|
|
122
|
+
[coveralls-image]: https://img.shields.io/coverallsCoverage/github/pillarjs/encodeurl?branch=master
|
|
123
|
+
[coveralls-url]: https://coveralls.io/r/pillarjs/encodeurl?branch=master
|
|
@@ -16,24 +16,20 @@ module.exports = encodeUrl
|
|
|
16
16
|
/**
|
|
17
17
|
* RegExp to match non-URL code points, *after* encoding (i.e. not including "%")
|
|
18
18
|
* and including invalid escape sequences.
|
|
19
|
+
* Group up to 1024 character and percent runs per replacement to reduce calls
|
|
20
|
+
* to encodeURI while bounding RegExp stack use. Character runs stay intact so
|
|
21
|
+
* surrogate pairs are never split between replacements.
|
|
19
22
|
* @private
|
|
20
23
|
*/
|
|
21
24
|
|
|
22
|
-
var ENCODE_CHARS_REGEXP = /(?:[^\x21\x23-\x3B\x3D\x3F-\x5F\x61-\x7A\x7C\x7E]
|
|
25
|
+
var ENCODE_CHARS_REGEXP = /(?:[^\x21\x23-\x3B\x3D\x3F-\x5F\x61-\x7A\x7C\x7E]+|%+(?![0-9A-Fa-f]{2})){1,1024}/g
|
|
23
26
|
|
|
24
27
|
/**
|
|
25
|
-
* RegExp to match
|
|
28
|
+
* RegExp to match surrogate pairs and unpaired surrogates.
|
|
26
29
|
* @private
|
|
27
30
|
*/
|
|
28
31
|
|
|
29
|
-
var
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* String to replace unmatched surrogate pair with.
|
|
33
|
-
* @private
|
|
34
|
-
*/
|
|
35
|
-
|
|
36
|
-
var UNMATCHED_SURROGATE_PAIR_REPLACE = '$1\uFFFD$2'
|
|
32
|
+
var SURROGATE_REGEXP = /([\uD800-\uDBFF][\uDC00-\uDFFF])|[\uD800-\uDFFF]/g
|
|
37
33
|
|
|
38
34
|
/**
|
|
39
35
|
* Encode a URL to a percent-encoded form, excluding already-encoded sequences.
|
|
@@ -55,6 +51,8 @@ var UNMATCHED_SURROGATE_PAIR_REPLACE = '$1\uFFFD$2'
|
|
|
55
51
|
|
|
56
52
|
function encodeUrl (url) {
|
|
57
53
|
return String(url)
|
|
58
|
-
.replace(
|
|
54
|
+
.replace(SURROGATE_REGEXP, function (_, pair) {
|
|
55
|
+
return pair || '\uFFFD'
|
|
56
|
+
})
|
|
59
57
|
.replace(ENCODE_CHARS_REGEXP, encodeURI)
|
|
60
58
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "encodeurl",
|
|
3
3
|
"description": "Encode a URL to a percent-encoded form, excluding already-encoded sequences",
|
|
4
|
-
"version": "2.0.
|
|
4
|
+
"version": "2.0.3",
|
|
5
5
|
"contributors": [
|
|
6
6
|
"Douglas Christopher Wilson <doug@somethingdoug.com>"
|
|
7
7
|
],
|
|
@@ -12,6 +12,13 @@
|
|
|
12
12
|
"url"
|
|
13
13
|
],
|
|
14
14
|
"repository": "pillarjs/encodeurl",
|
|
15
|
+
"publishConfig": {
|
|
16
|
+
"tag": "latest-2.x"
|
|
17
|
+
},
|
|
18
|
+
"funding": {
|
|
19
|
+
"type": "opencollective",
|
|
20
|
+
"url": "https://opencollective.com/express"
|
|
21
|
+
},
|
|
15
22
|
"devDependencies": {
|
|
16
23
|
"eslint": "5.11.1",
|
|
17
24
|
"eslint-config-standard": "12.0.0",
|
|
@@ -19,8 +26,8 @@
|
|
|
19
26
|
"eslint-plugin-node": "7.0.1",
|
|
20
27
|
"eslint-plugin-promise": "4.0.1",
|
|
21
28
|
"eslint-plugin-standard": "4.0.0",
|
|
22
|
-
"
|
|
23
|
-
"
|
|
29
|
+
"mocha": "~11.7.0",
|
|
30
|
+
"nyc": "~17.1.0"
|
|
24
31
|
},
|
|
25
32
|
"files": [
|
|
26
33
|
"LICENSE",
|
|
@@ -33,8 +40,8 @@
|
|
|
33
40
|
},
|
|
34
41
|
"scripts": {
|
|
35
42
|
"lint": "eslint .",
|
|
36
|
-
"test": "mocha --
|
|
37
|
-
"test-
|
|
38
|
-
"test-
|
|
43
|
+
"test": "mocha --check-leaks --reporter spec",
|
|
44
|
+
"test-ci": "nyc --reporter=lcov --reporter=text npm test",
|
|
45
|
+
"test-cov": "nyc --reporter=html --reporter=text npm test"
|
|
39
46
|
}
|
|
40
47
|
}
|
|
@@ -70,7 +70,7 @@ The `jose` module supports importing, exporting, and generating keys and secrets
|
|
|
70
70
|
|
|
71
71
|
### JSON Web Signature (JWS)
|
|
72
72
|
|
|
73
|
-
The `jose` module supports
|
|
73
|
+
The `jose` module supports digital signature and MAC computation and validation over arbitrary JWS Payloads using the JWS Compact Serialization and the flattened and general JWS JSON Serialization syntaxes ([RFC 7515, Section 7](https://www.rfc-editor.org/info/rfc7515/#section-7)).
|
|
74
74
|
|
|
75
75
|
- Signing - [Compact](docs/jws/compact/sign/classes/CompactSign.md), [Flattened JSON](docs/jws/flattened/sign/classes/FlattenedSign.md), [General JSON](docs/jws/general/sign/classes/GeneralSign.md)
|
|
76
76
|
- Verification - [Compact](docs/jws/compact/verify/functions/compactVerify.md), [Flattened JSON](docs/jws/flattened/verify/functions/flattenedVerify.md), [General JSON](docs/jws/general/verify/functions/generalVerify.md)
|
|
@@ -81,7 +81,7 @@ The `jose` module supports signing and verification of JWS messages with arbitra
|
|
|
81
81
|
|
|
82
82
|
### JSON Web Encryption (JWE)
|
|
83
83
|
|
|
84
|
-
The `jose` module supports encryption and decryption of
|
|
84
|
+
The `jose` module supports encryption and authenticated decryption of arbitrary plaintext using the JWE Compact Serialization and the flattened and general JWE JSON Serialization syntaxes ([RFC 7516, Section 7](https://www.rfc-editor.org/info/rfc7516/#section-7)).
|
|
85
85
|
|
|
86
86
|
- Encryption - [Compact](docs/jwe/compact/encrypt/classes/CompactEncrypt.md), [Flattened JSON](docs/jwe/flattened/encrypt/classes/FlattenedEncrypt.md), [General JSON](docs/jwe/general/encrypt/classes/GeneralEncrypt.md)
|
|
87
87
|
- Decryption - [Compact](docs/jwe/compact/decrypt/functions/compactDecrypt.md), [Flattened JSON](docs/jwe/flattened/decrypt/functions/flattenedDecrypt.md), [General JSON](docs/jwe/general/decrypt/functions/generalDecrypt.md)
|
|
@@ -3,21 +3,22 @@ import type * as t from '../../types.d.ts';
|
|
|
3
3
|
export interface CompactDecryptGetKey<KeyType extends t.CryptoKey | Uint8Array = t.CryptoKey | Uint8Array> extends t.GetKeyFunction<t.CompactJWEHeaderParameters, t.FlattenedJWE, KeyType | t.KeyObject | t.JWK> {
|
|
4
4
|
}
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* Authenticates and decrypts a JWE Compact Serialization.
|
|
7
7
|
*
|
|
8
8
|
* @param key Private key or shared secret. See
|
|
9
9
|
* {@link https://github.com/panva/jose/issues/210#jwe-alg Algorithm Key Requirements}.
|
|
10
10
|
*/
|
|
11
11
|
export declare function compactDecrypt(jwe: string | Uint8Array, key: t.KeyInput, options?: t.DecryptOptions): Promise<t.CompactDecryptResult>;
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
13
|
+
* Authenticates and decrypts a JWE Compact Serialization with a dynamically resolved key, included
|
|
14
|
+
* in the result.
|
|
14
15
|
*
|
|
15
16
|
* @param getKey Resolves a private key or shared secret from unverified token data.
|
|
16
17
|
*/
|
|
17
18
|
export declare function compactDecrypt<KeyType extends t.CryptoKey | Uint8Array = t.CryptoKey | Uint8Array>(jwe: string | Uint8Array, getKey: CompactDecryptGetKey<KeyType>, options?: t.DecryptOptions): Promise<t.CompactDecryptResult & t.ResolvedKey<KeyType>>;
|
|
18
19
|
/**
|
|
19
|
-
*
|
|
20
|
-
* is used.
|
|
20
|
+
* Authenticates and decrypts a JWE Compact Serialization with a key or key resolver. The result
|
|
21
|
+
* includes `key` only when a resolver is used.
|
|
21
22
|
*
|
|
22
23
|
* @param key Private key or shared secret, or a function resolving one.
|
|
23
24
|
*/
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type * as t from '../../types.d.ts';
|
|
2
|
-
/**
|
|
2
|
+
/** Produces JWE Compact Serialization using authenticated encryption. */
|
|
3
3
|
export declare class CompactEncrypt {
|
|
4
4
|
#private;
|
|
5
5
|
/**
|
|
6
|
-
* Creates
|
|
6
|
+
* Creates an encryptor for JWE Compact Serialization.
|
|
7
7
|
*
|
|
8
8
|
* @param plaintext Binary representation of the plaintext to encrypt.
|
|
9
9
|
*/
|
|
@@ -26,12 +26,12 @@ export declare class CompactEncrypt {
|
|
|
26
26
|
setProtectedHeader(protectedHeader: t.CompactJWEHeaderParameters): this;
|
|
27
27
|
/**
|
|
28
28
|
* Sets key management inputs such as ECDH-ES "apu"/"apv" or PBES2 "p2c". Use this method instead
|
|
29
|
-
* of header setters; the resulting parameters are added to the JOSE
|
|
29
|
+
* of header setters; the resulting parameters are added to the JOSE Header. May only be called
|
|
30
30
|
* once.
|
|
31
31
|
*/
|
|
32
32
|
setKeyManagementParameters(parameters: t.JWEKeyManagementHeaderParameters): this;
|
|
33
33
|
/**
|
|
34
|
-
* Encrypts the plaintext
|
|
34
|
+
* Encrypts the plaintext and returns the JWE Compact Serialization.
|
|
35
35
|
*
|
|
36
36
|
* @param key Public key or shared secret. See
|
|
37
37
|
* {@link https://github.com/panva/jose/issues/210#jwe-alg Algorithm Key Requirements}.
|
|
@@ -3,21 +3,22 @@ import type * as t from '../../types.d.ts';
|
|
|
3
3
|
export interface FlattenedDecryptGetKey<KeyType extends t.CryptoKey | Uint8Array = t.CryptoKey | Uint8Array> extends t.GetKeyFunction<t.JWEHeaderParameters | undefined, t.FlattenedJWE, KeyType | t.KeyObject | t.JWK> {
|
|
4
4
|
}
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* Authenticates and decrypts a flattened JWE JSON Serialization.
|
|
7
7
|
*
|
|
8
8
|
* @param key Private key or shared secret. See
|
|
9
9
|
* {@link https://github.com/panva/jose/issues/210#jwe-alg Algorithm Key Requirements}.
|
|
10
10
|
*/
|
|
11
11
|
export declare function flattenedDecrypt(jwe: t.FlattenedJWE, key: t.KeyInput, options?: t.DecryptOptions): Promise<t.FlattenedDecryptResult>;
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
13
|
+
* Authenticates and decrypts a flattened JWE JSON Serialization with a dynamically resolved key,
|
|
14
|
+
* included in the result.
|
|
14
15
|
*
|
|
15
16
|
* @param getKey Resolves a private key or shared secret from unverified token data.
|
|
16
17
|
*/
|
|
17
18
|
export declare function flattenedDecrypt<KeyType extends t.CryptoKey | Uint8Array = t.CryptoKey | Uint8Array>(jwe: t.FlattenedJWE, getKey: FlattenedDecryptGetKey<KeyType>, options?: t.DecryptOptions): Promise<t.FlattenedDecryptResult & t.ResolvedKey<KeyType>>;
|
|
18
19
|
/**
|
|
19
|
-
*
|
|
20
|
-
* resolver is used.
|
|
20
|
+
* Authenticates and decrypts a flattened JWE JSON Serialization with a key or key resolver. The
|
|
21
|
+
* result includes `key` only when a resolver is used.
|
|
21
22
|
*
|
|
22
23
|
* @param key Private key or shared secret, or a function resolving one.
|
|
23
24
|
*/
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import type * as t from '../../types.d.ts';
|
|
2
|
-
/**
|
|
2
|
+
/** Produces flattened JWE JSON Serialization using authenticated encryption. */
|
|
3
3
|
export declare class FlattenedEncrypt {
|
|
4
4
|
#private;
|
|
5
5
|
/**
|
|
6
|
-
* Creates
|
|
6
|
+
* Creates an encryptor for flattened JWE JSON Serialization.
|
|
7
7
|
*
|
|
8
8
|
* @param plaintext Binary representation of the plaintext to encrypt.
|
|
9
9
|
*/
|
|
10
10
|
constructor(plaintext: Uint8Array);
|
|
11
11
|
/**
|
|
12
12
|
* Sets key management inputs such as ECDH-ES "apu"/"apv" or PBES2 "p2c". Use this method instead
|
|
13
|
-
* of header setters; the resulting parameters are added to the JOSE
|
|
13
|
+
* of header setters; the resulting parameters are added to the JOSE Header. May only be called
|
|
14
14
|
* once.
|
|
15
15
|
*/
|
|
16
16
|
setKeyManagementParameters(parameters: t.JWEKeyManagementHeaderParameters): this;
|
|
@@ -20,7 +20,7 @@ export declare class FlattenedEncrypt {
|
|
|
20
20
|
setSharedUnprotectedHeader(sharedUnprotectedHeader: t.JWEHeaderParameters): this;
|
|
21
21
|
/** Sets the JWE Per-Recipient Unprotected Header. May only be called once. */
|
|
22
22
|
setUnprotectedHeader(unprotectedHeader: t.JWEHeaderParameters): this;
|
|
23
|
-
/** Sets
|
|
23
|
+
/** Sets the JWE AAD, which is integrity protected but not encrypted. */
|
|
24
24
|
setAdditionalAuthenticatedData(aad: Uint8Array): this;
|
|
25
25
|
/**
|
|
26
26
|
* Sets a content encryption key instead of generating a random one for the JWE "enc" algorithm.
|
|
@@ -37,7 +37,7 @@ export declare class FlattenedEncrypt {
|
|
|
37
37
|
*/
|
|
38
38
|
setInitializationVector(iv: Uint8Array): this;
|
|
39
39
|
/**
|
|
40
|
-
* Encrypts the plaintext
|
|
40
|
+
* Encrypts the plaintext and returns the flattened JWE JSON Serialization.
|
|
41
41
|
*
|
|
42
42
|
* @param key Public key or shared secret. See
|
|
43
43
|
* {@link https://github.com/panva/jose/issues/210#jwe-alg Algorithm Key Requirements}.
|
|
@@ -3,7 +3,7 @@ import type * as t from '../../types.d.ts';
|
|
|
3
3
|
export interface GeneralDecryptGetKey<KeyType extends t.CryptoKey | Uint8Array = t.CryptoKey | Uint8Array> extends t.GetKeyFunction<t.JWEHeaderParameters | undefined, t.FlattenedJWE, KeyType | t.KeyObject | t.JWK> {
|
|
4
4
|
}
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* Authenticates and decrypts a general JWE JSON Serialization.
|
|
7
7
|
*
|
|
8
8
|
* > Note: Returns plaintext and headers from the first recipient that decrypts successfully. Other
|
|
9
9
|
* > recipients may be inspected to enforce serialization rules, but their headers are not included in
|
|
@@ -14,14 +14,15 @@ export interface GeneralDecryptGetKey<KeyType extends t.CryptoKey | Uint8Array =
|
|
|
14
14
|
*/
|
|
15
15
|
export declare function generalDecrypt(jwe: t.GeneralJWE, key: t.KeyInput, options?: t.DecryptOptions): Promise<t.GeneralDecryptResult>;
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
17
|
+
* Authenticates and decrypts a general JWE JSON Serialization with a dynamically resolved key,
|
|
18
|
+
* included in the result.
|
|
18
19
|
*
|
|
19
20
|
* @param getKey Resolves a private key or shared secret from unverified token data.
|
|
20
21
|
*/
|
|
21
22
|
export declare function generalDecrypt<KeyType extends t.CryptoKey | Uint8Array = t.CryptoKey | Uint8Array>(jwe: t.GeneralJWE, getKey: GeneralDecryptGetKey<KeyType>, options?: t.DecryptOptions): Promise<t.GeneralDecryptResult & t.ResolvedKey<KeyType>>;
|
|
22
23
|
/**
|
|
23
|
-
*
|
|
24
|
-
* is used.
|
|
24
|
+
* Authenticates and decrypts a general JWE JSON Serialization with a key or key resolver. The
|
|
25
|
+
* result includes `key` only when a resolver is used.
|
|
25
26
|
*
|
|
26
27
|
* @param key Private key or shared secret, or a function resolving one.
|
|
27
28
|
*/
|
|
@@ -5,7 +5,7 @@ export interface Recipient {
|
|
|
5
5
|
setUnprotectedHeader(unprotectedHeader: t.JWEHeaderParameters): Recipient;
|
|
6
6
|
/**
|
|
7
7
|
* Sets key management inputs such as ECDH-ES "apu"/"apv" or PBES2 "p2c". Use this method instead
|
|
8
|
-
* of header setters; the resulting parameters are added to the JOSE
|
|
8
|
+
* of header setters; the resulting parameters are added to the JOSE Header. May only be called
|
|
9
9
|
* once.
|
|
10
10
|
*/
|
|
11
11
|
setKeyManagementParameters(parameters: t.JWEKeyManagementHeaderParameters): Recipient;
|
|
@@ -24,11 +24,11 @@ export interface Recipient {
|
|
|
24
24
|
/** Returns the enclosing {@link GeneralEncrypt} instance. */
|
|
25
25
|
done(): GeneralEncrypt;
|
|
26
26
|
}
|
|
27
|
-
/**
|
|
27
|
+
/** Produces general JWE JSON Serialization using authenticated encryption. */
|
|
28
28
|
export declare class GeneralEncrypt {
|
|
29
29
|
#private;
|
|
30
30
|
/**
|
|
31
|
-
* Creates
|
|
31
|
+
* Creates an encryptor for general JWE JSON Serialization.
|
|
32
32
|
*
|
|
33
33
|
* @param plaintext Binary representation of the plaintext to encrypt.
|
|
34
34
|
*/
|
|
@@ -44,8 +44,8 @@ export declare class GeneralEncrypt {
|
|
|
44
44
|
setProtectedHeader(protectedHeader: t.JWEHeaderParameters): this;
|
|
45
45
|
/** Sets the JWE Shared Unprotected Header. May only be called once. */
|
|
46
46
|
setSharedUnprotectedHeader(sharedUnprotectedHeader: t.JWEHeaderParameters): this;
|
|
47
|
-
/** Sets
|
|
47
|
+
/** Sets the JWE AAD, which is integrity protected but not encrypted. */
|
|
48
48
|
setAdditionalAuthenticatedData(aad: Uint8Array): this;
|
|
49
|
-
/** Encrypts the plaintext
|
|
49
|
+
/** Encrypts the plaintext and returns the general JWE JSON Serialization. */
|
|
50
50
|
encrypt(): Promise<t.GeneralJWE>;
|
|
51
51
|
}
|