solid-ui 2.4.16-74e478b4 → 2.4.16-95fad2d0
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 +1 -0
- package/lib/participation.d.ts.map +1 -1
- package/lib/participation.js +59 -30
- package/lib/participation.js.map +1 -1
- package/lib/versionInfo.js +9 -9
- package/lib/versionInfo.js.map +1 -1
- package/lib/webpack-bundle.js +204 -117
- package/lib/webpack-bundle.js.map +1 -1
- package/package.json +3 -3
package/lib/webpack-bundle.js
CHANGED
|
@@ -11295,6 +11295,8 @@ var _wrapNativeSuper2 = _interopRequireDefault(__webpack_require__(/*! @babel/ru
|
|
|
11295
11295
|
|
|
11296
11296
|
var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "./node_modules/@babel/runtime/helpers/defineProperty.js"));
|
|
11297
11297
|
|
|
11298
|
+
var debug = _interopRequireWildcard(__webpack_require__(/*! ./debug */ "./lib/debug.js"));
|
|
11299
|
+
|
|
11298
11300
|
var _rdflib = __webpack_require__(/*! rdflib */ "./node_modules/rdflib/esm/index.js");
|
|
11299
11301
|
|
|
11300
11302
|
var ns = _interopRequireWildcard(__webpack_require__(/*! ./ns */ "./lib/ns.js"));
|
|
@@ -11305,14 +11307,18 @@ var _utils = __webpack_require__(/*! ./utils */ "./lib/utils/index.js");
|
|
|
11305
11307
|
|
|
11306
11308
|
var _pad = __webpack_require__(/*! ./pad */ "./lib/pad.js");
|
|
11307
11309
|
|
|
11308
|
-
var _debug = __webpack_require__(/*! ./debug */ "./lib/debug.js");
|
|
11309
|
-
|
|
11310
11310
|
var _solidLogic = __webpack_require__(/*! solid-logic */ "./node_modules/solid-logic/lib/index.js");
|
|
11311
11311
|
|
|
11312
11312
|
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); }
|
|
11313
11313
|
|
|
11314
11314
|
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; }
|
|
11315
11315
|
|
|
11316
|
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
11317
|
+
|
|
11318
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
11319
|
+
|
|
11320
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
11321
|
+
|
|
11316
11322
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
|
|
11317
11323
|
|
|
11318
11324
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
@@ -11339,7 +11345,7 @@ var ParticipationTableElement = /*#__PURE__*/function (_HTMLTableElement) {
|
|
|
11339
11345
|
return (0, _createClass2["default"])(ParticipationTableElement);
|
|
11340
11346
|
}( /*#__PURE__*/(0, _wrapNativeSuper2["default"])(HTMLTableElement));
|
|
11341
11347
|
|
|
11342
|
-
var
|
|
11348
|
+
var store = _solidLogic.solidLogicSingleton.store;
|
|
11343
11349
|
/** Manage participation in this session
|
|
11344
11350
|
*
|
|
11345
11351
|
* @param {Document} dom - the web page loaded into the browser
|
|
@@ -11354,7 +11360,7 @@ function renderPartipants(dom, table, unused1, subject, unused2, options) {
|
|
|
11354
11360
|
table.setAttribute('style', 'margin: 0.8em;');
|
|
11355
11361
|
|
|
11356
11362
|
var newRowForParticpation = function newRowForParticpation(parp) {
|
|
11357
|
-
var person =
|
|
11363
|
+
var person = store.any(parp, ns.wf('participant'));
|
|
11358
11364
|
var tr;
|
|
11359
11365
|
|
|
11360
11366
|
if (!person) {
|
|
@@ -11364,7 +11370,7 @@ function renderPartipants(dom, table, unused1, subject, unused2, options) {
|
|
|
11364
11370
|
return tr;
|
|
11365
11371
|
}
|
|
11366
11372
|
|
|
11367
|
-
var bg =
|
|
11373
|
+
var bg = store.anyValue(parp, ns.ui('backgroundColor')) || 'white';
|
|
11368
11374
|
var block = dom.createElement('div');
|
|
11369
11375
|
block.setAttribute('style', 'height: 1.5em; width: 1.5em; margin: 0.3em; border 0.01em solid #888; background-color: ' + bg);
|
|
11370
11376
|
tr = (0, _widgets.personTR)(dom, null, person, options);
|
|
@@ -11377,9 +11383,9 @@ function renderPartipants(dom, table, unused1, subject, unused2, options) {
|
|
|
11377
11383
|
};
|
|
11378
11384
|
|
|
11379
11385
|
var syncTable = function syncTable() {
|
|
11380
|
-
var parps =
|
|
11381
|
-
(0,
|
|
11382
|
-
return [
|
|
11386
|
+
var parps = store.each(subject, ns.wf('participation')).map(function (parp) {
|
|
11387
|
+
(0, debug.log)('in participants');
|
|
11388
|
+
return [store.anyValue(parp, ns.cal('dtstart')) || '9999-12-31', parp];
|
|
11383
11389
|
});
|
|
11384
11390
|
parps.sort(); // List in order of joining
|
|
11385
11391
|
|
|
@@ -11407,36 +11413,57 @@ function renderPartipants(dom, table, unused1, subject, unused2, options) {
|
|
|
11407
11413
|
function participationObject(subject, padDoc, me) {
|
|
11408
11414
|
return new Promise(function (resolve, reject) {
|
|
11409
11415
|
if (!me) {
|
|
11410
|
-
throw new Error('
|
|
11416
|
+
throw new Error('No user id');
|
|
11411
11417
|
}
|
|
11412
11418
|
|
|
11413
|
-
var parps =
|
|
11414
|
-
return
|
|
11419
|
+
var parps = store.each(subject, ns.wf('participation')).filter(function (pn) {
|
|
11420
|
+
return store.holds(pn, ns.wf('participant'), me);
|
|
11415
11421
|
});
|
|
11416
11422
|
|
|
11417
11423
|
if (parps.length > 1) {
|
|
11418
|
-
|
|
11424
|
+
// This can happen. https://github.com/solid/chat-pane/issues/71
|
|
11425
|
+
var candidates = [];
|
|
11426
|
+
|
|
11427
|
+
var _iterator = _createForOfIteratorHelper(parps),
|
|
11428
|
+
_step;
|
|
11429
|
+
|
|
11430
|
+
try {
|
|
11431
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
11432
|
+
var participation = _step.value;
|
|
11433
|
+
var date = store.anyValue(participation, ns.cal('dtstart'));
|
|
11434
|
+
|
|
11435
|
+
if (date) {
|
|
11436
|
+
candidates.push([date, participation]);
|
|
11437
|
+
}
|
|
11438
|
+
}
|
|
11439
|
+
} catch (err) {
|
|
11440
|
+
_iterator.e(err);
|
|
11441
|
+
} finally {
|
|
11442
|
+
_iterator.f();
|
|
11443
|
+
}
|
|
11444
|
+
|
|
11445
|
+
candidates.sort(); // Pick the earliest
|
|
11446
|
+
// @@ Possibly, for extra credit, delete the others, if we have write access
|
|
11447
|
+
|
|
11448
|
+
debug.warn('Multiple particpation objects, picking earliest, in ' + padDoc);
|
|
11449
|
+
resolve(candidates[0][1]); // throw new Error('Multiple records of your participation')
|
|
11419
11450
|
}
|
|
11420
11451
|
|
|
11421
11452
|
if (parps.length) {
|
|
11422
11453
|
// If I am not already recorded
|
|
11423
11454
|
resolve(parps[0]); // returns the particpation object
|
|
11424
11455
|
} else {
|
|
11425
|
-
var
|
|
11426
|
-
var ins = [(0, _rdflib.st)(subject, ns.wf('participation'), participation, padDoc), (0, _rdflib.st)(participation, ns.wf('participant'), me, padDoc), (0, _rdflib.st)(participation, ns.cal('dtstart'), new Date(), padDoc), (0, _rdflib.st)(participation, ns.ui('backgroundColor'), (0, _pad.lightColorHash)(me), padDoc)];
|
|
11456
|
+
var _participation2 = (0, _widgets.newThing)(padDoc);
|
|
11427
11457
|
|
|
11428
|
-
|
|
11429
|
-
|
|
11430
|
-
}
|
|
11431
|
-
|
|
11432
|
-
kb.updater.update([], ins, function (uri, ok, errorMessage) {
|
|
11458
|
+
var ins = [(0, _rdflib.st)(subject, ns.wf('participation'), _participation2, padDoc), (0, _rdflib.st)(_participation2, ns.wf('participant'), me, padDoc), (0, _rdflib.st)(_participation2, ns.cal('dtstart'), new Date(), padDoc), (0, _rdflib.st)(_participation2, ns.ui('backgroundColor'), (0, _pad.lightColorHash)(me), padDoc)];
|
|
11459
|
+
store.updater.update([], ins, function (uri, ok, errorMessage) {
|
|
11433
11460
|
if (!ok) {
|
|
11434
11461
|
reject(new Error('Error recording your partipation: ' + errorMessage));
|
|
11435
11462
|
} else {
|
|
11436
|
-
resolve(
|
|
11463
|
+
resolve(_participation2);
|
|
11437
11464
|
}
|
|
11438
11465
|
});
|
|
11439
|
-
resolve(
|
|
11466
|
+
resolve(_participation2);
|
|
11440
11467
|
}
|
|
11441
11468
|
});
|
|
11442
11469
|
}
|
|
@@ -11454,8 +11481,8 @@ function recordParticipation(subject, padDoc, refreshable) {
|
|
|
11454
11481
|
|
|
11455
11482
|
if (!me) return; // Not logged in
|
|
11456
11483
|
|
|
11457
|
-
var parps =
|
|
11458
|
-
return
|
|
11484
|
+
var parps = store.each(subject, ns.wf('participation')).filter(function (pn) {
|
|
11485
|
+
return store.holds(pn, ns.wf('participant'), me);
|
|
11459
11486
|
});
|
|
11460
11487
|
|
|
11461
11488
|
if (parps.length > 1) {
|
|
@@ -11466,14 +11493,14 @@ function recordParticipation(subject, padDoc, refreshable) {
|
|
|
11466
11493
|
// If I am not already recorded
|
|
11467
11494
|
return parps[0]; // returns the particpation object
|
|
11468
11495
|
} else {
|
|
11469
|
-
|
|
11470
|
-
|
|
11471
|
-
|
|
11472
|
-
if (!kb.updater) {
|
|
11473
|
-
throw new Error('kb has no updater');
|
|
11496
|
+
if (!store.updater.editable(padDoc)) {
|
|
11497
|
+
debug.log('Not recording participation, as no write acesss as ' + me + ' to ' + padDoc);
|
|
11498
|
+
return null;
|
|
11474
11499
|
}
|
|
11475
11500
|
|
|
11476
|
-
|
|
11501
|
+
var participation = (0, _widgets.newThing)(padDoc);
|
|
11502
|
+
var ins = [(0, _rdflib.st)(subject, ns.wf('participation'), participation, padDoc), (0, _rdflib.st)(participation, ns.wf('participant'), me, padDoc), (0, _rdflib.st)(participation, ns.cal('dtstart'), new Date(), padDoc), (0, _rdflib.st)(participation, ns.ui('backgroundColor'), (0, _pad.lightColorHash)(me), padDoc)];
|
|
11503
|
+
store.updater.update([], ins, function (uri, ok, errorMessage) {
|
|
11477
11504
|
if (!ok) {
|
|
11478
11505
|
throw new Error('Error recording your partipation: ' + errorMessage);
|
|
11479
11506
|
}
|
|
@@ -11503,8 +11530,10 @@ function manageParticipation(dom, container, padDoc, subject, me, options) {
|
|
|
11503
11530
|
container.appendChild(table);
|
|
11504
11531
|
renderPartipants(dom, table, padDoc, subject, me, options);
|
|
11505
11532
|
|
|
11533
|
+
var _participation;
|
|
11534
|
+
|
|
11506
11535
|
try {
|
|
11507
|
-
recordParticipation(subject, padDoc, table);
|
|
11536
|
+
_participation = recordParticipation(subject, padDoc, table);
|
|
11508
11537
|
} catch (e) {
|
|
11509
11538
|
container.appendChild((0, _widgets.errorMessageBlock)(dom, 'Error recording your partipation: ' + e)); // Clean up?
|
|
11510
11539
|
}
|
|
@@ -15126,23 +15155,23 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
15126
15155
|
});
|
|
15127
15156
|
exports["default"] = void 0;
|
|
15128
15157
|
var _default = {
|
|
15129
|
-
buildTime: '2022-02-
|
|
15130
|
-
commit: '
|
|
15158
|
+
buildTime: '2022-02-22T11:38:35Z',
|
|
15159
|
+
commit: '95fad2d0d00906c65f888869a788719e15b6726e',
|
|
15131
15160
|
npmInfo: {
|
|
15132
15161
|
'solid-ui': '2.4.16',
|
|
15133
|
-
npm: '6.14.
|
|
15162
|
+
npm: '6.14.16',
|
|
15134
15163
|
ares: '1.18.1',
|
|
15135
15164
|
brotli: '1.0.9',
|
|
15136
|
-
cldr: '
|
|
15137
|
-
icu: '
|
|
15165
|
+
cldr: '40.0',
|
|
15166
|
+
icu: '70.1',
|
|
15138
15167
|
llhttp: '2.1.4',
|
|
15139
15168
|
modules: '83',
|
|
15140
15169
|
napi: '8',
|
|
15141
15170
|
nghttp2: '1.42.0',
|
|
15142
|
-
node: '14.
|
|
15143
|
-
openssl: '1.1.
|
|
15144
|
-
tz: '
|
|
15145
|
-
unicode: '
|
|
15171
|
+
node: '14.19.0',
|
|
15172
|
+
openssl: '1.1.1m',
|
|
15173
|
+
tz: '2021a3',
|
|
15174
|
+
unicode: '14.0',
|
|
15146
15175
|
uv: '1.42.0',
|
|
15147
15176
|
v8: '8.4.371.23-node.85',
|
|
15148
15177
|
zlib: '1.2.11'
|
|
@@ -24408,9 +24437,6 @@ const issuerConfigKeyMap = {
|
|
|
24408
24437
|
toKey: "opTosUri",
|
|
24409
24438
|
convertToUrl: true,
|
|
24410
24439
|
},
|
|
24411
|
-
solid_oidc_supported: {
|
|
24412
|
-
toKey: "solidOidcSupported",
|
|
24413
|
-
},
|
|
24414
24440
|
};
|
|
24415
24441
|
function processConfig(config) {
|
|
24416
24442
|
const parsedConfig = {};
|
|
@@ -25079,16 +25105,13 @@ exports.generateDpopKeyPair = exports.createDpopHeader = void 0;
|
|
|
25079
25105
|
const jose_1 = __webpack_require__(/*! jose */ "./node_modules/jose/dist/browser/index.js");
|
|
25080
25106
|
const uuid_1 = __webpack_require__(/*! uuid */ "./node_modules/uuid/dist/esm-browser/index.js");
|
|
25081
25107
|
const constant_1 = __webpack_require__(/*! ../constant */ "./node_modules/@inrupt/solid-client-authn-core/dist/constant.js");
|
|
25082
|
-
function
|
|
25083
|
-
const
|
|
25084
|
-
|
|
25085
|
-
cleanedAudience.username = "";
|
|
25086
|
-
cleanedAudience.password = "";
|
|
25087
|
-
return cleanedAudience.toString();
|
|
25108
|
+
function normalizeHTU(audience) {
|
|
25109
|
+
const audienceUrl = new URL(audience);
|
|
25110
|
+
return new URL(audienceUrl.pathname, audienceUrl.origin).toString();
|
|
25088
25111
|
}
|
|
25089
25112
|
async function createDpopHeader(audience, method, dpopKey) {
|
|
25090
25113
|
return new jose_1.SignJWT({
|
|
25091
|
-
htu:
|
|
25114
|
+
htu: normalizeHTU(audience),
|
|
25092
25115
|
htm: method.toUpperCase(),
|
|
25093
25116
|
jti: (0, uuid_1.v4)(),
|
|
25094
25117
|
})
|
|
@@ -25531,8 +25554,7 @@ function determineClientType(options, issuerConfig) {
|
|
|
25531
25554
|
if (options.clientId !== undefined && !isValidUrl(options.clientId)) {
|
|
25532
25555
|
return "static";
|
|
25533
25556
|
}
|
|
25534
|
-
if (issuerConfig.
|
|
25535
|
-
"https://solidproject.org/TR/solid-oidc" &&
|
|
25557
|
+
if (issuerConfig.scopesSupported.includes("webid") &&
|
|
25536
25558
|
options.clientId !== undefined &&
|
|
25537
25559
|
isValidUrl(options.clientId)) {
|
|
25538
25560
|
return "solid-oidc";
|
|
@@ -28328,7 +28350,7 @@ var tagNamePattern = new RegExp('^'+nameStartChar.source+nameChar.source+'*(?:\:
|
|
|
28328
28350
|
//S_TAG, S_ATTR, S_EQ, S_ATTR_NOQUOT_VALUE
|
|
28329
28351
|
//S_ATTR_SPACE, S_ATTR_END, S_TAG_SPACE, S_TAG_CLOSE
|
|
28330
28352
|
var S_TAG = 0;//tag name offerring
|
|
28331
|
-
var S_ATTR = 1;//attr name offerring
|
|
28353
|
+
var S_ATTR = 1;//attr name offerring
|
|
28332
28354
|
var S_ATTR_SPACE=2;//attr name end and space offer
|
|
28333
28355
|
var S_EQ = 3;//=space?
|
|
28334
28356
|
var S_ATTR_NOQUOT_VALUE = 4;//attr value(no quot value only)
|
|
@@ -28352,7 +28374,7 @@ ParseError.prototype = new Error();
|
|
|
28352
28374
|
ParseError.prototype.name = ParseError.name
|
|
28353
28375
|
|
|
28354
28376
|
function XMLReader(){
|
|
28355
|
-
|
|
28377
|
+
|
|
28356
28378
|
}
|
|
28357
28379
|
|
|
28358
28380
|
XMLReader.prototype = {
|
|
@@ -28381,8 +28403,8 @@ function parse(source,defaultNSMapCopy,entityMap,domBuilder,errorHandler){
|
|
|
28381
28403
|
}
|
|
28382
28404
|
function entityReplacer(a){
|
|
28383
28405
|
var k = a.slice(1,-1);
|
|
28384
|
-
if(k
|
|
28385
|
-
return entityMap[k];
|
|
28406
|
+
if (Object.hasOwnProperty.call(entityMap, k)) {
|
|
28407
|
+
return entityMap[k];
|
|
28386
28408
|
}else if(k.charAt(0) === '#'){
|
|
28387
28409
|
return fixedFromCharCode(parseInt(k.substr(1).replace('x','0x')))
|
|
28388
28410
|
}else{
|
|
@@ -28411,7 +28433,7 @@ function parse(source,defaultNSMapCopy,entityMap,domBuilder,errorHandler){
|
|
|
28411
28433
|
var lineEnd = 0;
|
|
28412
28434
|
var linePattern = /.*(?:\r\n?|\n)|.*$/g
|
|
28413
28435
|
var locator = domBuilder.locator;
|
|
28414
|
-
|
|
28436
|
+
|
|
28415
28437
|
var parseStack = [{currentNSMap:defaultNSMapCopy}]
|
|
28416
28438
|
var closeMap = {};
|
|
28417
28439
|
var start = 0;
|
|
@@ -28436,7 +28458,7 @@ function parse(source,defaultNSMapCopy,entityMap,domBuilder,errorHandler){
|
|
|
28436
28458
|
var tagName = source.substring(tagStart + 2, end).replace(/[ \t\n\r]+$/g, '');
|
|
28437
28459
|
var config = parseStack.pop();
|
|
28438
28460
|
if(end<0){
|
|
28439
|
-
|
|
28461
|
+
|
|
28440
28462
|
tagName = source.substring(tagStart+2).replace(/[\s<].*/,'');
|
|
28441
28463
|
errorHandler.error("end tag name: "+tagName+' is not complete:'+config.tagName);
|
|
28442
28464
|
end = tagStart+1+tagName.length;
|
|
@@ -28461,7 +28483,7 @@ function parse(source,defaultNSMapCopy,entityMap,domBuilder,errorHandler){
|
|
|
28461
28483
|
}else{
|
|
28462
28484
|
parseStack.push(config)
|
|
28463
28485
|
}
|
|
28464
|
-
|
|
28486
|
+
|
|
28465
28487
|
end++;
|
|
28466
28488
|
break;
|
|
28467
28489
|
// end elment
|
|
@@ -28480,8 +28502,8 @@ function parse(source,defaultNSMapCopy,entityMap,domBuilder,errorHandler){
|
|
|
28480
28502
|
//elStartEnd
|
|
28481
28503
|
var end = parseElementStartPart(source,tagStart,el,currentNSMap,entityReplacer,errorHandler);
|
|
28482
28504
|
var len = el.length;
|
|
28483
|
-
|
|
28484
|
-
|
|
28505
|
+
|
|
28506
|
+
|
|
28485
28507
|
if(!el.closed && fixSelfClosed(source,end,el.tagName,closeMap)){
|
|
28486
28508
|
el.closed = true;
|
|
28487
28509
|
if(!entityMap.nbsp){
|
|
@@ -28751,7 +28773,7 @@ function appendElement(el,domBuilder,currentNSMap){
|
|
|
28751
28773
|
}
|
|
28752
28774
|
//can not set prefix,because prefix !== ''
|
|
28753
28775
|
a.localName = localName ;
|
|
28754
|
-
//prefix == null for no ns prefix attribute
|
|
28776
|
+
//prefix == null for no ns prefix attribute
|
|
28755
28777
|
if(nsPrefix !== false){//hack!!
|
|
28756
28778
|
if(localNSMap == null){
|
|
28757
28779
|
localNSMap = {}
|
|
@@ -28761,7 +28783,7 @@ function appendElement(el,domBuilder,currentNSMap){
|
|
|
28761
28783
|
}
|
|
28762
28784
|
currentNSMap[nsPrefix] = localNSMap[nsPrefix] = value;
|
|
28763
28785
|
a.uri = NAMESPACE.XMLNS
|
|
28764
|
-
domBuilder.startPrefixMapping(nsPrefix, value)
|
|
28786
|
+
domBuilder.startPrefixMapping(nsPrefix, value)
|
|
28765
28787
|
}
|
|
28766
28788
|
}
|
|
28767
28789
|
var i = el.length;
|
|
@@ -28773,7 +28795,7 @@ function appendElement(el,domBuilder,currentNSMap){
|
|
|
28773
28795
|
a.uri = NAMESPACE.XML;
|
|
28774
28796
|
}if(prefix !== 'xmlns'){
|
|
28775
28797
|
a.uri = currentNSMap[prefix || '']
|
|
28776
|
-
|
|
28798
|
+
|
|
28777
28799
|
//{console.log('###'+a.qName,domBuilder.locator.systemId+'',currentNSMap,a.uri)}
|
|
28778
28800
|
}
|
|
28779
28801
|
}
|
|
@@ -28795,7 +28817,7 @@ function appendElement(el,domBuilder,currentNSMap){
|
|
|
28795
28817
|
domBuilder.endElement(ns,localName,tagName);
|
|
28796
28818
|
if(localNSMap){
|
|
28797
28819
|
for(prefix in localNSMap){
|
|
28798
|
-
domBuilder.endPrefixMapping(prefix)
|
|
28820
|
+
domBuilder.endPrefixMapping(prefix)
|
|
28799
28821
|
}
|
|
28800
28822
|
}
|
|
28801
28823
|
}else{
|
|
@@ -28822,7 +28844,7 @@ function parseHtmlSpecialContent(source,elStartEnd,tagName,entityReplacer,domBui
|
|
|
28822
28844
|
domBuilder.characters(text,0,text.length);
|
|
28823
28845
|
return elEndStart;
|
|
28824
28846
|
//}
|
|
28825
|
-
|
|
28847
|
+
|
|
28826
28848
|
}
|
|
28827
28849
|
}
|
|
28828
28850
|
return elStartEnd+1;
|
|
@@ -28839,7 +28861,7 @@ function fixSelfClosed(source,elStartEnd,tagName,closeMap){
|
|
|
28839
28861
|
closeMap[tagName] =pos
|
|
28840
28862
|
}
|
|
28841
28863
|
return pos<elStartEnd;
|
|
28842
|
-
//}
|
|
28864
|
+
//}
|
|
28843
28865
|
}
|
|
28844
28866
|
function _copy(source,target){
|
|
28845
28867
|
for(var n in source){target[n] = source[n]}
|
|
@@ -28867,11 +28889,11 @@ function parseDCC(source,start,domBuilder,errorHandler){//sure start with '<!'
|
|
|
28867
28889
|
var end = source.indexOf(']]>',start+9);
|
|
28868
28890
|
domBuilder.startCDATA();
|
|
28869
28891
|
domBuilder.characters(source,start+9,end-start-9);
|
|
28870
|
-
domBuilder.endCDATA()
|
|
28892
|
+
domBuilder.endCDATA()
|
|
28871
28893
|
return end+3;
|
|
28872
28894
|
}
|
|
28873
28895
|
//<!DOCTYPE
|
|
28874
|
-
//startDTD(java.lang.String name, java.lang.String publicId, java.lang.String systemId)
|
|
28896
|
+
//startDTD(java.lang.String name, java.lang.String publicId, java.lang.String systemId)
|
|
28875
28897
|
var matchs = split(source,start);
|
|
28876
28898
|
var len = matchs.length;
|
|
28877
28899
|
if(len>1 && /!doctype/i.test(matchs[0][0])){
|
|
@@ -28889,7 +28911,7 @@ function parseDCC(source,start,domBuilder,errorHandler){//sure start with '<!'
|
|
|
28889
28911
|
var lastMatch = matchs[len-1]
|
|
28890
28912
|
domBuilder.startDTD(name, pubid, sysid);
|
|
28891
28913
|
domBuilder.endDTD();
|
|
28892
|
-
|
|
28914
|
+
|
|
28893
28915
|
return lastMatch.index+lastMatch[0].length
|
|
28894
28916
|
}
|
|
28895
28917
|
}
|
|
@@ -28938,7 +28960,7 @@ ElementAttributes.prototype = {
|
|
|
28938
28960
|
getValue:function(i){return this[i].value}
|
|
28939
28961
|
// ,getIndex:function(uri, localName)){
|
|
28940
28962
|
// if(localName){
|
|
28941
|
-
//
|
|
28963
|
+
//
|
|
28942
28964
|
// }else{
|
|
28943
28965
|
// var qName = uri
|
|
28944
28966
|
// }
|
|
@@ -35211,7 +35233,7 @@ function fromByteArray (uint8) {
|
|
|
35211
35233
|
|
|
35212
35234
|
var base64 = __webpack_require__(/*! base64-js */ "./node_modules/base64-js/index.js")
|
|
35213
35235
|
var ieee754 = __webpack_require__(/*! ieee754 */ "./node_modules/ieee754/index.js")
|
|
35214
|
-
var isArray = __webpack_require__(/*! isarray */ "./node_modules/isarray/index.js")
|
|
35236
|
+
var isArray = __webpack_require__(/*! isarray */ "./node_modules/buffer/node_modules/isarray/index.js")
|
|
35215
35237
|
|
|
35216
35238
|
exports.Buffer = Buffer
|
|
35217
35239
|
exports.SlowBuffer = SlowBuffer
|
|
@@ -36991,6 +37013,22 @@ function isnan (val) {
|
|
|
36991
37013
|
|
|
36992
37014
|
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js")))
|
|
36993
37015
|
|
|
37016
|
+
/***/ }),
|
|
37017
|
+
|
|
37018
|
+
/***/ "./node_modules/buffer/node_modules/isarray/index.js":
|
|
37019
|
+
/*!***********************************************************!*\
|
|
37020
|
+
!*** ./node_modules/buffer/node_modules/isarray/index.js ***!
|
|
37021
|
+
\***********************************************************/
|
|
37022
|
+
/*! no static exports found */
|
|
37023
|
+
/***/ (function(module, exports) {
|
|
37024
|
+
|
|
37025
|
+
var toString = {}.toString;
|
|
37026
|
+
|
|
37027
|
+
module.exports = Array.isArray || function (arr) {
|
|
37028
|
+
return toString.call(arr) == '[object Array]';
|
|
37029
|
+
};
|
|
37030
|
+
|
|
37031
|
+
|
|
36994
37032
|
/***/ }),
|
|
36995
37033
|
|
|
36996
37034
|
/***/ "./node_modules/canonicalize/lib/canonicalize.js":
|
|
@@ -39027,29 +39065,13 @@ var isBrowser = (typeof window === "undefined" ? "undefined" : _typeof(window))
|
|
|
39027
39065
|
/* harmony default export */ __webpack_exports__["default"] = (isBrowser);
|
|
39028
39066
|
|
|
39029
39067
|
|
|
39030
|
-
/***/ }),
|
|
39031
|
-
|
|
39032
|
-
/***/ "./node_modules/isarray/index.js":
|
|
39033
|
-
/*!***************************************!*\
|
|
39034
|
-
!*** ./node_modules/isarray/index.js ***!
|
|
39035
|
-
\***************************************/
|
|
39036
|
-
/*! no static exports found */
|
|
39037
|
-
/***/ (function(module, exports) {
|
|
39038
|
-
|
|
39039
|
-
var toString = {}.toString;
|
|
39040
|
-
|
|
39041
|
-
module.exports = Array.isArray || function (arr) {
|
|
39042
|
-
return toString.call(arr) == '[object Array]';
|
|
39043
|
-
};
|
|
39044
|
-
|
|
39045
|
-
|
|
39046
39068
|
/***/ }),
|
|
39047
39069
|
|
|
39048
39070
|
/***/ "./node_modules/jose/dist/browser/index.js":
|
|
39049
39071
|
/*!*************************************************!*\
|
|
39050
39072
|
!*** ./node_modules/jose/dist/browser/index.js ***!
|
|
39051
39073
|
\*************************************************/
|
|
39052
|
-
/*! exports provided: compactDecrypt, flattenedDecrypt, generalDecrypt, GeneralEncrypt, compactVerify, flattenedVerify, generalVerify, jwtVerify, jwtDecrypt, CompactEncrypt, FlattenedEncrypt, CompactSign, FlattenedSign, GeneralSign, SignJWT, EncryptJWT, calculateJwkThumbprint, EmbeddedJWK, createLocalJWKSet, createRemoteJWKSet, UnsecuredJWT, exportPKCS8, exportSPKI, exportJWK, importSPKI, importPKCS8, importX509, importJWK, decodeProtectedHeader, errors, generateKeyPair, generateSecret, base64url */
|
|
39074
|
+
/*! exports provided: compactDecrypt, flattenedDecrypt, generalDecrypt, GeneralEncrypt, compactVerify, flattenedVerify, generalVerify, jwtVerify, jwtDecrypt, CompactEncrypt, FlattenedEncrypt, CompactSign, FlattenedSign, GeneralSign, SignJWT, EncryptJWT, calculateJwkThumbprint, EmbeddedJWK, createLocalJWKSet, createRemoteJWKSet, UnsecuredJWT, exportPKCS8, exportSPKI, exportJWK, importSPKI, importPKCS8, importX509, importJWK, decodeProtectedHeader, decodeJwt, errors, generateKeyPair, generateSecret, base64url */
|
|
39053
39075
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
39054
39076
|
|
|
39055
39077
|
"use strict";
|
|
@@ -39136,16 +39158,20 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
39136
39158
|
/* harmony import */ var _util_decode_protected_header_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./util/decode_protected_header.js */ "./node_modules/jose/dist/browser/util/decode_protected_header.js");
|
|
39137
39159
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "decodeProtectedHeader", function() { return _util_decode_protected_header_js__WEBPACK_IMPORTED_MODULE_23__["decodeProtectedHeader"]; });
|
|
39138
39160
|
|
|
39139
|
-
/* harmony import */ var
|
|
39140
|
-
/* harmony reexport (
|
|
39141
|
-
/* harmony import */ var _key_generate_key_pair_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./key/generate_key_pair.js */ "./node_modules/jose/dist/browser/key/generate_key_pair.js");
|
|
39142
|
-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "generateKeyPair", function() { return _key_generate_key_pair_js__WEBPACK_IMPORTED_MODULE_25__["generateKeyPair"]; });
|
|
39161
|
+
/* harmony import */ var _util_decode_jwt_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./util/decode_jwt.js */ "./node_modules/jose/dist/browser/util/decode_jwt.js");
|
|
39162
|
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "decodeJwt", function() { return _util_decode_jwt_js__WEBPACK_IMPORTED_MODULE_24__["decodeJwt"]; });
|
|
39143
39163
|
|
|
39144
|
-
/* harmony import */ var
|
|
39145
|
-
/* harmony reexport (
|
|
39164
|
+
/* harmony import */ var _util_errors_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./util/errors.js */ "./node_modules/jose/dist/browser/util/errors.js");
|
|
39165
|
+
/* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "errors", function() { return _util_errors_js__WEBPACK_IMPORTED_MODULE_25__; });
|
|
39166
|
+
/* harmony import */ var _key_generate_key_pair_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./key/generate_key_pair.js */ "./node_modules/jose/dist/browser/key/generate_key_pair.js");
|
|
39167
|
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "generateKeyPair", function() { return _key_generate_key_pair_js__WEBPACK_IMPORTED_MODULE_26__["generateKeyPair"]; });
|
|
39168
|
+
|
|
39169
|
+
/* harmony import */ var _key_generate_secret_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./key/generate_secret.js */ "./node_modules/jose/dist/browser/key/generate_secret.js");
|
|
39170
|
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "generateSecret", function() { return _key_generate_secret_js__WEBPACK_IMPORTED_MODULE_27__["generateSecret"]; });
|
|
39171
|
+
|
|
39172
|
+
/* harmony import */ var _util_base64url_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./util/base64url.js */ "./node_modules/jose/dist/browser/util/base64url.js");
|
|
39173
|
+
/* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "base64url", function() { return _util_base64url_js__WEBPACK_IMPORTED_MODULE_28__; });
|
|
39146
39174
|
|
|
39147
|
-
/* harmony import */ var _util_base64url_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./util/base64url.js */ "./node_modules/jose/dist/browser/util/base64url.js");
|
|
39148
|
-
/* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "base64url", function() { return _util_base64url_js__WEBPACK_IMPORTED_MODULE_27__; });
|
|
39149
39175
|
|
|
39150
39176
|
|
|
39151
39177
|
|
|
@@ -40016,17 +40042,14 @@ class LocalJWKSet {
|
|
|
40016
40042
|
this._jwks = clone(jwks);
|
|
40017
40043
|
}
|
|
40018
40044
|
async getKey(protectedHeader, token) {
|
|
40019
|
-
const
|
|
40020
|
-
...protectedHeader,
|
|
40021
|
-
...token.header,
|
|
40022
|
-
};
|
|
40045
|
+
const { alg, kid } = { ...protectedHeader, ...token.header };
|
|
40023
40046
|
const candidates = this._jwks.keys.filter((jwk) => {
|
|
40024
|
-
let candidate = jwk.kty === getKtyFromAlg(
|
|
40025
|
-
if (candidate && typeof
|
|
40026
|
-
candidate =
|
|
40047
|
+
let candidate = jwk.kty === getKtyFromAlg(alg);
|
|
40048
|
+
if (candidate && typeof kid === 'string') {
|
|
40049
|
+
candidate = kid === jwk.kid;
|
|
40027
40050
|
}
|
|
40028
40051
|
if (candidate && typeof jwk.alg === 'string') {
|
|
40029
|
-
candidate =
|
|
40052
|
+
candidate = alg === jwk.alg;
|
|
40030
40053
|
}
|
|
40031
40054
|
if (candidate && typeof jwk.use === 'string') {
|
|
40032
40055
|
candidate = jwk.use === 'sig';
|
|
@@ -40034,11 +40057,11 @@ class LocalJWKSet {
|
|
|
40034
40057
|
if (candidate && Array.isArray(jwk.key_ops)) {
|
|
40035
40058
|
candidate = jwk.key_ops.includes('verify');
|
|
40036
40059
|
}
|
|
40037
|
-
if (candidate &&
|
|
40060
|
+
if (candidate && alg === 'EdDSA') {
|
|
40038
40061
|
candidate = jwk.crv === 'Ed25519' || jwk.crv === 'Ed448';
|
|
40039
40062
|
}
|
|
40040
40063
|
if (candidate) {
|
|
40041
|
-
switch (
|
|
40064
|
+
switch (alg) {
|
|
40042
40065
|
case 'ES256':
|
|
40043
40066
|
candidate = jwk.crv === 'P-256';
|
|
40044
40067
|
break;
|
|
@@ -40051,7 +40074,6 @@ class LocalJWKSet {
|
|
|
40051
40074
|
case 'ES512':
|
|
40052
40075
|
candidate = jwk.crv === 'P-521';
|
|
40053
40076
|
break;
|
|
40054
|
-
default:
|
|
40055
40077
|
}
|
|
40056
40078
|
}
|
|
40057
40079
|
return candidate;
|
|
@@ -40064,14 +40086,14 @@ class LocalJWKSet {
|
|
|
40064
40086
|
throw new _util_errors_js__WEBPACK_IMPORTED_MODULE_1__["JWKSMultipleMatchingKeys"]();
|
|
40065
40087
|
}
|
|
40066
40088
|
const cached = this._cached.get(jwk) || this._cached.set(jwk, {}).get(jwk);
|
|
40067
|
-
if (cached[
|
|
40068
|
-
const keyObject = await Object(_key_import_js__WEBPACK_IMPORTED_MODULE_0__["importJWK"])({ ...jwk, ext: true },
|
|
40089
|
+
if (cached[alg] === undefined) {
|
|
40090
|
+
const keyObject = await Object(_key_import_js__WEBPACK_IMPORTED_MODULE_0__["importJWK"])({ ...jwk, ext: true }, alg);
|
|
40069
40091
|
if (keyObject instanceof Uint8Array || keyObject.type !== 'public') {
|
|
40070
40092
|
throw new _util_errors_js__WEBPACK_IMPORTED_MODULE_1__["JWKSInvalid"]('JSON Web Key Set members must be public keys');
|
|
40071
40093
|
}
|
|
40072
|
-
cached[
|
|
40094
|
+
cached[alg] = keyObject;
|
|
40073
40095
|
}
|
|
40074
|
-
return cached[
|
|
40096
|
+
return cached[alg];
|
|
40075
40097
|
}
|
|
40076
40098
|
}
|
|
40077
40099
|
function createLocalJWKSet(jwks) {
|
|
@@ -40092,12 +40114,14 @@ function createLocalJWKSet(jwks) {
|
|
|
40092
40114
|
__webpack_require__.r(__webpack_exports__);
|
|
40093
40115
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createRemoteJWKSet", function() { return createRemoteJWKSet; });
|
|
40094
40116
|
/* 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");
|
|
40095
|
-
/* harmony import */ var
|
|
40096
|
-
/* harmony import */ var
|
|
40117
|
+
/* harmony import */ var _runtime_env_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../runtime/env.js */ "./node_modules/jose/dist/browser/runtime/env.js");
|
|
40118
|
+
/* harmony import */ var _util_errors_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/errors.js */ "./node_modules/jose/dist/browser/util/errors.js");
|
|
40119
|
+
/* harmony import */ var _local_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./local.js */ "./node_modules/jose/dist/browser/jwks/local.js");
|
|
40097
40120
|
|
|
40098
40121
|
|
|
40099
40122
|
|
|
40100
|
-
|
|
40123
|
+
|
|
40124
|
+
class RemoteJWKSet extends _local_js__WEBPACK_IMPORTED_MODULE_3__["LocalJWKSet"] {
|
|
40101
40125
|
constructor(url, options) {
|
|
40102
40126
|
super({ keys: [] });
|
|
40103
40127
|
this._jwks = undefined;
|
|
@@ -40125,7 +40149,7 @@ class RemoteJWKSet extends _local_js__WEBPACK_IMPORTED_MODULE_2__["LocalJWKSet"]
|
|
|
40125
40149
|
return await super.getKey(protectedHeader, token);
|
|
40126
40150
|
}
|
|
40127
40151
|
catch (err) {
|
|
40128
|
-
if (err instanceof
|
|
40152
|
+
if (err instanceof _util_errors_js__WEBPACK_IMPORTED_MODULE_2__["JWKSNoMatchingKey"]) {
|
|
40129
40153
|
if (this.coolingDown() === false) {
|
|
40130
40154
|
await this.reload();
|
|
40131
40155
|
return super.getKey(protectedHeader, token);
|
|
@@ -40135,11 +40159,24 @@ class RemoteJWKSet extends _local_js__WEBPACK_IMPORTED_MODULE_2__["LocalJWKSet"]
|
|
|
40135
40159
|
}
|
|
40136
40160
|
}
|
|
40137
40161
|
async reload() {
|
|
40162
|
+
if (this._pendingFetch && Object(_runtime_env_js__WEBPACK_IMPORTED_MODULE_1__["isCloudflareWorkers"])()) {
|
|
40163
|
+
return new Promise((resolve) => {
|
|
40164
|
+
const isDone = () => {
|
|
40165
|
+
if (this._pendingFetch === undefined) {
|
|
40166
|
+
resolve();
|
|
40167
|
+
}
|
|
40168
|
+
else {
|
|
40169
|
+
setTimeout(isDone, 5);
|
|
40170
|
+
}
|
|
40171
|
+
};
|
|
40172
|
+
isDone();
|
|
40173
|
+
});
|
|
40174
|
+
}
|
|
40138
40175
|
if (!this._pendingFetch) {
|
|
40139
40176
|
this._pendingFetch = Object(_runtime_fetch_jwks_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this._url, this._timeoutDuration, this._options)
|
|
40140
40177
|
.then((json) => {
|
|
40141
|
-
if (!Object(
|
|
40142
|
-
throw new
|
|
40178
|
+
if (!Object(_local_js__WEBPACK_IMPORTED_MODULE_3__["isJWKSLike"])(json)) {
|
|
40179
|
+
throw new _util_errors_js__WEBPACK_IMPORTED_MODULE_2__["JWKSInvalid"]('JSON Web Key Set malformed');
|
|
40143
40180
|
}
|
|
40144
40181
|
this._jwks = { keys: json.keys };
|
|
40145
40182
|
this._cooldownStarted = Date.now();
|
|
@@ -43617,6 +43654,56 @@ const encode = _runtime_base64url_js__WEBPACK_IMPORTED_MODULE_0__["encode"];
|
|
|
43617
43654
|
const decode = _runtime_base64url_js__WEBPACK_IMPORTED_MODULE_0__["decode"];
|
|
43618
43655
|
|
|
43619
43656
|
|
|
43657
|
+
/***/ }),
|
|
43658
|
+
|
|
43659
|
+
/***/ "./node_modules/jose/dist/browser/util/decode_jwt.js":
|
|
43660
|
+
/*!***********************************************************!*\
|
|
43661
|
+
!*** ./node_modules/jose/dist/browser/util/decode_jwt.js ***!
|
|
43662
|
+
\***********************************************************/
|
|
43663
|
+
/*! exports provided: decodeJwt */
|
|
43664
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
43665
|
+
|
|
43666
|
+
"use strict";
|
|
43667
|
+
__webpack_require__.r(__webpack_exports__);
|
|
43668
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "decodeJwt", function() { return decodeJwt; });
|
|
43669
|
+
/* harmony import */ var _base64url_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./base64url.js */ "./node_modules/jose/dist/browser/util/base64url.js");
|
|
43670
|
+
/* harmony import */ var _lib_buffer_utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../lib/buffer_utils.js */ "./node_modules/jose/dist/browser/lib/buffer_utils.js");
|
|
43671
|
+
/* harmony import */ var _lib_is_object_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../lib/is_object.js */ "./node_modules/jose/dist/browser/lib/is_object.js");
|
|
43672
|
+
/* harmony import */ var _errors_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./errors.js */ "./node_modules/jose/dist/browser/util/errors.js");
|
|
43673
|
+
|
|
43674
|
+
|
|
43675
|
+
|
|
43676
|
+
|
|
43677
|
+
function decodeJwt(jwt) {
|
|
43678
|
+
if (typeof jwt !== 'string')
|
|
43679
|
+
throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__["JWTInvalid"]('JWTs must use Compact JWS serialization, JWT must be a string');
|
|
43680
|
+
const { 1: payload, length } = jwt.split('.');
|
|
43681
|
+
if (length === 5)
|
|
43682
|
+
throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__["JWTInvalid"]('Only JWTs using Compact JWS serialization can be decoded');
|
|
43683
|
+
if (length !== 3)
|
|
43684
|
+
throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__["JWTInvalid"]('Invalid JWT');
|
|
43685
|
+
if (!payload)
|
|
43686
|
+
throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__["JWTInvalid"]('JWTs must contain a payload');
|
|
43687
|
+
let decoded;
|
|
43688
|
+
try {
|
|
43689
|
+
decoded = Object(_base64url_js__WEBPACK_IMPORTED_MODULE_0__["decode"])(payload);
|
|
43690
|
+
}
|
|
43691
|
+
catch (_a) {
|
|
43692
|
+
throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__["JWTInvalid"]('Failed to parse the base64url encoded payload');
|
|
43693
|
+
}
|
|
43694
|
+
let result;
|
|
43695
|
+
try {
|
|
43696
|
+
result = JSON.parse(_lib_buffer_utils_js__WEBPACK_IMPORTED_MODULE_1__["decoder"].decode(decoded));
|
|
43697
|
+
}
|
|
43698
|
+
catch (_b) {
|
|
43699
|
+
throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__["JWTInvalid"]('Failed to parse the decoded payload as JSON');
|
|
43700
|
+
}
|
|
43701
|
+
if (!Object(_lib_is_object_js__WEBPACK_IMPORTED_MODULE_2__["default"])(result))
|
|
43702
|
+
throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__["JWTInvalid"]('Invalid JWT Claims Set');
|
|
43703
|
+
return result;
|
|
43704
|
+
}
|
|
43705
|
+
|
|
43706
|
+
|
|
43620
43707
|
/***/ }),
|
|
43621
43708
|
|
|
43622
43709
|
/***/ "./node_modules/jose/dist/browser/util/decode_protected_header.js":
|