solid-ui 2.4.27-e6d67dd8 → 2.4.27-eed9bea8
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/dist/solid-ui.js +146 -189
- package/dist/solid-ui.js.map +1 -1
- package/dist/solid-ui.min.js +1 -1
- package/dist/solid-ui.min.js.map +1 -1
- package/lib/chat/keys.d.ts.map +1 -1
- package/lib/chat/keys.js +78 -65
- package/lib/chat/keys.js.map +1 -1
- package/lib/utils/cryptoKeyHelpers.d.ts.map +1 -1
- package/lib/utils/cryptoKeyHelpers.js +13 -1
- package/lib/utils/cryptoKeyHelpers.js.map +1 -1
- package/lib/versionInfo.js +2 -2
- package/lib/versionInfo.js.map +1 -1
- package/package.json +1 -1
package/dist/solid-ui.js
CHANGED
|
@@ -4089,7 +4089,7 @@ function getPrivateKey(_x2) {
|
|
|
4089
4089
|
}
|
|
4090
4090
|
function _getPrivateKey() {
|
|
4091
4091
|
_getPrivateKey = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(webId) {
|
|
4092
|
-
var publicKeyDoc, privateKeyDoc, publicKey, privateKey, validPublicKey, del, add, newPublicKey;
|
|
4092
|
+
var publicKeyDoc, privateKeyDoc, publicKey, privateKey, validPublicKey, del, add, newPublicKey, keyContainer;
|
|
4093
4093
|
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
4094
4094
|
while (1) switch (_context2.prev = _context2.next) {
|
|
4095
4095
|
case 0:
|
|
@@ -4115,7 +4115,7 @@ function _getPrivateKey() {
|
|
|
4115
4115
|
|
|
4116
4116
|
// create key pair or repair publicKey
|
|
4117
4117
|
if (!(!privateKey || !publicKey || !validPublicKey)) {
|
|
4118
|
-
_context2.next =
|
|
4118
|
+
_context2.next = 30;
|
|
4119
4119
|
break;
|
|
4120
4120
|
}
|
|
4121
4121
|
del = [];
|
|
@@ -4146,8 +4146,12 @@ function _getPrivateKey() {
|
|
|
4146
4146
|
_context2.next = 27;
|
|
4147
4147
|
return saveKey(publicKeyDoc, del, add);
|
|
4148
4148
|
case 27:
|
|
4149
|
+
keyContainer = privateKeyDoc.substring(0, privateKeyDoc.lastIndexOf('/') + 1);
|
|
4150
|
+
_context2.next = 30;
|
|
4151
|
+
return setAcl(keyContainer, keyContainerAclBody(webId));
|
|
4152
|
+
case 30:
|
|
4149
4153
|
return _context2.abrupt("return", privateKey);
|
|
4150
|
-
case
|
|
4154
|
+
case 31:
|
|
4151
4155
|
case "end":
|
|
4152
4156
|
return _context2.stop();
|
|
4153
4157
|
}
|
|
@@ -4155,104 +4159,113 @@ function _getPrivateKey() {
|
|
|
4155
4159
|
}));
|
|
4156
4160
|
return _getPrivateKey.apply(this, arguments);
|
|
4157
4161
|
}
|
|
4158
|
-
function
|
|
4162
|
+
var keyContainerAclBody = function keyContainerAclBody(me) {
|
|
4163
|
+
var aclBody = "\n@prefix : <#>.\n@prefix acl: <http://www.w3.org/ns/auth/acl#>.\n@prefix foaf: <http://xmlns.com/foaf/0.1/>.\n@prefix key: <./>.\n\n:ReadWrite\n a acl:Authorization;\n acl:accessTo key:;\n acl:agent <".concat(me, ">;\n acl:mode acl:Read, acl:Write.\n:Read\n a acl:Authorization;\n acl:accessTo key:;\n acl:default key:;\n acl:agentClass foaf:Agent;\n acl:mode acl:Read.\n");
|
|
4164
|
+
return aclBody;
|
|
4165
|
+
};
|
|
4166
|
+
var keyAclBody = function keyAclBody(keyDoc, me) {
|
|
4167
|
+
var keyAgent = 'acl:agentClass foaf:Agent'; // publicKey
|
|
4168
|
+
if (me !== null && me !== void 0 && me.length) keyAgent = "acl:agent <".concat(me, ">"); // privateKey
|
|
4169
|
+
var aclBody = "\n@prefix foaf: <http://xmlns.com/foaf/0.1/>.\n@prefix acl: <http://www.w3.org/ns/auth/acl#>.\n<#Read>\n a acl:Authorization;\n ".concat(keyAgent, ";\n acl:accessTo <").concat(keyDoc.split('/').pop(), ">;\n acl:mode acl:Read, acl:Control. # NSS issue: missing acl link header with READ only\n");
|
|
4170
|
+
return aclBody;
|
|
4171
|
+
};
|
|
4172
|
+
function setAcl(_x3, _x4) {
|
|
4159
4173
|
return _setAcl.apply(this, arguments);
|
|
4160
4174
|
}
|
|
4161
4175
|
function _setAcl() {
|
|
4162
|
-
_setAcl = (0, _asyncToGenerator2["default"])(function (keyDoc) {
|
|
4163
|
-
var
|
|
4164
|
-
return
|
|
4165
|
-
|
|
4166
|
-
|
|
4167
|
-
|
|
4168
|
-
|
|
4169
|
-
|
|
4170
|
-
|
|
4171
|
-
|
|
4172
|
-
|
|
4173
|
-
|
|
4174
|
-
|
|
4175
|
-
|
|
4176
|
-
|
|
4177
|
-
|
|
4178
|
-
|
|
4179
|
-
|
|
4180
|
-
|
|
4181
|
-
|
|
4182
|
-
|
|
4183
|
-
|
|
4184
|
-
|
|
4185
|
-
|
|
4186
|
-
|
|
4187
|
-
|
|
4188
|
-
|
|
4189
|
-
|
|
4190
|
-
|
|
4191
|
-
case "end":
|
|
4192
|
-
return _context3.stop();
|
|
4193
|
-
}
|
|
4194
|
-
}, _callee3);
|
|
4195
|
-
})();
|
|
4196
|
-
});
|
|
4176
|
+
_setAcl = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(keyDoc, aclBody) {
|
|
4177
|
+
var keyAclDoc, aclResponse;
|
|
4178
|
+
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
|
4179
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
4180
|
+
case 0:
|
|
4181
|
+
_context3.next = 2;
|
|
4182
|
+
return _solidLogic.store.fetcher.load(keyDoc);
|
|
4183
|
+
case 2:
|
|
4184
|
+
// FIXME: check the Why value on this quad:
|
|
4185
|
+
keyAclDoc = _solidLogic.store.any($rdf.sym(keyDoc), $rdf.sym('http://www.iana.org/assignments/link-relations/acl'));
|
|
4186
|
+
if (keyAclDoc) {
|
|
4187
|
+
_context3.next = 5;
|
|
4188
|
+
break;
|
|
4189
|
+
}
|
|
4190
|
+
throw new Error('Key ACL doc not found!');
|
|
4191
|
+
case 5:
|
|
4192
|
+
_context3.next = 7;
|
|
4193
|
+
return _solidLogic.store.fetcher.webOperation('PUT', keyAclDoc.value, {
|
|
4194
|
+
data: aclBody,
|
|
4195
|
+
contentType: 'text/turtle'
|
|
4196
|
+
});
|
|
4197
|
+
case 7:
|
|
4198
|
+
aclResponse = _context3.sent;
|
|
4199
|
+
case 8:
|
|
4200
|
+
case "end":
|
|
4201
|
+
return _context3.stop();
|
|
4202
|
+
}
|
|
4203
|
+
}, _callee3);
|
|
4204
|
+
}));
|
|
4197
4205
|
return _setAcl.apply(this, arguments);
|
|
4198
4206
|
}
|
|
4199
|
-
function saveKey(
|
|
4207
|
+
function saveKey(_x5, _x6, _x7) {
|
|
4200
4208
|
return _saveKey.apply(this, arguments);
|
|
4201
4209
|
}
|
|
4202
4210
|
function _saveKey() {
|
|
4203
4211
|
_saveKey = (0, _asyncToGenerator2["default"])(function (keyDoc, del, add) {
|
|
4204
4212
|
var me = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '';
|
|
4205
4213
|
return /*#__PURE__*/_regenerator["default"].mark(function _callee4() {
|
|
4206
|
-
var keyAclDoc, response;
|
|
4214
|
+
var keyAclDoc, response, aclBody;
|
|
4207
4215
|
return _regenerator["default"].wrap(function _callee4$(_context4) {
|
|
4208
4216
|
while (1) switch (_context4.prev = _context4.next) {
|
|
4209
4217
|
case 0:
|
|
4210
|
-
_context4.
|
|
4218
|
+
_context4.next = 2;
|
|
4219
|
+
return _solidLogic.store.updater.updateMany(del, add);
|
|
4220
|
+
case 2:
|
|
4221
|
+
_context4.next = 4;
|
|
4222
|
+
return _solidLogic.store.fetcher.load(keyDoc);
|
|
4223
|
+
case 4:
|
|
4224
|
+
_context4.prev = 4;
|
|
4211
4225
|
// get keyAcldoc
|
|
4212
4226
|
keyAclDoc = _solidLogic.store.any($rdf.sym(keyDoc), $rdf.sym('http://www.iana.org/assignments/link-relations/acl'));
|
|
4213
4227
|
if (keyAclDoc) {
|
|
4214
|
-
_context4.next =
|
|
4228
|
+
_context4.next = 8;
|
|
4215
4229
|
break;
|
|
4216
4230
|
}
|
|
4217
4231
|
throw new Error("".concat(keyDoc, " ACL doc not found!"));
|
|
4218
|
-
case
|
|
4219
|
-
_context4.prev =
|
|
4220
|
-
_context4.next =
|
|
4232
|
+
case 8:
|
|
4233
|
+
_context4.prev = 8;
|
|
4234
|
+
_context4.next = 11;
|
|
4221
4235
|
return _solidLogic.store.fetcher.webOperation('DELETE', keyAclDoc.value);
|
|
4222
|
-
case
|
|
4236
|
+
case 11:
|
|
4223
4237
|
response = _context4.sent;
|
|
4224
4238
|
// this may fail if webId is not an owner
|
|
4225
4239
|
debug.log('delete ' + keyAclDoc.value + ' ' + response.status); // should test 404 and 2xx
|
|
4226
|
-
_context4.next =
|
|
4240
|
+
_context4.next = 20;
|
|
4227
4241
|
break;
|
|
4228
|
-
case
|
|
4229
|
-
_context4.prev =
|
|
4230
|
-
_context4.t0 = _context4["catch"](
|
|
4242
|
+
case 15:
|
|
4243
|
+
_context4.prev = 15;
|
|
4244
|
+
_context4.t0 = _context4["catch"](8);
|
|
4231
4245
|
if (!(_context4.t0.response.status !== 404)) {
|
|
4232
|
-
_context4.next =
|
|
4246
|
+
_context4.next = 19;
|
|
4233
4247
|
break;
|
|
4234
4248
|
}
|
|
4235
4249
|
throw new Error(_context4.t0);
|
|
4236
|
-
case
|
|
4250
|
+
case 19:
|
|
4237
4251
|
debug.log('delete ' + keyAclDoc.value + ' ' + _context4.t0.response.status); // should test 404 and 2xx
|
|
4238
|
-
case 16:
|
|
4239
|
-
_context4.next = 18;
|
|
4240
|
-
return _solidLogic.store.updater.updateMany(del, add);
|
|
4241
|
-
case 18:
|
|
4242
|
-
_context4.next = 20;
|
|
4243
|
-
return setAcl(keyDoc, me);
|
|
4244
4252
|
case 20:
|
|
4245
|
-
|
|
4253
|
+
// create READ only ACL
|
|
4254
|
+
aclBody = keyAclBody(keyDoc, me);
|
|
4255
|
+
_context4.next = 23;
|
|
4256
|
+
return setAcl(keyDoc, aclBody);
|
|
4257
|
+
case 23:
|
|
4258
|
+
_context4.next = 28;
|
|
4246
4259
|
break;
|
|
4247
|
-
case 22:
|
|
4248
|
-
_context4.prev = 22;
|
|
4249
|
-
_context4.t1 = _context4["catch"](0);
|
|
4250
|
-
throw new Error(_context4.t1);
|
|
4251
4260
|
case 25:
|
|
4261
|
+
_context4.prev = 25;
|
|
4262
|
+
_context4.t1 = _context4["catch"](4);
|
|
4263
|
+
throw new Error(_context4.t1);
|
|
4264
|
+
case 28:
|
|
4252
4265
|
case "end":
|
|
4253
4266
|
return _context4.stop();
|
|
4254
4267
|
}
|
|
4255
|
-
}, _callee4, null, [[
|
|
4268
|
+
}, _callee4, null, [[4, 25], [8, 15]]);
|
|
4256
4269
|
})();
|
|
4257
4270
|
});
|
|
4258
4271
|
return _saveKey.apply(this, arguments);
|
|
@@ -12543,6 +12556,18 @@ var _signature = __webpack_require__(/*! ../chat/signature */ "./lib/chat/signat
|
|
|
12543
12556
|
var _solidLogic = __webpack_require__(/*! solid-logic */ "./node_modules/solid-logic/lib/index.js");
|
|
12544
12557
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
12545
12558
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
12559
|
+
// find podRoot from space:storage for subdomain/suffix podServers
|
|
12560
|
+
/* export const podRoot = (webId: string) => {
|
|
12561
|
+
await store.fetcher.load(webId)
|
|
12562
|
+
const url = new URL(webId)
|
|
12563
|
+
// find storage in webId
|
|
12564
|
+
const storage = store.each(store.sym(webId), store.sym('http://www.w3.org/ns/pim/space#storage'))
|
|
12565
|
+
const pod = storage.length === 1 ? storage : storage.find(node => url.origin === new URL(node.value).origin)
|
|
12566
|
+
const podRoot = Array.isArray(pod) ? pod[0] : pod
|
|
12567
|
+
if (!podRoot?.value) throw Error('No space:storage in ' + webId)
|
|
12568
|
+
return podRoot.value
|
|
12569
|
+
} */
|
|
12570
|
+
|
|
12546
12571
|
var pubKeyUrl = function pubKeyUrl(webId) {
|
|
12547
12572
|
var url = new URL(webId);
|
|
12548
12573
|
// find storage in webId
|
|
@@ -12552,7 +12577,7 @@ var pubKeyUrl = function pubKeyUrl(webId) {
|
|
|
12552
12577
|
});
|
|
12553
12578
|
var podUrl = Array.isArray(pod) ? pod[0] : pod;
|
|
12554
12579
|
if (!(podUrl !== null && podUrl !== void 0 && podUrl.value)) throw Error('No space:storage in ' + webId);
|
|
12555
|
-
var publicKeyUrl = podUrl.value + 'profile/keys/publicKey.ttl';
|
|
12580
|
+
var publicKeyUrl = (podUrl === null || podUrl === void 0 ? void 0 : podUrl.value) + 'profile/keys/publicKey.ttl';
|
|
12556
12581
|
return publicKeyUrl;
|
|
12557
12582
|
};
|
|
12558
12583
|
exports.pubKeyUrl = pubKeyUrl;
|
|
@@ -13519,8 +13544,8 @@ Object.defineProperty(exports, "__esModule", ({
|
|
|
13519
13544
|
}));
|
|
13520
13545
|
exports.versionInfo = void 0;
|
|
13521
13546
|
var versionInfo = {
|
|
13522
|
-
buildTime: '2023-04-
|
|
13523
|
-
commit: '
|
|
13547
|
+
buildTime: '2023-04-30T22:04:09Z',
|
|
13548
|
+
commit: 'eed9bea818c9a1a52b4631274b5251b239530355',
|
|
13524
13549
|
npmInfo: {
|
|
13525
13550
|
'solid-ui': '2.4.27',
|
|
13526
13551
|
npm: '8.19.4',
|
|
@@ -62206,14 +62231,17 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
62206
62231
|
/* harmony export */ "createRemoteJWKSet": () => (/* binding */ createRemoteJWKSet)
|
|
62207
62232
|
/* harmony export */ });
|
|
62208
62233
|
/* harmony import */ var _runtime_fetch_jwks_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../runtime/fetch_jwks.js */ "./node_modules/jose/dist/browser/runtime/fetch_jwks.js");
|
|
62209
|
-
/* harmony import */ var
|
|
62210
|
-
/* harmony import */ var
|
|
62211
|
-
/* harmony import */ var _local_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./local.js */ "./node_modules/jose/dist/browser/jwks/local.js");
|
|
62212
|
-
|
|
62234
|
+
/* harmony import */ var _util_errors_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/errors.js */ "./node_modules/jose/dist/browser/util/errors.js");
|
|
62235
|
+
/* harmony import */ var _local_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./local.js */ "./node_modules/jose/dist/browser/jwks/local.js");
|
|
62213
62236
|
|
|
62214
62237
|
|
|
62215
62238
|
|
|
62216
|
-
|
|
62239
|
+
function isCloudflareWorkers() {
|
|
62240
|
+
return (typeof WebSocketPair !== 'undefined' ||
|
|
62241
|
+
(typeof navigator !== 'undefined' && navigator.userAgent === 'Cloudflare-Workers') ||
|
|
62242
|
+
(typeof EdgeRuntime !== 'undefined' && EdgeRuntime === 'vercel'));
|
|
62243
|
+
}
|
|
62244
|
+
class RemoteJWKSet extends _local_js__WEBPACK_IMPORTED_MODULE_2__.LocalJWKSet {
|
|
62217
62245
|
constructor(url, options) {
|
|
62218
62246
|
super({ keys: [] });
|
|
62219
62247
|
this._jwks = undefined;
|
|
@@ -62246,7 +62274,7 @@ class RemoteJWKSet extends _local_js__WEBPACK_IMPORTED_MODULE_3__.LocalJWKSet {
|
|
|
62246
62274
|
return await super.getKey(protectedHeader, token);
|
|
62247
62275
|
}
|
|
62248
62276
|
catch (err) {
|
|
62249
|
-
if (err instanceof
|
|
62277
|
+
if (err instanceof _util_errors_js__WEBPACK_IMPORTED_MODULE_1__.JWKSNoMatchingKey) {
|
|
62250
62278
|
if (this.coolingDown() === false) {
|
|
62251
62279
|
await this.reload();
|
|
62252
62280
|
return super.getKey(protectedHeader, token);
|
|
@@ -62256,13 +62284,13 @@ class RemoteJWKSet extends _local_js__WEBPACK_IMPORTED_MODULE_3__.LocalJWKSet {
|
|
|
62256
62284
|
}
|
|
62257
62285
|
}
|
|
62258
62286
|
async reload() {
|
|
62259
|
-
if (this._pendingFetch &&
|
|
62287
|
+
if (this._pendingFetch && isCloudflareWorkers()) {
|
|
62260
62288
|
this._pendingFetch = undefined;
|
|
62261
62289
|
}
|
|
62262
62290
|
this._pendingFetch || (this._pendingFetch = (0,_runtime_fetch_jwks_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this._url, this._timeoutDuration, this._options)
|
|
62263
62291
|
.then((json) => {
|
|
62264
|
-
if (!(0,
|
|
62265
|
-
throw new
|
|
62292
|
+
if (!(0,_local_js__WEBPACK_IMPORTED_MODULE_2__.isJWKSLike)(json)) {
|
|
62293
|
+
throw new _util_errors_js__WEBPACK_IMPORTED_MODULE_1__.JWKSInvalid('JSON Web Key Set malformed');
|
|
62266
62294
|
}
|
|
62267
62295
|
this._jwks = { keys: json.keys };
|
|
62268
62296
|
this._jwksTimestamp = Date.now();
|
|
@@ -63450,8 +63478,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
63450
63478
|
/* harmony export */ "checkEncCryptoKey": () => (/* binding */ checkEncCryptoKey),
|
|
63451
63479
|
/* harmony export */ "checkSigCryptoKey": () => (/* binding */ checkSigCryptoKey)
|
|
63452
63480
|
/* harmony export */ });
|
|
63453
|
-
/* harmony import */ var _runtime_env_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../runtime/env.js */ "./node_modules/jose/dist/browser/runtime/env.js");
|
|
63454
|
-
|
|
63455
63481
|
function unusable(name, prop = 'algorithm.name') {
|
|
63456
63482
|
return new TypeError(`CryptoKey does not support this operation, its ${prop} must be ${name}`);
|
|
63457
63483
|
}
|
|
@@ -63526,11 +63552,6 @@ function checkSigCryptoKey(key, alg, ...usages) {
|
|
|
63526
63552
|
}
|
|
63527
63553
|
case 'EdDSA': {
|
|
63528
63554
|
if (key.algorithm.name !== 'Ed25519' && key.algorithm.name !== 'Ed448') {
|
|
63529
|
-
if ((0,_runtime_env_js__WEBPACK_IMPORTED_MODULE_0__.isCloudflareWorkers)()) {
|
|
63530
|
-
if (isAlgorithm(key.algorithm, 'NODE-ED25519'))
|
|
63531
|
-
break;
|
|
63532
|
-
throw unusable('Ed25519, Ed448, or NODE-ED25519');
|
|
63533
|
-
}
|
|
63534
63555
|
throw unusable('Ed25519 or Ed448');
|
|
63535
63556
|
}
|
|
63536
63557
|
break;
|
|
@@ -64361,14 +64382,12 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
64361
64382
|
/* harmony export */ "toPKCS8": () => (/* binding */ toPKCS8),
|
|
64362
64383
|
/* harmony export */ "toSPKI": () => (/* binding */ toSPKI)
|
|
64363
64384
|
/* harmony export */ });
|
|
64364
|
-
/* harmony import */ var
|
|
64365
|
-
/* harmony import */ var
|
|
64366
|
-
/* harmony import */ var
|
|
64367
|
-
/* harmony import */ var
|
|
64368
|
-
/* harmony import */ var
|
|
64369
|
-
/* harmony import */ var
|
|
64370
|
-
/* harmony import */ var _is_key_like_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./is_key_like.js */ "./node_modules/jose/dist/browser/runtime/is_key_like.js");
|
|
64371
|
-
|
|
64385
|
+
/* harmony import */ var _webcrypto_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./webcrypto.js */ "./node_modules/jose/dist/browser/runtime/webcrypto.js");
|
|
64386
|
+
/* harmony import */ var _lib_invalid_key_input_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../lib/invalid_key_input.js */ "./node_modules/jose/dist/browser/lib/invalid_key_input.js");
|
|
64387
|
+
/* harmony import */ var _base64url_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./base64url.js */ "./node_modules/jose/dist/browser/runtime/base64url.js");
|
|
64388
|
+
/* harmony import */ var _lib_format_pem_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../lib/format_pem.js */ "./node_modules/jose/dist/browser/lib/format_pem.js");
|
|
64389
|
+
/* harmony import */ var _util_errors_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../util/errors.js */ "./node_modules/jose/dist/browser/util/errors.js");
|
|
64390
|
+
/* harmony import */ var _is_key_like_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./is_key_like.js */ "./node_modules/jose/dist/browser/runtime/is_key_like.js");
|
|
64372
64391
|
|
|
64373
64392
|
|
|
64374
64393
|
|
|
@@ -64376,8 +64395,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
64376
64395
|
|
|
64377
64396
|
|
|
64378
64397
|
const genericExport = async (keyType, keyFormat, key) => {
|
|
64379
|
-
if (!(0,
|
|
64380
|
-
throw new TypeError((0,
|
|
64398
|
+
if (!(0,_webcrypto_js__WEBPACK_IMPORTED_MODULE_0__.isCryptoKey)(key)) {
|
|
64399
|
+
throw new TypeError((0,_lib_invalid_key_input_js__WEBPACK_IMPORTED_MODULE_1__["default"])(key, ..._is_key_like_js__WEBPACK_IMPORTED_MODULE_5__.types));
|
|
64381
64400
|
}
|
|
64382
64401
|
if (!key.extractable) {
|
|
64383
64402
|
throw new TypeError('CryptoKey is not extractable');
|
|
@@ -64385,7 +64404,7 @@ const genericExport = async (keyType, keyFormat, key) => {
|
|
|
64385
64404
|
if (key.type !== keyType) {
|
|
64386
64405
|
throw new TypeError(`key is not a ${keyType} key`);
|
|
64387
64406
|
}
|
|
64388
|
-
return (0,
|
|
64407
|
+
return (0,_lib_format_pem_js__WEBPACK_IMPORTED_MODULE_3__["default"])((0,_base64url_js__WEBPACK_IMPORTED_MODULE_2__.encodeBase64)(new Uint8Array(await _webcrypto_js__WEBPACK_IMPORTED_MODULE_0__["default"].subtle.exportKey(keyFormat, key))), `${keyType.toUpperCase()} KEY`);
|
|
64389
64408
|
};
|
|
64390
64409
|
const toSPKI = (key) => {
|
|
64391
64410
|
return genericExport('public', 'spki', key);
|
|
@@ -64423,11 +64442,11 @@ const getNamedCurve = (keyData) => {
|
|
|
64423
64442
|
case findOid(keyData, [0x2b, 0x65, 0x71]):
|
|
64424
64443
|
return 'Ed448';
|
|
64425
64444
|
default:
|
|
64426
|
-
throw new
|
|
64445
|
+
throw new _util_errors_js__WEBPACK_IMPORTED_MODULE_4__.JOSENotSupported('Invalid or unsupported EC Key Curve or OKP Key Sub Type');
|
|
64427
64446
|
}
|
|
64428
64447
|
};
|
|
64429
64448
|
const genericImport = async (replace, keyFormat, pem, alg, options) => {
|
|
64430
|
-
var _a
|
|
64449
|
+
var _a;
|
|
64431
64450
|
let algorithm;
|
|
64432
64451
|
let keyUsages;
|
|
64433
64452
|
const keyData = new Uint8Array(atob(pem.replace(replace, ''))
|
|
@@ -64483,20 +64502,9 @@ const genericImport = async (replace, keyFormat, pem, alg, options) => {
|
|
|
64483
64502
|
keyUsages = isPublic ? ['verify'] : ['sign'];
|
|
64484
64503
|
break;
|
|
64485
64504
|
default:
|
|
64486
|
-
throw new
|
|
64487
|
-
}
|
|
64488
|
-
try {
|
|
64489
|
-
return await _webcrypto_js__WEBPACK_IMPORTED_MODULE_1__["default"].subtle.importKey(keyFormat, keyData, algorithm, (_a = options === null || options === void 0 ? void 0 : options.extractable) !== null && _a !== void 0 ? _a : false, keyUsages);
|
|
64490
|
-
}
|
|
64491
|
-
catch (err) {
|
|
64492
|
-
if (algorithm.name === 'Ed25519' &&
|
|
64493
|
-
(err === null || err === void 0 ? void 0 : err.name) === 'NotSupportedError' &&
|
|
64494
|
-
(0,_env_js__WEBPACK_IMPORTED_MODULE_0__.isCloudflareWorkers)()) {
|
|
64495
|
-
algorithm = { name: 'NODE-ED25519', namedCurve: 'NODE-ED25519' };
|
|
64496
|
-
return await _webcrypto_js__WEBPACK_IMPORTED_MODULE_1__["default"].subtle.importKey(keyFormat, keyData, algorithm, (_b = options === null || options === void 0 ? void 0 : options.extractable) !== null && _b !== void 0 ? _b : false, keyUsages);
|
|
64497
|
-
}
|
|
64498
|
-
throw err;
|
|
64505
|
+
throw new _util_errors_js__WEBPACK_IMPORTED_MODULE_4__.JOSENotSupported('Invalid or unsupported "alg" (Algorithm) value');
|
|
64499
64506
|
}
|
|
64507
|
+
return _webcrypto_js__WEBPACK_IMPORTED_MODULE_0__["default"].subtle.importKey(keyFormat, keyData, algorithm, (_a = options === null || options === void 0 ? void 0 : options.extractable) !== null && _a !== void 0 ? _a : false, keyUsages);
|
|
64500
64508
|
};
|
|
64501
64509
|
const fromPKCS8 = (pem, alg, options) => {
|
|
64502
64510
|
return genericImport(/(?:-----(?:BEGIN|END) PRIVATE KEY-----|\s)/g, 'pkcs8', pem, alg, options);
|
|
@@ -64565,12 +64573,12 @@ function parseElement(bytes) {
|
|
|
64565
64573
|
}
|
|
64566
64574
|
function spkiFromX509(buf) {
|
|
64567
64575
|
const tbsCertificate = getElement(getElement(parseElement(buf).contents)[0].contents);
|
|
64568
|
-
return (0,
|
|
64576
|
+
return (0,_base64url_js__WEBPACK_IMPORTED_MODULE_2__.encodeBase64)(tbsCertificate[tbsCertificate[0].raw[0] === 0xa0 ? 6 : 5].raw);
|
|
64569
64577
|
}
|
|
64570
64578
|
function getSPKI(x509) {
|
|
64571
64579
|
const pem = x509.replace(/(?:-----(?:BEGIN|END) CERTIFICATE-----|\s)/g, '');
|
|
64572
|
-
const raw = (0,
|
|
64573
|
-
return (0,
|
|
64580
|
+
const raw = (0,_base64url_js__WEBPACK_IMPORTED_MODULE_2__.decodeBase64)(pem);
|
|
64581
|
+
return (0,_lib_format_pem_js__WEBPACK_IMPORTED_MODULE_3__["default"])(spkiFromX509(raw), 'PUBLIC KEY');
|
|
64574
64582
|
}
|
|
64575
64583
|
const fromX509 = (pem, alg, options) => {
|
|
64576
64584
|
let spki;
|
|
@@ -64998,26 +65006,6 @@ const encrypt = async (enc, plaintext, cek, iv, aad) => {
|
|
|
64998
65006
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (encrypt);
|
|
64999
65007
|
|
|
65000
65008
|
|
|
65001
|
-
/***/ }),
|
|
65002
|
-
|
|
65003
|
-
/***/ "./node_modules/jose/dist/browser/runtime/env.js":
|
|
65004
|
-
/*!*******************************************************!*\
|
|
65005
|
-
!*** ./node_modules/jose/dist/browser/runtime/env.js ***!
|
|
65006
|
-
\*******************************************************/
|
|
65007
|
-
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
65008
|
-
|
|
65009
|
-
"use strict";
|
|
65010
|
-
__webpack_require__.r(__webpack_exports__);
|
|
65011
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
65012
|
-
/* harmony export */ "isCloudflareWorkers": () => (/* binding */ isCloudflareWorkers)
|
|
65013
|
-
/* harmony export */ });
|
|
65014
|
-
function isCloudflareWorkers() {
|
|
65015
|
-
return (typeof WebSocketPair !== 'undefined' ||
|
|
65016
|
-
(typeof navigator !== 'undefined' && navigator.userAgent === 'Cloudflare-Workers') ||
|
|
65017
|
-
(typeof EdgeRuntime !== 'undefined' && EdgeRuntime === 'vercel'));
|
|
65018
|
-
}
|
|
65019
|
-
|
|
65020
|
-
|
|
65021
65009
|
/***/ }),
|
|
65022
65010
|
|
|
65023
65011
|
/***/ "./node_modules/jose/dist/browser/runtime/fetch_jwks.js":
|
|
@@ -65082,11 +65070,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
65082
65070
|
/* harmony export */ "generateKeyPair": () => (/* binding */ generateKeyPair),
|
|
65083
65071
|
/* harmony export */ "generateSecret": () => (/* binding */ generateSecret)
|
|
65084
65072
|
/* harmony export */ });
|
|
65085
|
-
/* harmony import */ var
|
|
65086
|
-
/* harmony import */ var
|
|
65087
|
-
/* harmony import */ var
|
|
65088
|
-
/* harmony import */ var _random_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./random.js */ "./node_modules/jose/dist/browser/runtime/random.js");
|
|
65089
|
-
|
|
65073
|
+
/* harmony import */ var _webcrypto_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./webcrypto.js */ "./node_modules/jose/dist/browser/runtime/webcrypto.js");
|
|
65074
|
+
/* harmony import */ var _util_errors_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/errors.js */ "./node_modules/jose/dist/browser/util/errors.js");
|
|
65075
|
+
/* harmony import */ var _random_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./random.js */ "./node_modules/jose/dist/browser/runtime/random.js");
|
|
65090
65076
|
|
|
65091
65077
|
|
|
65092
65078
|
|
|
@@ -65107,7 +65093,7 @@ async function generateSecret(alg, options) {
|
|
|
65107
65093
|
case 'A192CBC-HS384':
|
|
65108
65094
|
case 'A256CBC-HS512':
|
|
65109
65095
|
length = parseInt(alg.slice(-3), 10);
|
|
65110
|
-
return (0,
|
|
65096
|
+
return (0,_random_js__WEBPACK_IMPORTED_MODULE_2__["default"])(new Uint8Array(length >> 3));
|
|
65111
65097
|
case 'A128KW':
|
|
65112
65098
|
case 'A192KW':
|
|
65113
65099
|
case 'A256KW':
|
|
@@ -65126,20 +65112,20 @@ async function generateSecret(alg, options) {
|
|
|
65126
65112
|
keyUsages = ['encrypt', 'decrypt'];
|
|
65127
65113
|
break;
|
|
65128
65114
|
default:
|
|
65129
|
-
throw new
|
|
65115
|
+
throw new _util_errors_js__WEBPACK_IMPORTED_MODULE_1__.JOSENotSupported('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');
|
|
65130
65116
|
}
|
|
65131
|
-
return
|
|
65117
|
+
return _webcrypto_js__WEBPACK_IMPORTED_MODULE_0__["default"].subtle.generateKey(algorithm, (_a = options === null || options === void 0 ? void 0 : options.extractable) !== null && _a !== void 0 ? _a : false, keyUsages);
|
|
65132
65118
|
}
|
|
65133
65119
|
function getModulusLengthOption(options) {
|
|
65134
65120
|
var _a;
|
|
65135
65121
|
const modulusLength = (_a = options === null || options === void 0 ? void 0 : options.modulusLength) !== null && _a !== void 0 ? _a : 2048;
|
|
65136
65122
|
if (typeof modulusLength !== 'number' || modulusLength < 2048) {
|
|
65137
|
-
throw new
|
|
65123
|
+
throw new _util_errors_js__WEBPACK_IMPORTED_MODULE_1__.JOSENotSupported('Invalid or unsupported modulusLength option provided, 2048 bits or larger keys must be used');
|
|
65138
65124
|
}
|
|
65139
65125
|
return modulusLength;
|
|
65140
65126
|
}
|
|
65141
65127
|
async function generateKeyPair(alg, options) {
|
|
65142
|
-
var _a, _b, _c
|
|
65128
|
+
var _a, _b, _c;
|
|
65143
65129
|
let algorithm;
|
|
65144
65130
|
let keyUsages;
|
|
65145
65131
|
switch (alg) {
|
|
@@ -65198,7 +65184,7 @@ async function generateKeyPair(alg, options) {
|
|
|
65198
65184
|
algorithm = { name: crv };
|
|
65199
65185
|
break;
|
|
65200
65186
|
default:
|
|
65201
|
-
throw new
|
|
65187
|
+
throw new _util_errors_js__WEBPACK_IMPORTED_MODULE_1__.JOSENotSupported('Invalid or unsupported crv option provided');
|
|
65202
65188
|
}
|
|
65203
65189
|
break;
|
|
65204
65190
|
case 'ECDH-ES':
|
|
@@ -65219,25 +65205,14 @@ async function generateKeyPair(alg, options) {
|
|
|
65219
65205
|
algorithm = { name: crv };
|
|
65220
65206
|
break;
|
|
65221
65207
|
default:
|
|
65222
|
-
throw new
|
|
65208
|
+
throw new _util_errors_js__WEBPACK_IMPORTED_MODULE_1__.JOSENotSupported('Invalid or unsupported crv option provided, supported values are P-256, P-384, P-521, X25519, and X448');
|
|
65223
65209
|
}
|
|
65224
65210
|
break;
|
|
65225
65211
|
}
|
|
65226
65212
|
default:
|
|
65227
|
-
throw new
|
|
65228
|
-
}
|
|
65229
|
-
try {
|
|
65230
|
-
return (await _webcrypto_js__WEBPACK_IMPORTED_MODULE_1__["default"].subtle.generateKey(algorithm, (_c = options === null || options === void 0 ? void 0 : options.extractable) !== null && _c !== void 0 ? _c : false, keyUsages));
|
|
65231
|
-
}
|
|
65232
|
-
catch (err) {
|
|
65233
|
-
if (algorithm.name === 'Ed25519' &&
|
|
65234
|
-
(err === null || err === void 0 ? void 0 : err.name) === 'NotSupportedError' &&
|
|
65235
|
-
(0,_env_js__WEBPACK_IMPORTED_MODULE_0__.isCloudflareWorkers)()) {
|
|
65236
|
-
algorithm = { name: 'NODE-ED25519', namedCurve: 'NODE-ED25519' };
|
|
65237
|
-
return (await _webcrypto_js__WEBPACK_IMPORTED_MODULE_1__["default"].subtle.generateKey(algorithm, (_d = options === null || options === void 0 ? void 0 : options.extractable) !== null && _d !== void 0 ? _d : false, keyUsages));
|
|
65238
|
-
}
|
|
65239
|
-
throw err;
|
|
65213
|
+
throw new _util_errors_js__WEBPACK_IMPORTED_MODULE_1__.JOSENotSupported('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');
|
|
65240
65214
|
}
|
|
65215
|
+
return (_webcrypto_js__WEBPACK_IMPORTED_MODULE_0__["default"].subtle.generateKey(algorithm, (_c = options === null || options === void 0 ? void 0 : options.extractable) !== null && _c !== void 0 ? _c : false, keyUsages));
|
|
65241
65216
|
}
|
|
65242
65217
|
|
|
65243
65218
|
|
|
@@ -65312,11 +65287,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
65312
65287
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
65313
65288
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
65314
65289
|
/* harmony export */ });
|
|
65315
|
-
/* harmony import */ var
|
|
65316
|
-
/* harmony import */ var
|
|
65317
|
-
/* harmony import */ var
|
|
65318
|
-
/* harmony import */ var _base64url_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./base64url.js */ "./node_modules/jose/dist/browser/runtime/base64url.js");
|
|
65319
|
-
|
|
65290
|
+
/* harmony import */ var _webcrypto_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./webcrypto.js */ "./node_modules/jose/dist/browser/runtime/webcrypto.js");
|
|
65291
|
+
/* harmony import */ var _util_errors_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/errors.js */ "./node_modules/jose/dist/browser/util/errors.js");
|
|
65292
|
+
/* harmony import */ var _base64url_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./base64url.js */ "./node_modules/jose/dist/browser/runtime/base64url.js");
|
|
65320
65293
|
|
|
65321
65294
|
|
|
65322
65295
|
|
|
@@ -65335,7 +65308,7 @@ function subtleMapping(jwk) {
|
|
|
65335
65308
|
case 'A128CBC-HS256':
|
|
65336
65309
|
case 'A192CBC-HS384':
|
|
65337
65310
|
case 'A256CBC-HS512':
|
|
65338
|
-
throw new
|
|
65311
|
+
throw new _util_errors_js__WEBPACK_IMPORTED_MODULE_1__.JOSENotSupported(`${jwk.alg} keys cannot be imported as CryptoKey instances`);
|
|
65339
65312
|
case 'A128GCM':
|
|
65340
65313
|
case 'A192GCM':
|
|
65341
65314
|
case 'A256GCM':
|
|
@@ -65358,7 +65331,7 @@ function subtleMapping(jwk) {
|
|
|
65358
65331
|
keyUsages = ['deriveBits'];
|
|
65359
65332
|
break;
|
|
65360
65333
|
default:
|
|
65361
|
-
throw new
|
|
65334
|
+
throw new _util_errors_js__WEBPACK_IMPORTED_MODULE_1__.JOSENotSupported('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');
|
|
65362
65335
|
}
|
|
65363
65336
|
break;
|
|
65364
65337
|
}
|
|
@@ -65387,7 +65360,7 @@ function subtleMapping(jwk) {
|
|
|
65387
65360
|
keyUsages = jwk.d ? ['decrypt', 'unwrapKey'] : ['encrypt', 'wrapKey'];
|
|
65388
65361
|
break;
|
|
65389
65362
|
default:
|
|
65390
|
-
throw new
|
|
65363
|
+
throw new _util_errors_js__WEBPACK_IMPORTED_MODULE_1__.JOSENotSupported('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');
|
|
65391
65364
|
}
|
|
65392
65365
|
break;
|
|
65393
65366
|
}
|
|
@@ -65413,7 +65386,7 @@ function subtleMapping(jwk) {
|
|
|
65413
65386
|
keyUsages = jwk.d ? ['deriveBits'] : [];
|
|
65414
65387
|
break;
|
|
65415
65388
|
default:
|
|
65416
|
-
throw new
|
|
65389
|
+
throw new _util_errors_js__WEBPACK_IMPORTED_MODULE_1__.JOSENotSupported('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');
|
|
65417
65390
|
}
|
|
65418
65391
|
break;
|
|
65419
65392
|
}
|
|
@@ -65431,12 +65404,12 @@ function subtleMapping(jwk) {
|
|
|
65431
65404
|
keyUsages = jwk.d ? ['deriveBits'] : [];
|
|
65432
65405
|
break;
|
|
65433
65406
|
default:
|
|
65434
|
-
throw new
|
|
65407
|
+
throw new _util_errors_js__WEBPACK_IMPORTED_MODULE_1__.JOSENotSupported('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');
|
|
65435
65408
|
}
|
|
65436
65409
|
break;
|
|
65437
65410
|
}
|
|
65438
65411
|
default:
|
|
65439
|
-
throw new
|
|
65412
|
+
throw new _util_errors_js__WEBPACK_IMPORTED_MODULE_1__.JOSENotSupported('Invalid or unsupported JWK "kty" (Key Type) Parameter value');
|
|
65440
65413
|
}
|
|
65441
65414
|
return { algorithm, keyUsages };
|
|
65442
65415
|
}
|
|
@@ -65452,23 +65425,12 @@ const parse = async (jwk) => {
|
|
|
65452
65425
|
(_b = jwk.key_ops) !== null && _b !== void 0 ? _b : keyUsages,
|
|
65453
65426
|
];
|
|
65454
65427
|
if (algorithm.name === 'PBKDF2') {
|
|
65455
|
-
return
|
|
65428
|
+
return _webcrypto_js__WEBPACK_IMPORTED_MODULE_0__["default"].subtle.importKey('raw', (0,_base64url_js__WEBPACK_IMPORTED_MODULE_2__.decode)(jwk.k), ...rest);
|
|
65456
65429
|
}
|
|
65457
65430
|
const keyData = { ...jwk };
|
|
65458
65431
|
delete keyData.alg;
|
|
65459
65432
|
delete keyData.use;
|
|
65460
|
-
|
|
65461
|
-
return await _webcrypto_js__WEBPACK_IMPORTED_MODULE_1__["default"].subtle.importKey('jwk', keyData, ...rest);
|
|
65462
|
-
}
|
|
65463
|
-
catch (err) {
|
|
65464
|
-
if (algorithm.name === 'Ed25519' &&
|
|
65465
|
-
(err === null || err === void 0 ? void 0 : err.name) === 'NotSupportedError' &&
|
|
65466
|
-
(0,_env_js__WEBPACK_IMPORTED_MODULE_0__.isCloudflareWorkers)()) {
|
|
65467
|
-
rest[0] = { name: 'NODE-ED25519', namedCurve: 'NODE-ED25519' };
|
|
65468
|
-
return await _webcrypto_js__WEBPACK_IMPORTED_MODULE_1__["default"].subtle.importKey('jwk', keyData, ...rest);
|
|
65469
|
-
}
|
|
65470
|
-
throw err;
|
|
65471
|
-
}
|
|
65433
|
+
return _webcrypto_js__WEBPACK_IMPORTED_MODULE_0__["default"].subtle.importKey('jwk', keyData, ...rest);
|
|
65472
65434
|
};
|
|
65473
65435
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (parse);
|
|
65474
65436
|
|
|
@@ -65710,9 +65672,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
65710
65672
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
65711
65673
|
/* harmony export */ "default": () => (/* binding */ subtleDsa)
|
|
65712
65674
|
/* harmony export */ });
|
|
65713
|
-
/* harmony import */ var
|
|
65714
|
-
/* harmony import */ var _util_errors_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/errors.js */ "./node_modules/jose/dist/browser/util/errors.js");
|
|
65715
|
-
|
|
65675
|
+
/* harmony import */ var _util_errors_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util/errors.js */ "./node_modules/jose/dist/browser/util/errors.js");
|
|
65716
65676
|
|
|
65717
65677
|
function subtleDsa(alg, algorithm) {
|
|
65718
65678
|
const hash = `SHA-${alg.slice(-3)}`;
|
|
@@ -65734,12 +65694,9 @@ function subtleDsa(alg, algorithm) {
|
|
|
65734
65694
|
case 'ES512':
|
|
65735
65695
|
return { hash, name: 'ECDSA', namedCurve: algorithm.namedCurve };
|
|
65736
65696
|
case 'EdDSA':
|
|
65737
|
-
if ((0,_env_js__WEBPACK_IMPORTED_MODULE_0__.isCloudflareWorkers)() && algorithm.name === 'NODE-ED25519') {
|
|
65738
|
-
return { name: 'NODE-ED25519', namedCurve: 'NODE-ED25519' };
|
|
65739
|
-
}
|
|
65740
65697
|
return { name: algorithm.name };
|
|
65741
65698
|
default:
|
|
65742
|
-
throw new
|
|
65699
|
+
throw new _util_errors_js__WEBPACK_IMPORTED_MODULE_0__.JOSENotSupported(`alg ${alg} is not supported either by JOSE or your javascript runtime`);
|
|
65743
65700
|
}
|
|
65744
65701
|
}
|
|
65745
65702
|
|