0.2.0 - Mid migration

This commit is contained in:
Daniel Mason 2022-04-25 14:47:15 +12:00
parent 139e6a915e
commit 7e38fdbd7d
42393 changed files with 5358157 additions and 62 deletions

25
web/node_modules/jwt-decode/CHANGELOG.md generated vendored Normal file
View file

@ -0,0 +1,25 @@
# Change log
## Version [3.1.2](https://github.com/auth0/jwt-decode/releases/tag/v3.1.2)
[Full Changelog](https://github.com/auth0/jwt-decode/compare/v3.1.1..v3.1.2)
- Add a generic as return type so the user can specify what's expected, this will still be `unknown` by default
- Export `JwtHeader`and `JwtPayload` that can be used with the generic return type as-is or extended.
## Version [3.1.0](https://github.com/auth0/jwt-decode/releases/tag/v3.1.0)
[Full Changelog](https://github.com/auth0/jwt-decode/compare/v3.0.0..v3.1.0)
- Add TypeScript type definition
- Fix CJS default export
## Version [3.0.0](https://github.com/auth0/jwt-decode/releases/tag/v3.0.0)
[Full Changelog](https://github.com/auth0/jwt-decode/compare/v2.0.0..v3.0.0)
- Include an ESM build for native JavaScript imports
**Warning: this version has some potentially breaking changes!**
- If you've previously imported the library as `import * as jwt_decode from 'jwt-decode'`, you'll have to change your import to `import jwt_decode from 'jwt-decode';`.

21
web/node_modules/jwt-decode/LICENSE generated vendored Normal file
View file

@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2015 Auth0, Inc. <support@auth0.com> (http://auth0.com)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

89
web/node_modules/jwt-decode/README.md generated vendored Normal file
View file

@ -0,0 +1,89 @@
## **jwt-decode** is a small browser library that helps decoding JWTs token which are Base64Url encoded.
**IMPORTANT:** This library doesn't validate the token, any well formed JWT can be decoded. You should validate the token in your server-side logic by using something like [express-jwt](https://github.com/auth0/express-jwt), [koa-jwt](https://github.com/stiang/koa-jwt), [Owin Bearer JWT](https://github.com/michaelnoonan/Auth0-Owin-JwtBearerAuthentication), etc.
---
**Warning: When upgrading from version `2` to `3`, there's a potentially breaking change**
If you've previously imported the library as `import * as jwt_decode from 'jwt-decode'`, you'll have to change your import to `import jwt_decode from 'jwt-decode';`.
---
## Installation
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fauth0%2Fjwt-decode.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Fauth0%2Fjwt-decode?ref=badge_shield)
Install with NPM or Yarn.
Run `npm install jwt-decode` or `yarn add jwt-decode` to install the library.
## Usage
```javascript
import jwt_decode from "jwt-decode";
var token = "eyJ0eXAiO.../// jwt token";
var decoded = jwt_decode(token);
console.log(decoded);
/* prints:
* { foo: "bar",
* exp: 1393286893,
* iat: 1393268893 }
*/
// decode header by passing in options (useful for when you need `kid` to verify a JWT):
var decodedHeader = jwt_decode(token, { header: true });
console.log(decodedHeader);
/* prints:
* { typ: "JWT",
* alg: "HS256" }
*/
```
**Note:** A falsy or malformed token will throw an `InvalidTokenError` error.
## Use as a CommonJS package
```javascript
const jwt_decode = require('jwt-decode');
...
```
## Include with a script tag
Copy the file `jwt-decode.js` from the `build/` folder to your project somewhere, then include like so:
```html
<script src="jwt-decode.js"></script>
```
## Older versions
If you want to use the library trough Bower, an HTML import, use [version `v2.2.0`](https://github.com/auth0/jwt-decode/tree/v2.2.0). It has the same functionality.
## Develop
Run `npm run dev`, this will fire up a browser and watch the `/lib` folder.
## Issue Reporting
If you have found a bug or if you have a feature request, please report them at this repository issues section. Please do not report security vulnerabilities on the public GitHub issue tracker. The [Responsible Disclosure Program](https://auth0.com/whitehat) details the procedure for disclosing security issues.
## Author
[Auth0](https://auth0.com)
## License
This project is licensed under the MIT license. See the [LICENSE](LICENSE) file for more info.
[browserify]: http://browserify.org
[webpack]: http://webpack.github.io/
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fauth0%2Fjwt-decode.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Fauth0%2Fjwt-decode?ref=badge_large)
=======

2
web/node_modules/jwt-decode/build/jwt-decode.cjs.js generated vendored Normal file
View file

@ -0,0 +1,2 @@
"use strict";function e(e){this.message=e}e.prototype=new Error,e.prototype.name="InvalidCharacterError";var r="undefined"!=typeof window&&window.atob&&window.atob.bind(window)||function(r){var t=String(r).replace(/=+$/,"");if(t.length%4==1)throw new e("'atob' failed: The string to be decoded is not correctly encoded.");for(var n,o,a=0,i=0,c="";o=t.charAt(i++);~o&&(n=a%4?64*n+o:o,a++%4)?c+=String.fromCharCode(255&n>>(-2*a&6)):0)o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(o);return c};function t(e){var t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw"Illegal base64url string!"}try{return function(e){return decodeURIComponent(r(e).replace(/(.)/g,(function(e,r){var t=r.charCodeAt(0).toString(16).toUpperCase();return t.length<2&&(t="0"+t),"%"+t})))}(t)}catch(e){return r(t)}}function n(e){this.message=e}function o(e,r){if("string"!=typeof e)throw new n("Invalid token specified");var o=!0===(r=r||{}).header?0:1;try{return JSON.parse(t(e.split(".")[o]))}catch(e){throw new n("Invalid token specified: "+e.message)}}n.prototype=new Error,n.prototype.name="InvalidTokenError";const a=o;a.default=o,a.InvalidTokenError=n,module.exports=a;
//# sourceMappingURL=jwt-decode.cjs.js.map

File diff suppressed because one or more lines are too long

2
web/node_modules/jwt-decode/build/jwt-decode.esm.js generated vendored Normal file
View file

@ -0,0 +1,2 @@
function e(e){this.message=e}e.prototype=new Error,e.prototype.name="InvalidCharacterError";var r="undefined"!=typeof window&&window.atob&&window.atob.bind(window)||function(r){var t=String(r).replace(/=+$/,"");if(t.length%4==1)throw new e("'atob' failed: The string to be decoded is not correctly encoded.");for(var n,o,a=0,i=0,c="";o=t.charAt(i++);~o&&(n=a%4?64*n+o:o,a++%4)?c+=String.fromCharCode(255&n>>(-2*a&6)):0)o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(o);return c};function t(e){var t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw"Illegal base64url string!"}try{return function(e){return decodeURIComponent(r(e).replace(/(.)/g,(function(e,r){var t=r.charCodeAt(0).toString(16).toUpperCase();return t.length<2&&(t="0"+t),"%"+t})))}(t)}catch(e){return r(t)}}function n(e){this.message=e}function o(e,r){if("string"!=typeof e)throw new n("Invalid token specified");var o=!0===(r=r||{}).header?0:1;try{return JSON.parse(t(e.split(".")[o]))}catch(e){throw new n("Invalid token specified: "+e.message)}}n.prototype=new Error,n.prototype.name="InvalidTokenError";export default o;export{n as InvalidTokenError};
//# sourceMappingURL=jwt-decode.esm.js.map

View file

@ -0,0 +1 @@
{"version":3,"file":"jwt-decode.esm.js","sources":["../lib/atob.js","../lib/base64_url_decode.js","../lib/index.js"],"sourcesContent":["/**\n * The code was extracted from:\n * https://github.com/davidchambers/Base64.js\n */\n\nvar chars = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\";\n\nfunction InvalidCharacterError(message) {\n this.message = message;\n}\n\nInvalidCharacterError.prototype = new Error();\nInvalidCharacterError.prototype.name = \"InvalidCharacterError\";\n\nfunction polyfill(input) {\n var str = String(input).replace(/=+$/, \"\");\n if (str.length % 4 == 1) {\n throw new InvalidCharacterError(\n \"'atob' failed: The string to be decoded is not correctly encoded.\"\n );\n }\n for (\n // initialize result and counters\n var bc = 0, bs, buffer, idx = 0, output = \"\";\n // get next character\n (buffer = str.charAt(idx++));\n // character found in table? initialize bit storage and add its ascii value;\n ~buffer &&\n ((bs = bc % 4 ? bs * 64 + buffer : buffer),\n // and if not first of each 4 characters,\n // convert the first 8 bits to one ascii character\n bc++ % 4) ?\n (output += String.fromCharCode(255 & (bs >> ((-2 * bc) & 6)))) :\n 0\n ) {\n // try to find character in table (0-63, not found => -1)\n buffer = chars.indexOf(buffer);\n }\n return output;\n}\n\nexport default (typeof window !== \"undefined\" &&\n window.atob &&\n window.atob.bind(window)) ||\npolyfill;","import atob from \"./atob\";\n\nfunction b64DecodeUnicode(str) {\n return decodeURIComponent(\n atob(str).replace(/(.)/g, function(m, p) {\n var code = p.charCodeAt(0).toString(16).toUpperCase();\n if (code.length < 2) {\n code = \"0\" + code;\n }\n return \"%\" + code;\n })\n );\n}\n\nexport default function(str) {\n var output = str.replace(/-/g, \"+\").replace(/_/g, \"/\");\n switch (output.length % 4) {\n case 0:\n break;\n case 2:\n output += \"==\";\n break;\n case 3:\n output += \"=\";\n break;\n default:\n throw \"Illegal base64url string!\";\n }\n\n try {\n return b64DecodeUnicode(output);\n } catch (err) {\n return atob(output);\n }\n}","\"use strict\";\n\nimport base64_url_decode from \"./base64_url_decode\";\n\nexport function InvalidTokenError(message) {\n this.message = message;\n}\n\nInvalidTokenError.prototype = new Error();\nInvalidTokenError.prototype.name = \"InvalidTokenError\";\n\nexport default function(token, options) {\n if (typeof token !== \"string\") {\n throw new InvalidTokenError(\"Invalid token specified\");\n }\n\n options = options || {};\n var pos = options.header === true ? 0 : 1;\n try {\n return JSON.parse(base64_url_decode(token.split(\".\")[pos]));\n } catch (e) {\n throw new InvalidTokenError(\"Invalid token specified: \" + e.message);\n }\n}"],"names":["InvalidCharacterError","message","this","prototype","Error","name","window","atob","bind","input","str","String","replace","length","bs","buffer","bc","idx","output","charAt","fromCharCode","indexOf","decodeURIComponent","m","p","code","charCodeAt","toString","toUpperCase","b64DecodeUnicode","err","InvalidTokenError","token","options","pos","header","JSON","parse","base64_url_decode","split","e"],"mappings":"AAOA,SAASA,EAAsBC,GAC3BC,KAAKD,QAAUA,EAGnBD,EAAsBG,UAAY,IAAIC,MACtCJ,EAAsBG,UAAUE,KAAO,wBA6BvC,MAAkC,oBAAXC,QACnBA,OAAOC,MACPD,OAAOC,KAAKC,KAAKF,SA7BrB,SAAkBG,GACd,IAAIC,EAAMC,OAAOF,GAAOG,QAAQ,MAAO,IACvC,GAAIF,EAAIG,OAAS,GAAK,EAClB,MAAM,IAAIb,EACN,qEAGR,IAEI,IAAYc,EAAIC,EAAZC,EAAK,EAAeC,EAAM,EAAGC,EAAS,GAEzCH,EAASL,EAAIS,OAAOF,MAEpBF,IACCD,EAAKE,EAAK,EAAS,GAALF,EAAUC,EAASA,EAG/BC,IAAO,GACVE,GAAUP,OAAOS,aAAa,IAAON,KAAS,EAAIE,EAAM,IACzD,EAGAD,EA/BI,oEA+BWM,QAAQN,GAE3B,OAAOG,GCxBI,WAASR,GACpB,IAAIQ,EAASR,EAAIE,QAAQ,KAAM,KAAKA,QAAQ,KAAM,KAClD,OAAQM,EAAOL,OAAS,GACpB,KAAK,EACD,MACJ,KAAK,EACDK,GAAU,KACV,MACJ,KAAK,EACDA,GAAU,IACV,MACJ,QACI,KAAM,4BAGd,IACI,OA5BR,SAA0BR,GACtB,OAAOY,mBACHf,EAAKG,GAAKE,QAAQ,QAAQ,SAASW,EAAGC,GAClC,IAAIC,EAAOD,EAAEE,WAAW,GAAGC,SAAS,IAAIC,cAIxC,OAHIH,EAAKZ,OAAS,IACdY,EAAO,IAAMA,GAEV,IAAMA,MAqBVI,CAAiBX,GAC1B,MAAOY,GACL,OAAOvB,EAAKW,IC5Bb,SAASa,EAAkB9B,GAC9BC,KAAKD,QAAUA,EAMJ,WAAS+B,EAAOC,GAC3B,GAAqB,iBAAVD,EACP,MAAM,IAAID,EAAkB,2BAIhC,IAAIG,GAAyB,KAD7BD,EAAUA,GAAW,IACHE,OAAkB,EAAI,EACxC,IACI,OAAOC,KAAKC,MAAMC,EAAkBN,EAAMO,MAAM,KAAKL,KACvD,MAAOM,GACL,MAAM,IAAIT,EAAkB,4BAA8BS,EAAEvC,UAbpE8B,EAAkB5B,UAAY,IAAIC,MAClC2B,EAAkB5B,UAAUE,KAAO"}

123
web/node_modules/jwt-decode/build/jwt-decode.js generated vendored Normal file
View file

@ -0,0 +1,123 @@
(function (factory) {
typeof define === 'function' && define.amd ? define(factory) :
factory();
}((function () { 'use strict';
/**
* The code was extracted from:
* https://github.com/davidchambers/Base64.js
*/
var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
function InvalidCharacterError(message) {
this.message = message;
}
InvalidCharacterError.prototype = new Error();
InvalidCharacterError.prototype.name = "InvalidCharacterError";
function polyfill(input) {
var str = String(input).replace(/=+$/, "");
if (str.length % 4 == 1) {
throw new InvalidCharacterError(
"'atob' failed: The string to be decoded is not correctly encoded."
);
}
for (
// initialize result and counters
var bc = 0, bs, buffer, idx = 0, output = "";
// get next character
(buffer = str.charAt(idx++));
// character found in table? initialize bit storage and add its ascii value;
~buffer &&
((bs = bc % 4 ? bs * 64 + buffer : buffer),
// and if not first of each 4 characters,
// convert the first 8 bits to one ascii character
bc++ % 4) ?
(output += String.fromCharCode(255 & (bs >> ((-2 * bc) & 6)))) :
0
) {
// try to find character in table (0-63, not found => -1)
buffer = chars.indexOf(buffer);
}
return output;
}
var atob = (typeof window !== "undefined" &&
window.atob &&
window.atob.bind(window)) ||
polyfill;
function b64DecodeUnicode(str) {
return decodeURIComponent(
atob(str).replace(/(.)/g, function(m, p) {
var code = p.charCodeAt(0).toString(16).toUpperCase();
if (code.length < 2) {
code = "0" + code;
}
return "%" + code;
})
);
}
function base64_url_decode(str) {
var output = str.replace(/-/g, "+").replace(/_/g, "/");
switch (output.length % 4) {
case 0:
break;
case 2:
output += "==";
break;
case 3:
output += "=";
break;
default:
throw "Illegal base64url string!";
}
try {
return b64DecodeUnicode(output);
} catch (err) {
return atob(output);
}
}
function InvalidTokenError(message) {
this.message = message;
}
InvalidTokenError.prototype = new Error();
InvalidTokenError.prototype.name = "InvalidTokenError";
function jwtDecode(token, options) {
if (typeof token !== "string") {
throw new InvalidTokenError("Invalid token specified");
}
options = options || {};
var pos = options.header === true ? 0 : 1;
try {
return JSON.parse(base64_url_decode(token.split(".")[pos]));
} catch (e) {
throw new InvalidTokenError("Invalid token specified: " + e.message);
}
}
/*
* Expose the function on the window object
*/
//use amd or just through the window object.
if (window) {
if (typeof window.define == "function" && window.define.amd) {
window.define("jwt_decode", function() {
return jwtDecode;
});
} else if (window) {
window.jwt_decode = jwtDecode;
}
}
})));
//# sourceMappingURL=jwt-decode.js.map

1
web/node_modules/jwt-decode/build/jwt-decode.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

25
web/node_modules/jwt-decode/index.d.ts generated vendored Normal file
View file

@ -0,0 +1,25 @@
export class InvalidTokenError extends Error {}
export interface JwtDecodeOptions {
header?: boolean;
}
export interface JwtHeader {
type?: string;
alg?: string;
}
export interface JwtPayload {
iss?: string;
sub?: string;
aud?: string[] | string;
exp?: number;
nbf?: number;
iat?: number;
jti?: string;
}
export default function jwtDecode<T = unknown>(
token: string,
options?: JwtDecodeOptions
): T;

46
web/node_modules/jwt-decode/package.json generated vendored Normal file
View file

@ -0,0 +1,46 @@
{
"name": "jwt-decode",
"version": "3.1.2",
"description": "Decode JWT tokens, mostly useful for browser applications.",
"main": "build/jwt-decode.cjs.js",
"module": "build/jwt-decode.esm.js",
"types": "index.d.ts",
"keywords": [
"jwt",
"browser"
],
"repository": {
"type": "git",
"url": "git://github.com/auth0/jwt-decode"
},
"url": "https://github.com/auth0/jwt-decode/issues",
"homepage": "https://github.com/auth0/jwt-decode#readme",
"scripts": {
"dev": "rollup -m -c",
"build": "rimraf build && rollup -m -c --environment NODE_ENV:production",
"test": "mocha"
},
"author": "Jose F. Romaniello <jfromaniello@gmail.com> (http://joseoncode.com)",
"contributors": [
"Sam Bellen <sam.bellen@auth0.com>"
],
"license": "MIT",
"dependencies": {},
"devDependencies": {
"@rollup/plugin-commonjs": "^15.0.0",
"@rollup/plugin-node-resolve": "^9.0.0",
"expect.js": "~0.2.0",
"mocha": "^8.1.3",
"rimraf": "^2.2.8",
"rollup": "^2.26.11",
"rollup-plugin-livereload": "^2.0.0",
"rollup-plugin-serve": "^1.0.4",
"rollup-plugin-sourcemaps": "^0.6.2",
"rollup-plugin-terser": "^7.0.2",
"uglify-js": "^2.8.29"
},
"files": [
"build/",
"index.d.ts"
]
}