@redocly/reference-docs 1.5.15 → 1.6.0
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/bin/cli/commands/redocly-docs-cli.min.js +5 -5
- package/dist/console.redocly-reference-docs.min.js +1 -1
- package/dist/oauth2-redirect.js +1 -1
- package/dist/redocly-reference-docs.min.js +4 -4
- package/lib/services/check.d.ts +1 -0
- package/lib/services/check.js +1 -1
- package/lib-esm/services/check.d.ts +1 -0
- package/lib-esm/services/check.js +1 -1
- package/package.json +1 -1
package/lib/services/check.d.ts
CHANGED
package/lib/services/check.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var tslib_1=require("tslib"),cryptoLib="undefined"!=typeof window&&(window.crypto||window.msCrypto)||void 0;function promisifyIECryptoRes(e){return e.then?e:new Promise((function(t){e.oncomplete=function(e){t(e.target.result)}}))}function str2ab(e){for(var t=new ArrayBuffer(e.length),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var tslib_1=require("tslib"),cryptoLib="undefined"!=typeof window&&(window.crypto||window.msCrypto)||void 0;function promisifyIECryptoRes(e){return e.then?e:new Promise((function(t){e.oncomplete=function(e){t(e.target.result)}}))}function str2ab(e){for(var t=new ArrayBuffer(e.length),n=new Uint8Array(t),r=0,o=e.length;r<o;r++)n[r]=e.charCodeAt(r);return t}var getKey=function(){var e=str2ab(atob("undefined"!=typeof REDOCLY_PUBLIC_KEY?REDOCLY_PUBLIC_KEY:"MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAMHjNir5fXx/ZXoaEeXQ5XyxbNJ4YJYczoCRdSkL6NLzw1FHnng5Vfcgk5+bvox9QRYRbuk84mA4f2NhywDbXKECAwEAAQ=="));return promisifyIECryptoRes(cryptoLib.subtle.importKey("spki",e,{name:"RSASSA-PKCS1-v1_5",hash:"SHA-256"},!0,["verify"]))};function textEncode(e){if(window.TextEncoder)return(new TextEncoder).encode(e);for(var t=unescape(encodeURIComponent(e)),n=new Uint8Array(t.length),r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n}function verify(e,t){return tslib_1.__awaiter(this,void 0,void 0,(function(){var n,r,o,i;return tslib_1.__generator(this,(function(s){switch(s.label){case 0:return n=promisifyIECryptoRes,o=(r=cryptoLib.subtle).verify,i=[{name:"RSASSA-PKCS1-v1_5",hash:"SHA-256"}],[4,getKey()];case 1:return[2,n.apply(void 0,[o.apply(r,i.concat([s.sent(),str2ab(atob(t)),textEncode(e)]))])]}}))}))}function isHostAllowed(e,t){return!0===t||!(!Array.isArray(t)||"undefined"==typeof window)&&(!("localhost"!==e&&"127.0.0.1"!==e&&!e.endsWith(".localhost")&&!t.find((function(t){return t===e||e.endsWith("."+t)})))||!!t.find((function(t){if(t.indexOf("*")===t.lastIndexOf("*")){var n=t.split("*"),r=n[0],o=n[1];return o&&e.startsWith(r)&&e.endsWith(o)&&o.split(".").length>2}})))}function parse(e){return tslib_1.__awaiter(this,void 0,void 0,(function(){var t,n,r,o,i;return tslib_1.__generator(this,(function(s){switch(s.label){case 0:if("development"===process.env.NODE_ENV)return[2,{valid:!0,allowed:!0}];if(t=window.location.hostname,!e)return"localhost"===t||"127.0.0.1"===t||t.endsWith(".localhost")?[2,{local:!0}]:[2,{}];n=e.split("."),r=n[0],o=n[1],s.label=1;case 1:return s.trys.push([1,3,,4]),[4,verify(atob(r),o)];case 2:return s.sent()?(i=JSON.parse(atob(r)),[3,4]):[2,{valid:!1}];case 3:return s.sent(),[2,{valid:!1,cryptoMissing:!0}];case 4:return i.valid=!0,(!i.e||Date.now()/1e3>i.e)&&(i.expired=!0),i.allowed=isHostAllowed(t,i.h),[2,i]}}))}))}exports.isHostAllowed=isHostAllowed,exports.default=parse;
|
|
2
2
|
//# sourceMappingURL=check.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__awaiter,__generator}from"tslib";var cryptoLib="undefined"!=typeof window&&(window.crypto||window.msCrypto)||void 0;function promisifyIECryptoRes(e){return e.then?e:new Promise((function(t){e.oncomplete=function(e){t(e.target.result)}}))}function str2ab(e){for(var t=new ArrayBuffer(e.length),
|
|
1
|
+
import{__awaiter,__generator}from"tslib";var cryptoLib="undefined"!=typeof window&&(window.crypto||window.msCrypto)||void 0;function promisifyIECryptoRes(e){return e.then?e:new Promise((function(t){e.oncomplete=function(e){t(e.target.result)}}))}function str2ab(e){for(var t=new ArrayBuffer(e.length),n=new Uint8Array(t),r=0,o=e.length;r<o;r++)n[r]=e.charCodeAt(r);return t}var getKey=function(){var e=str2ab(atob("undefined"!=typeof REDOCLY_PUBLIC_KEY?REDOCLY_PUBLIC_KEY:"MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAMHjNir5fXx/ZXoaEeXQ5XyxbNJ4YJYczoCRdSkL6NLzw1FHnng5Vfcgk5+bvox9QRYRbuk84mA4f2NhywDbXKECAwEAAQ=="));return promisifyIECryptoRes(cryptoLib.subtle.importKey("spki",e,{name:"RSASSA-PKCS1-v1_5",hash:"SHA-256"},!0,["verify"]))};function textEncode(e){if(window.TextEncoder)return(new TextEncoder).encode(e);for(var t=unescape(encodeURIComponent(e)),n=new Uint8Array(t.length),r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n}function verify(e,t){return __awaiter(this,void 0,void 0,(function(){var n,r,o,i;return __generator(this,(function(a){switch(a.label){case 0:return n=promisifyIECryptoRes,o=(r=cryptoLib.subtle).verify,i=[{name:"RSASSA-PKCS1-v1_5",hash:"SHA-256"}],[4,getKey()];case 1:return[2,n.apply(void 0,[o.apply(r,i.concat([a.sent(),str2ab(atob(t)),textEncode(e)]))])]}}))}))}export function isHostAllowed(e,t){return!0===t||!(!Array.isArray(t)||"undefined"==typeof window)&&(!("localhost"!==e&&"127.0.0.1"!==e&&!e.endsWith(".localhost")&&!t.find((function(t){return t===e||e.endsWith("."+t)})))||!!t.find((function(t){if(t.indexOf("*")===t.lastIndexOf("*")){var n=t.split("*"),r=n[0],o=n[1];return o&&e.startsWith(r)&&e.endsWith(o)&&o.split(".").length>2}})))}export default function parse(e){return __awaiter(this,void 0,void 0,(function(){var t,n,r,o,i;return __generator(this,(function(a){switch(a.label){case 0:if("development"===process.env.NODE_ENV)return[2,{valid:!0,allowed:!0}];if(t=window.location.hostname,!e)return"localhost"===t||"127.0.0.1"===t||t.endsWith(".localhost")?[2,{local:!0}]:[2,{}];n=e.split("."),r=n[0],o=n[1],a.label=1;case 1:return a.trys.push([1,3,,4]),[4,verify(atob(r),o)];case 2:return a.sent()?(i=JSON.parse(atob(r)),[3,4]):[2,{valid:!1}];case 3:return a.sent(),[2,{valid:!1,cryptoMissing:!0}];case 4:return i.valid=!0,(!i.e||Date.now()/1e3>i.e)&&(i.expired=!0),i.allowed=isHostAllowed(t,i.h),[2,i]}}))}))}
|
|
2
2
|
//# sourceMappingURL=check.js.map
|