@liflig/cdk-cloudfront-auth 1.6.13 → 1.6.14
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/check-auth/index.js +1 -1
- package/dist/check-auth/index.js.LICENSE.txt +0 -7
- package/dist/http-headers/index.js +1 -2
- package/dist/parse-auth/index.js +1 -1
- package/dist/parse-auth/index.js.LICENSE.txt +0 -7
- package/dist/refresh-auth/index.js +1 -1
- package/dist/refresh-auth/index.js.LICENSE.txt +0 -7
- package/dist/sign-out/index.js +1 -1
- package/dist/sign-out/index.js.LICENSE.txt +0 -7
- package/package.json +9 -9
- package/dist/http-headers/index.js.LICENSE.txt +0 -6
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
(()=>{"use strict";var e={7427:(e,r)=>{r.q=function(e,r){if("string"!=typeof e)throw new TypeError("argument str must be a string");var a={},c=e.length;if(c<2)return a;var u=r&&r.decode||i,l=0,f=0,d=0;do{if(-1===(f=e.indexOf("=",l)))break;if(-1===(d=e.indexOf(";",l)))d=c;else if(f>d){l=e.lastIndexOf(";",f-1)+1;continue}var g=n(e,l,f),p=t(e,f,g),h=e.slice(g,p);if(!o.call(a,h)){var v=n(e,f+1,d),y=t(e,d,v);34===e.charCodeAt(v)&&34===e.charCodeAt(y-1)&&(v++,y--);var w=e.slice(v,y);a[h]=s(w,u)}l=d+1}while(l<c);return a};Object.prototype.toString;var o=Object.prototype.hasOwnProperty;function n(e,r,o){do{var n=e.charCodeAt(r);if(32!==n&&9!==n)return r}while(++r<o);return o}function t(e,r,o){for(;r>o;){var n=e.charCodeAt(--r);if(32!==n&&9!==n)return r+1}return o}function i(e){return-1!==e.indexOf("%")?decodeURIComponent(e):e}function s(e,r){try{return r(e)}catch(r){return e}}}},r={};function o(n){var t=r[n];if(void 0!==t)return t.exports;var i=r[n]={exports:{}};return e[n](i,i.exports,o),i.exports}o.d=(e,r)=>{for(var n in r)o.o(r,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};o.r(n),o.d(n,{handler:()=>f});var t=o(7427);const i=require("fs"),s=require("path");var a;!function(e){e[e.none=0]="none",e[e.error=10]="error",e[e.warn=20]="warn",e[e.info=30]="info",e[e.debug=40]="debug"}(a||(a={}));class c{logLevel;constructor(e){this.logLevel=e}jsonify(e){return e.map((e=>{if("object"==typeof e)try{return JSON.stringify(e)}catch{return e}return e}))}info(...e){this.logLevel>=a.info&&console.log(...this.jsonify(e))}warn(...e){this.logLevel>=a.warn&&console.warn(...this.jsonify(e))}error(...e){this.logLevel>=a.error&&console.error(...this.jsonify(e))}debug(...e){this.logLevel>=a.debug&&console.trace(...this.jsonify(e))}}const u=(0,require("url").fileURLToPath)("file:///home/runner/work/cdk-cloudfront-auth/cdk-cloudfront-auth/src/handlers/util/config.ts"),l=s.dirname(u);const f=function(){let e;return async r=>{e||(e=function(){const e=process.env.LAMBDA_TASK_ROOT||l,r=s.join(e,"config.json");console.log("Loading config from",r);const o=JSON.parse((0,i.readFileSync)(r,"utf-8")),n=`https://cognito-idp.${/^(\S+?)_\S+$/.exec(o.userPoolId)[1]}.amazonaws.com/${o.userPoolId}`,u=`${n}/.well-known/jwks.json`;return{nonceMaxAge:parseInt((0,t.q)(o.cookieSettings.nonce.toLowerCase())["max-age"])||86400,...o,tokenIssuer:n,tokenJwksUri:u,logger:new c(a[o.logLevel])}}()),e.logger.debug("Handling event:",r);const o=function(e,r){if(!r)throw new Error("Expected response value");return{...r,headers:{...r.headers??{},...(o=e.httpHeaders,Object.entries(o).reduce(((e,[r,o])=>Object.assign(e,{[r.toLowerCase()]:[{key:r,value:o}]})),{}))}};var o}(e,await(async(e,r)=>r.Records[0].cf.response)(0,r));return e.logger.debug("Returning response:",o),o}}();var d=exports;for(var g in n)d[g]=n[g];n.__esModule&&Object.defineProperty(d,"__esModule",{value:!0})})();
|
|
1
|
+
(()=>{"use strict";var e={8232:(e,o)=>{o.qg=function(e,o){const i=new r,c=e.length;if(c<2)return i;const u=o?.decode||s;let l=0;do{const o=e.indexOf("=",l);if(-1===o)break;const r=e.indexOf(";",l),s=-1===r?c:r;if(o>s){l=e.lastIndexOf(";",o-1)+1;continue}const a=n(e,l,o),f=t(e,o,a),d=e.slice(a,f);if(void 0===i[d]){let r=n(e,o+1,s),c=t(e,s,r);const l=u(e.slice(r,c));i[d]=l}l=s+1}while(l<c);return i};Object.prototype.toString;const r=(()=>{const e=function(){};return e.prototype=Object.create(null),e})();function n(e,o,r){do{const r=e.charCodeAt(o);if(32!==r&&9!==r)return o}while(++o<r);return r}function t(e,o,r){for(;o>r;){const r=e.charCodeAt(--o);if(32!==r&&9!==r)return o+1}return r}function s(e){if(-1===e.indexOf("%"))return e;try{return decodeURIComponent(e)}catch(o){return e}}}},o={};function r(n){var t=o[n];if(void 0!==t)return t.exports;var s=o[n]={exports:{}};return e[n](s,s.exports,r),s.exports}r.d=(e,o)=>{for(var n in o)r.o(o,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:o[n]})},r.o=(e,o)=>Object.prototype.hasOwnProperty.call(e,o),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};r.r(n),r.d(n,{handler:()=>f});var t=r(8232);const s=require("fs"),i=require("path");var c;!function(e){e[e.none=0]="none",e[e.error=10]="error",e[e.warn=20]="warn",e[e.info=30]="info",e[e.debug=40]="debug"}(c||(c={}));class u{logLevel;constructor(e){this.logLevel=e}jsonify(e){return e.map((e=>{if("object"==typeof e)try{return JSON.stringify(e)}catch{return e}return e}))}info(...e){this.logLevel>=c.info&&console.log(...this.jsonify(e))}warn(...e){this.logLevel>=c.warn&&console.warn(...this.jsonify(e))}error(...e){this.logLevel>=c.error&&console.error(...this.jsonify(e))}debug(...e){this.logLevel>=c.debug&&console.trace(...this.jsonify(e))}}const l=(0,require("url").fileURLToPath)("file:///home/runner/work/cdk-cloudfront-auth/cdk-cloudfront-auth/src/handlers/util/config.ts"),a=i.dirname(l);const f=function(){let e;return async o=>{e||(e=function(){const e=process.env.LAMBDA_TASK_ROOT||a,o=i.join(e,"config.json");console.log("Loading config from",o);const r=JSON.parse((0,s.readFileSync)(o,"utf-8")),n=`https://cognito-idp.${/^(\S+?)_\S+$/.exec(r.userPoolId)[1]}.amazonaws.com/${r.userPoolId}`,l=`${n}/.well-known/jwks.json`;return{nonceMaxAge:parseInt((0,t.qg)(r.cookieSettings.nonce.toLowerCase())["max-age"])||86400,...r,tokenIssuer:n,tokenJwksUri:l,logger:new u(c[r.logLevel])}}()),e.logger.debug("Handling event:",o);const r=function(e,o){if(!o)throw new Error("Expected response value");return{...o,headers:{...o.headers??{},...(r=e.httpHeaders,Object.entries(r).reduce(((e,[o,r])=>Object.assign(e,{[o.toLowerCase()]:[{key:o,value:r}]})),{}))}};var r}(e,await(async(e,o)=>o.Records[0].cf.response)(0,o));return e.logger.debug("Returning response:",r),r}}();var d=exports;for(var g in n)d[g]=n[g];n.__esModule&&Object.defineProperty(d,"__esModule",{value:!0})})();
|