From a1c7cf431683b244c8bbddcf38732ca45920176a Mon Sep 17 00:00:00 2001 From: Pat Cavit Date: Mon, 15 Jun 2020 00:58:37 -0700 Subject: [PATCH] release: 2.1.0 :tada: :rocket: --- dist/aws-sig.cjs.js | 5 +++-- dist/aws-sig.cjs.js.map | 2 +- dist/aws-sig.umd.js | 4 ++-- dist/aws-sig.umd.js.map | 2 +- package-lock.json | 2 +- package.json | 2 +- 6 files changed, 9 insertions(+), 8 deletions(-) diff --git a/dist/aws-sig.cjs.js b/dist/aws-sig.cjs.js index ebfb0d2..c9242e6 100644 --- a/dist/aws-sig.cjs.js +++ b/dist/aws-sig.cjs.js @@ -1,14 +1,15 @@ -/*! aws-sig@2.0.1 !*/ +/*! aws-sig@2.1.0 !*/ 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); -require('./sign.cjs.js'); +var sign = require('./sign.cjs.js'); var signedHeaders = require('./signed-headers.cjs.js'); var signedQuery = require('./signed-query.cjs.js'); +exports.headerXAmzDate = sign.xamzdate; exports.signedHeaders = signedHeaders.signedHeaders; exports.signedQuery = signedQuery.signedQuery; //# sourceMappingURL=aws-sig.cjs.js.map diff --git a/dist/aws-sig.cjs.js.map b/dist/aws-sig.cjs.js.map index 10fd585..20a9da4 100644 --- a/dist/aws-sig.cjs.js.map +++ b/dist/aws-sig.cjs.js.map @@ -1 +1 @@ -{"version":3,"file":"aws-sig.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"aws-sig.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;"} \ No newline at end of file diff --git a/dist/aws-sig.umd.js b/dist/aws-sig.umd.js index 0c01fe4..4bb5cfa 100644 --- a/dist/aws-sig.umd.js +++ b/dist/aws-sig.umd.js @@ -1,3 +1,3 @@ -/*! aws-sig@2.0.1 !*/ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=e||self)["aws-sig"]={})}(this,(function(e){"use strict";var t=function(e){return e.toString().trim().replace(/\s+/g," ")},r=function(e){return e.map((function(e){return e[0]})).join(";")},n=function(e){var t=e.headers;return void 0===t&&(t={}),Object.keys(t).map((function(e){return[e.toLowerCase(),t[e]]})).sort((function(e,t){var r=e[0],n=t[0];return r.localeCompare(n)}))},i=function(e){var t=e.accessKeyId,r=e.date,n=e.region,i=e.service;return t+"/"+r.short+"/"+n+"/"+i+"/aws4_request"},o=Object.create||function(){function e(){}return function(t){var r;return e.prototype=t,r=new e,e.prototype=null,r}}(),s={},a=s.lib={},u=a.Base={extend:function(e){var t=o(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},c=a.WordArray=u.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||h).stringify(this)},concat:function(e){var t=this.words,r=e.words,n=this.sigBytes,i=e.sigBytes;if(this.clamp(),n%4)for(var o=0;o>>2]>>>24-o%4*8&255;t[n+o>>>2]|=s<<24-(n+o)%4*8}else for(o=0;o>>2]=r[o>>>2];return this.sigBytes+=i,this},clamp:function(){var e=this.words,t=this.sigBytes;e[t>>>2]&=4294967295<<32-t%4*8,e.length=Math.ceil(t/4)},clone:function(){var e=u.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t,r=[],n=function(e){e=e;var t=987654321,r=4294967295;return function(){var n=((t=36969*(65535&t)+(t>>16)&r)<<16)+(e=18e3*(65535&e)+(e>>16)&r)&r;return n/=4294967296,(n+=.5)*(Math.random()>.5?1:-1)}},i=0;i>>2]>>>24-i%4*8&255;n.push((o>>>4).toString(16)),n.push((15&o).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n>>3]|=parseInt(e.substr(n,2),16)<<24-n%8*4;return new c.init(r,t/2)}},d=f.Latin1={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i>>2]>>>24-i%4*8&255;n.push(String.fromCharCode(o))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n>>2]|=(255&e.charCodeAt(n))<<24-n%4*8;return new c.init(r,t)}},l=f.Utf8={stringify:function(e){try{return decodeURIComponent(escape(d.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return d.parse(unescape(encodeURIComponent(e)))}},g=a.BufferedBlockAlgorithm=u.extend({reset:function(){this._data=new c.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=l.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(e){var t=this._data,r=t.words,n=t.sigBytes,i=this.blockSize,o=n/(4*i),s=(o=e?Math.ceil(o):Math.max((0|o)-this._minBufferSize,0))*i,a=Math.min(4*s,n);if(s){for(var u=0;un&&(t=e.finalize(t)),t.clamp();for(var i=this._oKey=t.clone(),o=this._iKey=t.clone(),s=i.words,a=o.words,u=0;u>>7)^(d<<14|d>>>18)^d>>>3,g=b[h-2],p=(g<<15|g>>>17)^(g<<13|g>>>19)^g>>>10;b[h]=l+b[h-7]+p+b[h-16]}var v=n&i^n&o^i&o,y=(n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22),m=f+((a<<26|a>>>6)^(a<<21|a>>>11)^(a<<7|a>>>25))+(a&u^~a&c)+j[h]+b[h];f=c,c=u,u=a,a=s+m|0,s=o,o=i,i=n,n=m+(y+v)|0}r[0]=r[0]+n|0,r[1]=r[1]+i|0,r[2]=r[2]+o|0,r[3]=r[3]+s|0,r[4]=r[4]+a|0,r[5]=r[5]+u|0,r[6]=r[6]+c|0,r[7]=r[7]+f|0},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[14+(n+64>>>9<<4)]=Math.floor(r/4294967296),t[15+(n+64>>>9<<4)]=r,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=A.clone.call(this);return e._hash=this._hash.clone(),e}}),M=A._createHelper(H),x=A._createHmacHelper(H),C=function(e){return M(e).toString()},k=x,O=function(e){return encodeURIComponent(e).replace(/[*]/g,(function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()}))},T=function(e,t){return e.localeCompare(t)};function D(e){var t=e.url,r={},n=[];return t.searchParams.forEach((function(e,t){r[t]||(r[t]=[]),r[t].push(e)})),Object.keys(r).sort(T).forEach((function(e){r[e].sort(T).forEach((function(t){n.push(O(e)+"="+O(t))}))})),n.join("&")}var E=/\/\/+/g;function I(e,t){var r=e.algorithm,n=e.date,i=e.region,o=e.service;return[r,n.long,n.short+"/"+i+"/"+o+"/aws4_request",C(t)].join("\n")}var U=["url"],X=["accessKeyId","region","secretAccessKey","service"],q=/[:\-]|\.\d{3}/g,K=function(e){var t=e.headers,r=t["X-Amz-Date"],n=t.Date,i=r||new Date(n||Date.now()).toISOString().replace(q,"");return{short:i.split("T")[0],long:i}},P=function(e,i,o){var s=o.before,a=o.after;!function(e,t){if(!e)throw new Error("Missing request object");if(!t)throw new Error("Missing config object");var r=U.filter((function(t){return!e[t]}));if(r.length)throw new Error("Missing required request fields: "+r.join(", "));if((r=X.filter((function(e){return!t[e]}))).length)throw new Error("Missing required config fields: "+r.join(", "))}(e,i),e.headers||(e.headers={});var u=Object.assign(Object.create(null),{method:"GET"},e,i,{url:new URL(e.url),algorithm:"AWS4-HMAC-SHA256",date:K(e),sortedHeaders:n(e)}),c=function(e){var n,i,o,s,a=e.method,u=e.body,c=e.sortedHeaders;return[a.toUpperCase(),(i=e,o=i.service,s=i.url,"s3"===o?s.pathname:s.pathname.replace(E,"/").split("/").map(O).join("/")),D(e),(n=c,n.length?n.map((function(e){var r=e[0],n=e[1];return r+":"+(Array.isArray(n)?n.map(t).join(","):t(n))})).join("\n"):""),"",r(c),C("string"==typeof u?u.trim():u)].join("\n")}(u=s(u)),f=function(e,t){var r=e.date,n=e.secretAccessKey,i=e.region,o=e.service,s=k(r.short,"AWS4"+n),a=k(i,s),u=k(o,a),c=k("aws4_request",u);return k(t,c)}(u,I(u,c));return u.signed={canonical:c,stringToSign:I,signature:f},{url:(u=a(u)).url.toString(),headers:u.headers,method:u.method,body:u.body}},R=function(e){return e},W=function(e){var t=function(e){var t=e.algorithm,n=e.sortedHeaders,o=e.signed.signature;return[t+" Credential="+i(e),"SignedHeaders="+r(n),"Signature="+o].join(", ")}(e);return e.headers["X-Amz-Date"]=e.date.long,e.sessionToken&&(e.headers["X-Amz-Security-Token"]=e.sessionToken),e.headers.Authorization=t,e},F=function(e){var t=e.url;e.headers.host=t.host,e.sortedHeaders=n(e);var r=[["X-Amz-Algorithm",e.algorithm],["X-Amz-Credential",i(e)],["X-Amz-Date",e.date.long],!!e.sessionToken&&["X-Amz-Security-Token",e.sessionToken],["X-Amz-SignedHeaders",e.sortedHeaders.map((function(e){return e[0]})).join(",")]].filter(Boolean).map((function(e){var t=e[0],r=e[1];return t+"="+O(r)})).join("&");return t.search=t.search.length?t.search+"&"+r:r,e},L=function(e){var t=e.url,r=e.signed,n="X-Amz-Signature="+O(r.signature);return t.search=t.search+"&"+n,e.url=t.toString(),e};e.signedHeaders=function(e,t){return P(e,t,{before:R,after:W})},e.signedQuery=function(e,t){return P(e,t,{before:F,after:L})},Object.defineProperty(e,"__esModule",{value:!0})})); +/*! aws-sig@2.1.0 !*/ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=e||self)["aws-sig"]={})}(this,(function(e){"use strict";var t=function(e){return e.toString().trim().replace(/\s+/g," ")},r=function(e){return e.map((function(e){return e[0]})).join(";")},n=function(e){var t=e.headers;return void 0===t&&(t={}),Object.keys(t).map((function(e){return[e.toLowerCase(),t[e]]})).sort((function(e,t){var r=e[0],n=t[0];return r.localeCompare(n)}))},i=function(e){var t=e.accessKeyId,r=e.date,n=e.region,i=e.service;return t+"/"+r.short+"/"+n+"/"+i+"/aws4_request"},o=Object.create||function(){function e(){}return function(t){var r;return e.prototype=t,r=new e,e.prototype=null,r}}(),s={},a=s.lib={},u=a.Base={extend:function(e){var t=o(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},c=a.WordArray=u.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||h).stringify(this)},concat:function(e){var t=this.words,r=e.words,n=this.sigBytes,i=e.sigBytes;if(this.clamp(),n%4)for(var o=0;o>>2]>>>24-o%4*8&255;t[n+o>>>2]|=s<<24-(n+o)%4*8}else for(o=0;o>>2]=r[o>>>2];return this.sigBytes+=i,this},clamp:function(){var e=this.words,t=this.sigBytes;e[t>>>2]&=4294967295<<32-t%4*8,e.length=Math.ceil(t/4)},clone:function(){var e=u.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t,r=[],n=function(e){e=e;var t=987654321,r=4294967295;return function(){var n=((t=36969*(65535&t)+(t>>16)&r)<<16)+(e=18e3*(65535&e)+(e>>16)&r)&r;return n/=4294967296,(n+=.5)*(Math.random()>.5?1:-1)}},i=0;i>>2]>>>24-i%4*8&255;n.push((o>>>4).toString(16)),n.push((15&o).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n>>3]|=parseInt(e.substr(n,2),16)<<24-n%8*4;return new c.init(r,t/2)}},d=f.Latin1={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i>>2]>>>24-i%4*8&255;n.push(String.fromCharCode(o))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n>>2]|=(255&e.charCodeAt(n))<<24-n%4*8;return new c.init(r,t)}},l=f.Utf8={stringify:function(e){try{return decodeURIComponent(escape(d.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return d.parse(unescape(encodeURIComponent(e)))}},g=a.BufferedBlockAlgorithm=u.extend({reset:function(){this._data=new c.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=l.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(e){var t=this._data,r=t.words,n=t.sigBytes,i=this.blockSize,o=n/(4*i),s=(o=e?Math.ceil(o):Math.max((0|o)-this._minBufferSize,0))*i,a=Math.min(4*s,n);if(s){for(var u=0;un&&(t=e.finalize(t)),t.clamp();for(var i=this._oKey=t.clone(),o=this._iKey=t.clone(),s=i.words,a=o.words,u=0;u>>7)^(d<<14|d>>>18)^d>>>3,g=b[h-2],p=(g<<15|g>>>17)^(g<<13|g>>>19)^g>>>10;b[h]=l+b[h-7]+p+b[h-16]}var v=n&i^n&o^i&o,y=(n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22),m=f+((a<<26|a>>>6)^(a<<21|a>>>11)^(a<<7|a>>>25))+(a&u^~a&c)+j[h]+b[h];f=c,c=u,u=a,a=s+m|0,s=o,o=i,i=n,n=m+(y+v)|0}r[0]=r[0]+n|0,r[1]=r[1]+i|0,r[2]=r[2]+o|0,r[3]=r[3]+s|0,r[4]=r[4]+a|0,r[5]=r[5]+u|0,r[6]=r[6]+c|0,r[7]=r[7]+f|0},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[14+(n+64>>>9<<4)]=Math.floor(r/4294967296),t[15+(n+64>>>9<<4)]=r,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=A.clone.call(this);return e._hash=this._hash.clone(),e}}),M=A._createHelper(H),x=A._createHmacHelper(H),C=function(e){return M(e).toString()},k=x,D=function(e){return encodeURIComponent(e).replace(/[*]/g,(function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()}))},O=function(e,t){return e.localeCompare(t)};function T(e){var t=e.url,r={},n=[];return t.searchParams.forEach((function(e,t){r[t]||(r[t]=[]),r[t].push(e)})),Object.keys(r).sort(O).forEach((function(e){r[e].sort(O).forEach((function(t){n.push(D(e)+"="+D(t))}))})),n.join("&")}var X=/\/\/+/g;function E(e,t){var r=e.algorithm,n=e.date,i=e.region,o=e.service;return[r,n.long,n.short+"/"+i+"/"+o+"/aws4_request",C(t)].join("\n")}var I=["url"],U=["accessKeyId","region","secretAccessKey","service"],q=/[:\-]|\.\d{3}/g,K=function(e){return new Date(e||Date.now()).toISOString().replace(q,"")},P=function(e){var t=e.headers,r=t["X-Amz-Date"],n=t.Date,i=r||K(n);return{short:i.split("T")[0],long:i}},R=function(e,i,o){var s=o.before,a=o.after;!function(e,t){if(!e)throw new Error("Missing request object");if(!t)throw new Error("Missing config object");var r=I.filter((function(t){return!e[t]}));if(r.length)throw new Error("Missing required request fields: "+r.join(", "));if((r=U.filter((function(e){return!t[e]}))).length)throw new Error("Missing required config fields: "+r.join(", "))}(e,i),e.headers||(e.headers={});var u=Object.assign(Object.create(null),{method:"GET"},e,i,{url:new URL(e.url),algorithm:"AWS4-HMAC-SHA256",date:P(e),sortedHeaders:n(e)}),c=function(e){var n,i,o,s,a=e.method,u=e.body,c=e.sortedHeaders;return[a.toUpperCase(),(i=e,o=i.service,s=i.url,"s3"===o?s.pathname:s.pathname.replace(X,"/").split("/").map(D).join("/")),T(e),(n=c,n.length?n.map((function(e){var r=e[0],n=e[1];return r+":"+(Array.isArray(n)?n.map(t).join(","):t(n))})).join("\n"):""),"",r(c),C("string"==typeof u?u.trim():u)].join("\n")}(u=s(u)),f=function(e,t){var r=e.date,n=e.secretAccessKey,i=e.region,o=e.service,s=k(r.short,"AWS4"+n),a=k(i,s),u=k(o,a),c=k("aws4_request",u);return k(t,c)}(u,E(u,c));return u.signed={canonical:c,stringToSign:E,signature:f},{url:(u=a(u)).url.toString(),headers:u.headers,method:u.method,body:u.body}},W=function(e){return e},F=function(e){var t=function(e){var t=e.algorithm,n=e.sortedHeaders,o=e.signed.signature;return[t+" Credential="+i(e),"SignedHeaders="+r(n),"Signature="+o].join(", ")}(e);return e.headers["X-Amz-Date"]=e.date.long,e.sessionToken&&(e.headers["X-Amz-Security-Token"]=e.sessionToken),e.headers.Authorization=t,e},L=function(e){var t=e.url;e.headers.host=t.host,e.sortedHeaders=n(e);var r=[["X-Amz-Algorithm",e.algorithm],["X-Amz-Credential",i(e)],["X-Amz-Date",e.date.long],!!e.sessionToken&&["X-Amz-Security-Token",e.sessionToken],["X-Amz-SignedHeaders",e.sortedHeaders.map((function(e){return e[0]})).join(",")]].filter(Boolean).map((function(e){var t=e[0],r=e[1];return t+"="+D(r)})).join("&");return t.search=t.search.length?t.search+"&"+r:r,e},$=function(e){var t=e.url,r=e.signed,n="X-Amz-Signature="+D(r.signature);return t.search=t.search+"&"+n,e.url=t.toString(),e};e.headerXAmzDate=K,e.signedHeaders=function(e,t){return R(e,t,{before:W,after:F})},e.signedQuery=function(e,t){return R(e,t,{before:L,after:$})},Object.defineProperty(e,"__esModule",{value:!0})})); //# sourceMappingURL=aws-sig.umd.js.map diff --git a/dist/aws-sig.umd.js.map b/dist/aws-sig.umd.js.map index 7011257..704e649 100644 --- a/dist/aws-sig.umd.js.map +++ b/dist/aws-sig.umd.js.map @@ -1 +1 @@ -{"version":3,"file":"aws-sig.umd.js","sources":["../src/request/headers.js","../src/lib/credential.js","../src/crypto-es/core.js","../src/crypto-es/hmac.js","../src/crypto-es/sha256.js","../src/lib/hash.js","../src/lib/encode.js","../src/request/query.js","../src/request/path.js","../src/lib/stringtosign.js","../src/lib/validate.js","../src/sign.js","../src/request/request.js","../src/lib/signature.js","../src/signed-headers.js","../src/signed-query.js"],"sourcesContent":["const trim = (val) => {\r\n return val\r\n .toString()\r\n .trim()\r\n .replace(/\\s+/g, \" \");\r\n};\r\n\r\nconst values = (headers) => {\r\n if(!headers.length) {\r\n return \"\";\r\n }\r\n\r\n return headers\r\n .map(([ key, vals ]) => {\r\n return `${key}:${Array.isArray(vals) ? vals.map(trim).join(\",\") : trim(vals)}`;\r\n })\r\n .join(\"\\n\");\r\n};\r\n\r\nconst signed = (headers) => {\r\n return headers\r\n .map(([ key ]) => key)\r\n .join(\";\");\r\n};\r\n\r\nconst sorted = ({ headers = {} }) => {\r\n const out = Object.keys(headers).map((key) => [ key.toLowerCase(), headers[key] ]);\r\n\r\n return out.sort(([ keya ], [ keyb ]) => keya.localeCompare(keyb));\r\n};\r\n\r\nexport { sorted, values, signed };\r\n","const credential = (req) => {\r\n const {\r\n accessKeyId,\r\n date,\r\n region,\r\n service,\r\n } = req;\r\n\r\n return `${accessKeyId}/${date.short}/${region}/${service}/aws4_request`;\r\n};\r\n\r\nexport default credential;\r\n","/**\r\n * CryptoJS core components.\r\n */\r\n/*\r\n\t* Local polyfil of Object.create\r\n\t*/\r\nvar create = Object.create || (function () {\r\n\tfunction F() {};\r\n\r\n\treturn function (obj) {\r\n\t\tvar subtype;\r\n\r\n\t\tF.prototype = obj;\r\n\r\n\t\tsubtype = new F();\r\n\r\n\t\tF.prototype = null;\r\n\r\n\t\treturn subtype;\r\n\t};\r\n}())\r\n\r\n/**\r\n * CryptoJS namespace.\r\n */\r\nvar C = {};\r\n\r\n/**\r\n * Library namespace.\r\n */\r\nvar C_lib = C.lib = {};\r\n\r\n/**\r\n * Base object for prototypal inheritance.\r\n */\r\nvar Base = C_lib.Base = (function () {\r\n\r\n\r\n\treturn {\r\n\t\t/**\r\n\t\t * Creates a new object that inherits from this object.\r\n\t\t *\r\n\t\t * @param {Object} overrides Properties to copy into the new object.\r\n\t\t *\r\n\t\t * @return {Object} The new object.\r\n\t\t *\r\n\t\t * @static\r\n\t\t *\r\n\t\t * @example\r\n\t\t *\r\n\t\t * var MyType = CryptoJS.lib.Base.extend({\r\n\t\t * field: 'value',\r\n\t\t *\r\n\t\t * method: function () {\r\n\t\t * }\r\n\t\t * });\r\n\t\t */\r\n\t\textend: function (overrides) {\r\n\t\t\t// Spawn\r\n\t\t\tvar subtype = create(this);\r\n\r\n\t\t\t// Augment\r\n\t\t\tif (overrides) {\r\n\t\t\t\tsubtype.mixIn(overrides);\r\n\t\t\t}\r\n\r\n\t\t\t// Create default initializer\r\n\t\t\tif (!subtype.hasOwnProperty('init') || this.init === subtype.init) {\r\n\t\t\t\tsubtype.init = function () {\r\n\t\t\t\t\tsubtype.$super.init.apply(this, arguments);\r\n\t\t\t\t};\r\n\t\t\t}\r\n\r\n\t\t\t// Initializer's prototype is the subtype object\r\n\t\t\tsubtype.init.prototype = subtype;\r\n\r\n\t\t\t// Reference supertype\r\n\t\t\tsubtype.$super = this;\r\n\r\n\t\t\treturn subtype;\r\n\t\t},\r\n\r\n\t\t/**\r\n\t\t * Extends this object and runs the init method.\r\n\t\t * Arguments to create() will be passed to init().\r\n\t\t *\r\n\t\t * @return {Object} The new object.\r\n\t\t *\r\n\t\t * @static\r\n\t\t *\r\n\t\t * @example\r\n\t\t *\r\n\t\t * var instance = MyType.create();\r\n\t\t */\r\n\t\tcreate: function () {\r\n\t\t\tvar instance = this.extend();\r\n\t\t\tinstance.init.apply(instance, arguments);\r\n\r\n\t\t\treturn instance;\r\n\t\t},\r\n\r\n\t\t/**\r\n\t\t * Initializes a newly created object.\r\n\t\t * Override this method to add some logic when your objects are created.\r\n\t\t *\r\n\t\t * @example\r\n\t\t *\r\n\t\t * var MyType = CryptoJS.lib.Base.extend({\r\n\t\t * init: function () {\r\n\t\t * // ...\r\n\t\t * }\r\n\t\t * });\r\n\t\t */\r\n\t\tinit: function () {\r\n\t\t},\r\n\r\n\t\t/**\r\n\t\t * Copies properties into this object.\r\n\t\t *\r\n\t\t * @param {Object} properties The properties to mix in.\r\n\t\t *\r\n\t\t * @example\r\n\t\t *\r\n\t\t * MyType.mixIn({\r\n\t\t * field: 'value'\r\n\t\t * });\r\n\t\t */\r\n\t\tmixIn: function (properties) {\r\n\t\t\tfor (var propertyName in properties) {\r\n\t\t\t\tif (properties.hasOwnProperty(propertyName)) {\r\n\t\t\t\t\tthis[propertyName] = properties[propertyName];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// IE won't copy toString using the loop above\r\n\t\t\tif (properties.hasOwnProperty('toString')) {\r\n\t\t\t\tthis.toString = properties.toString;\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\t/**\r\n\t\t * Creates a copy of this object.\r\n\t\t *\r\n\t\t * @return {Object} The clone.\r\n\t\t *\r\n\t\t * @example\r\n\t\t *\r\n\t\t * var clone = instance.clone();\r\n\t\t */\r\n\t\tclone: function () {\r\n\t\t\treturn this.init.prototype.extend(this);\r\n\t\t}\r\n\t};\r\n}());\r\n\r\n/**\r\n * An array of 32-bit words.\r\n *\r\n * @property {Array} words The array of 32-bit words.\r\n * @property {number} sigBytes The number of significant bytes in this word array.\r\n */\r\nvar WordArray = C_lib.WordArray = Base.extend({\r\n\t/**\r\n\t * Initializes a newly created word array.\r\n\t *\r\n\t * @param {Array} words (Optional) An array of 32-bit words.\r\n\t * @param {number} sigBytes (Optional) The number of significant bytes in the words.\r\n\t *\r\n\t * @example\r\n\t *\r\n\t * var wordArray = CryptoJS.lib.WordArray.create();\r\n\t * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607]);\r\n\t * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607], 6);\r\n\t */\r\n\tinit: function (words, sigBytes) {\r\n\t\twords = this.words = words || [];\r\n\r\n\t\tif (sigBytes != undefined) {\r\n\t\t\tthis.sigBytes = sigBytes;\r\n\t\t} else {\r\n\t\t\tthis.sigBytes = words.length * 4;\r\n\t\t}\r\n\t},\r\n\r\n\t/**\r\n\t * Converts this word array to a string.\r\n\t *\r\n\t * @param {Encoder} encoder (Optional) The encoding strategy to use. Default: CryptoJS.enc.Hex\r\n\t *\r\n\t * @return {string} The stringified word array.\r\n\t *\r\n\t * @example\r\n\t *\r\n\t * var string = wordArray + '';\r\n\t * var string = wordArray.toString();\r\n\t * var string = wordArray.toString(CryptoJS.enc.Utf8);\r\n\t */\r\n\ttoString: function (encoder) {\r\n\t\treturn (encoder || Hex).stringify(this);\r\n\t},\r\n\r\n\t/**\r\n\t * Concatenates a word array to this word array.\r\n\t *\r\n\t * @param {WordArray} wordArray The word array to append.\r\n\t *\r\n\t * @return {WordArray} This word array.\r\n\t *\r\n\t * @example\r\n\t *\r\n\t * wordArray1.concat(wordArray2);\r\n\t */\r\n\tconcat: function (wordArray) {\r\n\t\t// Shortcuts\r\n\t\tvar thisWords = this.words;\r\n\t\tvar thatWords = wordArray.words;\r\n\t\tvar thisSigBytes = this.sigBytes;\r\n\t\tvar thatSigBytes = wordArray.sigBytes;\r\n\r\n\t\t// Clamp excess bits\r\n\t\tthis.clamp();\r\n\r\n\t\t// Concat\r\n\t\tif (thisSigBytes % 4) {\r\n\t\t\t// Copy one byte at a time\r\n\t\t\tfor (var i = 0; i < thatSigBytes; i++) {\r\n\t\t\t\tvar thatByte = (thatWords[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;\r\n\t\t\t\tthisWords[(thisSigBytes + i) >>> 2] |= thatByte << (24 - ((thisSigBytes + i) % 4) * 8);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t// Copy one word at a time\r\n\t\t\tfor (var i = 0; i < thatSigBytes; i += 4) {\r\n\t\t\t\tthisWords[(thisSigBytes + i) >>> 2] = thatWords[i >>> 2];\r\n\t\t\t}\r\n\t\t}\r\n\t\tthis.sigBytes += thatSigBytes;\r\n\r\n\t\t// Chainable\r\n\t\treturn this;\r\n\t},\r\n\r\n\t/**\r\n\t * Removes insignificant bits.\r\n\t *\r\n\t * @example\r\n\t *\r\n\t * wordArray.clamp();\r\n\t */\r\n\tclamp: function () {\r\n\t\t// Shortcuts\r\n\t\tvar words = this.words;\r\n\t\tvar sigBytes = this.sigBytes;\r\n\r\n\t\t// Clamp\r\n\t\twords[sigBytes >>> 2] &= 0xffffffff << (32 - (sigBytes % 4) * 8);\r\n\t\twords.length = Math.ceil(sigBytes / 4);\r\n\t},\r\n\r\n\t/**\r\n\t * Creates a copy of this word array.\r\n\t *\r\n\t * @return {WordArray} The clone.\r\n\t *\r\n\t * @example\r\n\t *\r\n\t * var clone = wordArray.clone();\r\n\t */\r\n\tclone: function () {\r\n\t\tvar clone = Base.clone.call(this);\r\n\t\tclone.words = this.words.slice(0);\r\n\r\n\t\treturn clone;\r\n\t},\r\n\r\n\t/**\r\n\t * Creates a word array filled with random bytes.\r\n\t *\r\n\t * @param {number} nBytes The number of random bytes to generate.\r\n\t *\r\n\t * @return {WordArray} The random word array.\r\n\t *\r\n\t * @static\r\n\t *\r\n\t * @example\r\n\t *\r\n\t * var wordArray = CryptoJS.lib.WordArray.random(16);\r\n\t */\r\n\trandom: function (nBytes) {\r\n\t\tvar words = [];\r\n\r\n\t\tvar r = (function (m_w) {\r\n\t\t\tvar m_w = m_w;\r\n\t\t\tvar m_z = 0x3ade68b1;\r\n\t\t\tvar mask = 0xffffffff;\r\n\r\n\t\t\treturn function () {\r\n\t\t\t\tm_z = (0x9069 * (m_z & 0xFFFF) + (m_z >> 0x10)) & mask;\r\n\t\t\t\tm_w = (0x4650 * (m_w & 0xFFFF) + (m_w >> 0x10)) & mask;\r\n\t\t\t\tvar result = ((m_z << 0x10) + m_w) & mask;\r\n\t\t\t\tresult /= 0x100000000;\r\n\t\t\t\tresult += 0.5;\r\n\t\t\t\treturn result * (Math.random() > .5 ? 1 : -1);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tfor (var i = 0, rcache; i < nBytes; i += 4) {\r\n\t\t\tvar _r = r((rcache || Math.random()) * 0x100000000);\r\n\r\n\t\t\trcache = _r() * 0x3ade67b7;\r\n\t\t\twords.push((_r() * 0x100000000) | 0);\r\n\t\t}\r\n\r\n\t\treturn new WordArray.init(words, nBytes);\r\n\t}\r\n});\r\n\r\n/**\r\n * Encoder namespace.\r\n */\r\nvar C_enc = C.enc = {};\r\n\r\n/**\r\n * Hex encoding strategy.\r\n */\r\nvar Hex = C_enc.Hex = {\r\n\t/**\r\n\t * Converts a word array to a hex string.\r\n\t *\r\n\t * @param {WordArray} wordArray The word array.\r\n\t *\r\n\t * @return {string} The hex string.\r\n\t *\r\n\t * @static\r\n\t *\r\n\t * @example\r\n\t *\r\n\t * var hexString = CryptoJS.enc.Hex.stringify(wordArray);\r\n\t */\r\n\tstringify: function (wordArray) {\r\n\t\t// Shortcuts\r\n\t\tvar words = wordArray.words;\r\n\t\tvar sigBytes = wordArray.sigBytes;\r\n\r\n\t\t// Convert\r\n\t\tvar hexChars = [];\r\n\t\tfor (var i = 0; i < sigBytes; i++) {\r\n\t\t\tvar bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;\r\n\t\t\thexChars.push((bite >>> 4).toString(16));\r\n\t\t\thexChars.push((bite & 0x0f).toString(16));\r\n\t\t}\r\n\r\n\t\treturn hexChars.join('');\r\n\t},\r\n\r\n\t/**\r\n\t * Converts a hex string to a word array.\r\n\t *\r\n\t * @param {string} hexStr The hex string.\r\n\t *\r\n\t * @return {WordArray} The word array.\r\n\t *\r\n\t * @static\r\n\t *\r\n\t * @example\r\n\t *\r\n\t * var wordArray = CryptoJS.enc.Hex.parse(hexString);\r\n\t */\r\n\tparse: function (hexStr) {\r\n\t\t// Shortcut\r\n\t\tvar hexStrLength = hexStr.length;\r\n\r\n\t\t// Convert\r\n\t\tvar words = [];\r\n\t\tfor (var i = 0; i < hexStrLength; i += 2) {\r\n\t\t\twords[i >>> 3] |= parseInt(hexStr.substr(i, 2), 16) << (24 - (i % 8) * 4);\r\n\t\t}\r\n\r\n\t\treturn new WordArray.init(words, hexStrLength / 2);\r\n\t}\r\n};\r\n\r\n/**\r\n * Latin1 encoding strategy.\r\n */\r\nvar Latin1 = C_enc.Latin1 = {\r\n\t/**\r\n\t * Converts a word array to a Latin1 string.\r\n\t *\r\n\t * @param {WordArray} wordArray The word array.\r\n\t *\r\n\t * @return {string} The Latin1 string.\r\n\t *\r\n\t * @static\r\n\t *\r\n\t * @example\r\n\t *\r\n\t * var latin1String = CryptoJS.enc.Latin1.stringify(wordArray);\r\n\t */\r\n\tstringify: function (wordArray) {\r\n\t\t// Shortcuts\r\n\t\tvar words = wordArray.words;\r\n\t\tvar sigBytes = wordArray.sigBytes;\r\n\r\n\t\t// Convert\r\n\t\tvar latin1Chars = [];\r\n\t\tfor (var i = 0; i < sigBytes; i++) {\r\n\t\t\tvar bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;\r\n\t\t\tlatin1Chars.push(String.fromCharCode(bite));\r\n\t\t}\r\n\r\n\t\treturn latin1Chars.join('');\r\n\t},\r\n\r\n\t/**\r\n\t * Converts a Latin1 string to a word array.\r\n\t *\r\n\t * @param {string} latin1Str The Latin1 string.\r\n\t *\r\n\t * @return {WordArray} The word array.\r\n\t *\r\n\t * @static\r\n\t *\r\n\t * @example\r\n\t *\r\n\t * var wordArray = CryptoJS.enc.Latin1.parse(latin1String);\r\n\t */\r\n\tparse: function (latin1Str) {\r\n\t\t// Shortcut\r\n\t\tvar latin1StrLength = latin1Str.length;\r\n\r\n\t\t// Convert\r\n\t\tvar words = [];\r\n\t\tfor (var i = 0; i < latin1StrLength; i++) {\r\n\t\t\twords[i >>> 2] |= (latin1Str.charCodeAt(i) & 0xff) << (24 - (i % 4) * 8);\r\n\t\t}\r\n\r\n\t\treturn new WordArray.init(words, latin1StrLength);\r\n\t}\r\n};\r\n\r\n/**\r\n * UTF-8 encoding strategy.\r\n */\r\nvar Utf8 = C_enc.Utf8 = {\r\n\t/**\r\n\t * Converts a word array to a UTF-8 string.\r\n\t *\r\n\t * @param {WordArray} wordArray The word array.\r\n\t *\r\n\t * @return {string} The UTF-8 string.\r\n\t *\r\n\t * @static\r\n\t *\r\n\t * @example\r\n\t *\r\n\t * var utf8String = CryptoJS.enc.Utf8.stringify(wordArray);\r\n\t */\r\n\tstringify: function (wordArray) {\r\n\t\ttry {\r\n\t\t\treturn decodeURIComponent(escape(Latin1.stringify(wordArray)));\r\n\t\t} catch (e) {\r\n\t\t\tthrow new Error('Malformed UTF-8 data');\r\n\t\t}\r\n\t},\r\n\r\n\t/**\r\n\t * Converts a UTF-8 string to a word array.\r\n\t *\r\n\t * @param {string} utf8Str The UTF-8 string.\r\n\t *\r\n\t * @return {WordArray} The word array.\r\n\t *\r\n\t * @static\r\n\t *\r\n\t * @example\r\n\t *\r\n\t * var wordArray = CryptoJS.enc.Utf8.parse(utf8String);\r\n\t */\r\n\tparse: function (utf8Str) {\r\n\t\treturn Latin1.parse(unescape(encodeURIComponent(utf8Str)));\r\n\t}\r\n};\r\n\r\n/**\r\n * Abstract buffered block algorithm template.\r\n *\r\n * The property blockSize must be implemented in a concrete subtype.\r\n *\r\n * @property {number} _minBufferSize The number of blocks that should be kept unprocessed in the buffer. Default: 0\r\n */\r\nvar BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm = Base.extend({\r\n\t/**\r\n\t * Resets this block algorithm's data buffer to its initial state.\r\n\t *\r\n\t * @example\r\n\t *\r\n\t * bufferedBlockAlgorithm.reset();\r\n\t */\r\n\treset: function () {\r\n\t\t// Initial values\r\n\t\tthis._data = new WordArray.init();\r\n\t\tthis._nDataBytes = 0;\r\n\t},\r\n\r\n\t/**\r\n\t * Adds new data to this block algorithm's buffer.\r\n\t *\r\n\t * @param {WordArray|string} data The data to append. Strings are converted to a WordArray using UTF-8.\r\n\t *\r\n\t * @example\r\n\t *\r\n\t * bufferedBlockAlgorithm._append('data');\r\n\t * bufferedBlockAlgorithm._append(wordArray);\r\n\t */\r\n\t_append: function (data) {\r\n\t\t// Convert string to WordArray, else assume WordArray already\r\n\t\tif (typeof data == 'string') {\r\n\t\t\tdata = Utf8.parse(data);\r\n\t\t}\r\n\r\n\t\t// Append\r\n\t\tthis._data.concat(data);\r\n\t\tthis._nDataBytes += data.sigBytes;\r\n\t},\r\n\r\n\t/**\r\n\t * Processes available data blocks.\r\n\t *\r\n\t * This method invokes _doProcessBlock(offset), which must be implemented by a concrete subtype.\r\n\t *\r\n\t * @param {boolean} doFlush Whether all blocks and partial blocks should be processed.\r\n\t *\r\n\t * @return {WordArray} The processed data.\r\n\t *\r\n\t * @example\r\n\t *\r\n\t * var processedData = bufferedBlockAlgorithm._process();\r\n\t * var processedData = bufferedBlockAlgorithm._process(!!'flush');\r\n\t */\r\n\t_process: function (doFlush) {\r\n\t\t// Shortcuts\r\n\t\tvar data = this._data;\r\n\t\tvar dataWords = data.words;\r\n\t\tvar dataSigBytes = data.sigBytes;\r\n\t\tvar blockSize = this.blockSize;\r\n\t\tvar blockSizeBytes = blockSize * 4;\r\n\r\n\t\t// Count blocks ready\r\n\t\tvar nBlocksReady = dataSigBytes / blockSizeBytes;\r\n\t\tif (doFlush) {\r\n\t\t\t// Round up to include partial blocks\r\n\t\t\tnBlocksReady = Math.ceil(nBlocksReady);\r\n\t\t} else {\r\n\t\t\t// Round down to include only full blocks,\r\n\t\t\t// less the number of blocks that must remain in the buffer\r\n\t\t\tnBlocksReady = Math.max((nBlocksReady | 0) - this._minBufferSize, 0);\r\n\t\t}\r\n\r\n\t\t// Count words ready\r\n\t\tvar nWordsReady = nBlocksReady * blockSize;\r\n\r\n\t\t// Count bytes ready\r\n\t\tvar nBytesReady = Math.min(nWordsReady * 4, dataSigBytes);\r\n\r\n\t\t// Process blocks\r\n\t\tif (nWordsReady) {\r\n\t\t\tfor (var offset = 0; offset < nWordsReady; offset += blockSize) {\r\n\t\t\t\t// Perform concrete-algorithm logic\r\n\t\t\t\tthis._doProcessBlock(dataWords, offset);\r\n\t\t\t}\r\n\r\n\t\t\t// Remove processed words\r\n\t\t\tvar processedWords = dataWords.splice(0, nWordsReady);\r\n\t\t\tdata.sigBytes -= nBytesReady;\r\n\t\t}\r\n\r\n\t\t// Return processed words\r\n\t\treturn new WordArray.init(processedWords, nBytesReady);\r\n\t},\r\n\r\n\t/**\r\n\t * Creates a copy of this object.\r\n\t *\r\n\t * @return {Object} The clone.\r\n\t *\r\n\t * @example\r\n\t *\r\n\t * var clone = bufferedBlockAlgorithm.clone();\r\n\t */\r\n\tclone: function () {\r\n\t\tvar clone = Base.clone.call(this);\r\n\t\tclone._data = this._data.clone();\r\n\r\n\t\treturn clone;\r\n\t},\r\n\r\n\t_minBufferSize: 0\r\n});\r\n\r\n/**\r\n * Abstract hasher template.\r\n *\r\n * @property {number} blockSize The number of 32-bit words this hasher operates on. Default: 16 (512 bits)\r\n */\r\nvar Hasher = C_lib.Hasher = BufferedBlockAlgorithm.extend({\r\n\t/**\r\n\t * Configuration options.\r\n\t */\r\n\tcfg: Base.extend(),\r\n\r\n\t/**\r\n\t * Initializes a newly created hasher.\r\n\t *\r\n\t * @param {Object} cfg (Optional) The configuration options to use for this hash computation.\r\n\t *\r\n\t * @example\r\n\t *\r\n\t * var hasher = CryptoJS.algo.SHA256.create();\r\n\t */\r\n\tinit: function (cfg) {\r\n\t\t// Apply config defaults\r\n\t\tthis.cfg = this.cfg.extend(cfg);\r\n\r\n\t\t// Set initial values\r\n\t\tthis.reset();\r\n\t},\r\n\r\n\t/**\r\n\t * Resets this hasher to its initial state.\r\n\t *\r\n\t * @example\r\n\t *\r\n\t * hasher.reset();\r\n\t */\r\n\treset: function () {\r\n\t\t// Reset data buffer\r\n\t\tBufferedBlockAlgorithm.reset.call(this);\r\n\r\n\t\t// Perform concrete-hasher logic\r\n\t\tthis._doReset();\r\n\t},\r\n\r\n\t/**\r\n\t * Updates this hasher with a message.\r\n\t *\r\n\t * @param {WordArray|string} messageUpdate The message to append.\r\n\t *\r\n\t * @return {Hasher} This hasher.\r\n\t *\r\n\t * @example\r\n\t *\r\n\t * hasher.update('message');\r\n\t * hasher.update(wordArray);\r\n\t */\r\n\tupdate: function (messageUpdate) {\r\n\t\t// Append\r\n\t\tthis._append(messageUpdate);\r\n\r\n\t\t// Update the hash\r\n\t\tthis._process();\r\n\r\n\t\t// Chainable\r\n\t\treturn this;\r\n\t},\r\n\r\n\t/**\r\n\t * Finalizes the hash computation.\r\n\t * Note that the finalize operation is effectively a destructive, read-once operation.\r\n\t *\r\n\t * @param {WordArray|string} messageUpdate (Optional) A final message update.\r\n\t *\r\n\t * @return {WordArray} The hash.\r\n\t *\r\n\t * @example\r\n\t *\r\n\t * var hash = hasher.finalize();\r\n\t * var hash = hasher.finalize('message');\r\n\t * var hash = hasher.finalize(wordArray);\r\n\t */\r\n\tfinalize: function (messageUpdate) {\r\n\t\t// Final message update\r\n\t\tif (messageUpdate) {\r\n\t\t\tthis._append(messageUpdate);\r\n\t\t}\r\n\r\n\t\t// Perform concrete-hasher logic\r\n\t\tvar hash = this._doFinalize();\r\n\r\n\t\treturn hash;\r\n\t},\r\n\r\n\tblockSize: 512/32,\r\n\r\n\t/**\r\n\t * Creates a shortcut function to a hasher's object interface.\r\n\t *\r\n\t * @param {Hasher} hasher The hasher to create a helper for.\r\n\t *\r\n\t * @return {Function} The shortcut function.\r\n\t *\r\n\t * @static\r\n\t *\r\n\t * @example\r\n\t *\r\n\t * var SHA256 = CryptoJS.lib.Hasher._createHelper(CryptoJS.algo.SHA256);\r\n\t */\r\n\t_createHelper: function (hasher) {\r\n\t\treturn function (message, cfg) {\r\n\t\t\treturn new hasher.init(cfg).finalize(message);\r\n\t\t};\r\n\t},\r\n\r\n\t/**\r\n\t * Creates a shortcut function to the HMAC's object interface.\r\n\t *\r\n\t * @param {Hasher} hasher The hasher to use in this HMAC helper.\r\n\t *\r\n\t * @return {Function} The shortcut function.\r\n\t *\r\n\t * @static\r\n\t *\r\n\t * @example\r\n\t *\r\n\t * var HmacSHA256 = CryptoJS.lib.Hasher._createHmacHelper(CryptoJS.algo.SHA256);\r\n\t */\r\n\t_createHmacHelper: function (hasher) {\r\n\t\treturn function (message, key) {\r\n\t\t\treturn new C_algo.HMAC.init(hasher, key).finalize(message);\r\n\t\t};\r\n\t}\r\n});\r\n\r\n/**\r\n * Algorithm namespace.\r\n */\r\nvar C_algo = C.algo = {};\r\n\r\nexport default C;\r\n","import Crypto from \"./core.js\";\r\n\r\n// Shortcuts\r\nvar C = Crypto;\r\nvar C_lib = C.lib;\r\nvar Base = C_lib.Base;\r\nvar C_enc = C.enc;\r\nvar Utf8 = C_enc.Utf8;\r\nvar C_algo = C.algo;\r\n\r\n/**\r\n * HMAC algorithm.\r\n */\r\nvar HMAC = C_algo.HMAC = Base.extend({\r\n\t/**\r\n\t * Initializes a newly created HMAC.\r\n\t *\r\n\t * @param {Hasher} hasher The hash algorithm to use.\r\n\t * @param {WordArray|string} key The secret key.\r\n\t *\r\n\t * @example\r\n\t *\r\n\t * var hmacHasher = CryptoJS.algo.HMAC.create(CryptoJS.algo.SHA256, key);\r\n\t */\r\n\tinit: function (hasher, key) {\r\n\t\t// Init hasher\r\n\t\thasher = this._hasher = new hasher.init();\r\n\r\n\t\t// Convert string to WordArray, else assume WordArray already\r\n\t\tif (typeof key == 'string') {\r\n\t\t\tkey = Utf8.parse(key);\r\n\t\t}\r\n\r\n\t\t// Shortcuts\r\n\t\tvar hasherBlockSize = hasher.blockSize;\r\n\t\tvar hasherBlockSizeBytes = hasherBlockSize * 4;\r\n\r\n\t\t// Allow arbitrary length keys\r\n\t\tif (key.sigBytes > hasherBlockSizeBytes) {\r\n\t\t\tkey = hasher.finalize(key);\r\n\t\t}\r\n\r\n\t\t// Clamp excess bits\r\n\t\tkey.clamp();\r\n\r\n\t\t// Clone key for inner and outer pads\r\n\t\tvar oKey = this._oKey = key.clone();\r\n\t\tvar iKey = this._iKey = key.clone();\r\n\r\n\t\t// Shortcuts\r\n\t\tvar oKeyWords = oKey.words;\r\n\t\tvar iKeyWords = iKey.words;\r\n\r\n\t\t// XOR keys with pad constants\r\n\t\tfor (var i = 0; i < hasherBlockSize; i++) {\r\n\t\t\toKeyWords[i] ^= 0x5c5c5c5c;\r\n\t\t\tiKeyWords[i] ^= 0x36363636;\r\n\t\t}\r\n\t\toKey.sigBytes = iKey.sigBytes = hasherBlockSizeBytes;\r\n\r\n\t\t// Set initial values\r\n\t\tthis.reset();\r\n\t},\r\n\r\n\t/**\r\n\t * Resets this HMAC to its initial state.\r\n\t *\r\n\t * @example\r\n\t *\r\n\t * hmacHasher.reset();\r\n\t */\r\n\treset: function () {\r\n\t\t// Shortcut\r\n\t\tvar hasher = this._hasher;\r\n\r\n\t\t// Reset\r\n\t\thasher.reset();\r\n\t\thasher.update(this._iKey);\r\n\t},\r\n\r\n\t/**\r\n\t * Updates this HMAC with a message.\r\n\t *\r\n\t * @param {WordArray|string} messageUpdate The message to append.\r\n\t *\r\n\t * @return {HMAC} This HMAC instance.\r\n\t *\r\n\t * @example\r\n\t *\r\n\t * hmacHasher.update('message');\r\n\t * hmacHasher.update(wordArray);\r\n\t */\r\n\tupdate: function (messageUpdate) {\r\n\t\tthis._hasher.update(messageUpdate);\r\n\r\n\t\t// Chainable\r\n\t\treturn this;\r\n\t},\r\n\r\n\t/**\r\n\t * Finalizes the HMAC computation.\r\n\t * Note that the finalize operation is effectively a destructive, read-once operation.\r\n\t *\r\n\t * @param {WordArray|string} messageUpdate (Optional) A final message update.\r\n\t *\r\n\t * @return {WordArray} The HMAC.\r\n\t *\r\n\t * @example\r\n\t *\r\n\t * var hmac = hmacHasher.finalize();\r\n\t * var hmac = hmacHasher.finalize('message');\r\n\t * var hmac = hmacHasher.finalize(wordArray);\r\n\t */\r\n\tfinalize: function (messageUpdate) {\r\n\t\t// Shortcut\r\n\t\tvar hasher = this._hasher;\r\n\r\n\t\t// Compute HMAC\r\n\t\tvar innerHash = hasher.finalize(messageUpdate);\r\n\t\thasher.reset();\r\n\t\tvar hmac = hasher.finalize(this._oKey.clone().concat(innerHash));\r\n\r\n\t\treturn hmac;\r\n\t}\r\n});\r\n","import Crypto from \"./core.js\";\r\nimport \"./hmac.js\";\r\n\r\n// Shortcuts\r\nvar C = Crypto;\r\nvar C_lib = C.lib;\r\nvar WordArray = C_lib.WordArray;\r\nvar Hasher = C_lib.Hasher;\r\nvar C_algo = C.algo;\r\n\r\n// Initialization and round constants tables\r\nvar H = [];\r\nvar K = [];\r\n\r\n// Compute constants\r\n(function () {\r\n\tfunction isPrime(n) {\r\n\t\tvar sqrtN = Math.sqrt(n);\r\n\t\tfor (var factor = 2; factor <= sqrtN; factor++) {\r\n\t\t\tif (!(n % factor)) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn true;\r\n\t}\r\n\r\n\tfunction getFractionalBits(n) {\r\n\t\treturn ((n - (n | 0)) * 0x100000000) | 0;\r\n\t}\r\n\r\n\tvar n = 2;\r\n\tvar nPrime = 0;\r\n\twhile (nPrime < 64) {\r\n\t\tif (isPrime(n)) {\r\n\t\t\tif (nPrime < 8) {\r\n\t\t\t\tH[nPrime] = getFractionalBits(Math.pow(n, 1 / 2));\r\n\t\t\t}\r\n\t\t\tK[nPrime] = getFractionalBits(Math.pow(n, 1 / 3));\r\n\r\n\t\t\tnPrime++;\r\n\t\t}\r\n\r\n\t\tn++;\r\n\t}\r\n}());\r\n\r\n// Reusable object\r\nvar W = [];\r\n\r\n/**\r\n * SHA-256 hash algorithm.\r\n */\r\nvar SHA256Hasher = C_algo.SHA256 = Hasher.extend({\r\n\t_doReset: function () {\r\n\t\tthis._hash = new WordArray.init(H.slice(0));\r\n\t},\r\n\r\n\t_doProcessBlock: function (M, offset) {\r\n\t\t// Shortcut\r\n\t\tvar H = this._hash.words;\r\n\r\n\t\t// Working variables\r\n\t\tvar a = H[0];\r\n\t\tvar b = H[1];\r\n\t\tvar c = H[2];\r\n\t\tvar d = H[3];\r\n\t\tvar e = H[4];\r\n\t\tvar f = H[5];\r\n\t\tvar g = H[6];\r\n\t\tvar h = H[7];\r\n\r\n\t\t// Computation\r\n\t\tfor (var i = 0; i < 64; i++) {\r\n\t\t\tif (i < 16) {\r\n\t\t\t\tW[i] = M[offset + i] | 0;\r\n\t\t\t} else {\r\n\t\t\t\tvar gamma0x = W[i - 15];\r\n\t\t\t\tvar gamma0 = ((gamma0x << 25) | (gamma0x >>> 7)) ^\r\n\t\t\t\t\t\t\t\t((gamma0x << 14) | (gamma0x >>> 18)) ^\r\n\t\t\t\t\t\t\t\t(gamma0x >>> 3);\r\n\r\n\t\t\t\tvar gamma1x = W[i - 2];\r\n\t\t\t\tvar gamma1 = ((gamma1x << 15) | (gamma1x >>> 17)) ^\r\n\t\t\t\t\t\t\t\t((gamma1x << 13) | (gamma1x >>> 19)) ^\r\n\t\t\t\t\t\t\t\t(gamma1x >>> 10);\r\n\r\n\t\t\t\tW[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16];\r\n\t\t\t}\r\n\r\n\t\t\tvar ch = (e & f) ^ (~e & g);\r\n\t\t\tvar maj = (a & b) ^ (a & c) ^ (b & c);\r\n\r\n\t\t\tvar sigma0 = ((a << 30) | (a >>> 2)) ^ ((a << 19) | (a >>> 13)) ^ ((a << 10) | (a >>> 22));\r\n\t\t\tvar sigma1 = ((e << 26) | (e >>> 6)) ^ ((e << 21) | (e >>> 11)) ^ ((e << 7) | (e >>> 25));\r\n\r\n\t\t\tvar t1 = h + sigma1 + ch + K[i] + W[i];\r\n\t\t\tvar t2 = sigma0 + maj;\r\n\r\n\t\t\th = g;\r\n\t\t\tg = f;\r\n\t\t\tf = e;\r\n\t\t\te = (d + t1) | 0;\r\n\t\t\td = c;\r\n\t\t\tc = b;\r\n\t\t\tb = a;\r\n\t\t\ta = (t1 + t2) | 0;\r\n\t\t}\r\n\r\n\t\t// Intermediate hash value\r\n\t\tH[0] = (H[0] + a) | 0;\r\n\t\tH[1] = (H[1] + b) | 0;\r\n\t\tH[2] = (H[2] + c) | 0;\r\n\t\tH[3] = (H[3] + d) | 0;\r\n\t\tH[4] = (H[4] + e) | 0;\r\n\t\tH[5] = (H[5] + f) | 0;\r\n\t\tH[6] = (H[6] + g) | 0;\r\n\t\tH[7] = (H[7] + h) | 0;\r\n\t},\r\n\r\n\t_doFinalize: function () {\r\n\t\t// Shortcuts\r\n\t\tvar data = this._data;\r\n\t\tvar dataWords = data.words;\r\n\r\n\t\tvar nBitsTotal = this._nDataBytes * 8;\r\n\t\tvar nBitsLeft = data.sigBytes * 8;\r\n\r\n\t\t// Add padding\r\n\t\tdataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32);\r\n\t\tdataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = Math.floor(nBitsTotal / 0x100000000);\r\n\t\tdataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = nBitsTotal;\r\n\t\tdata.sigBytes = dataWords.length * 4;\r\n\r\n\t\t// Hash final blocks\r\n\t\tthis._process();\r\n\r\n\t\t// Return final computed hash\r\n\t\treturn this._hash;\r\n\t},\r\n\r\n\tclone: function () {\r\n\t\tvar clone = Hasher.clone.call(this);\r\n\t\tclone._hash = this._hash.clone();\r\n\r\n\t\treturn clone;\r\n\t}\r\n});\r\n\r\n/**\r\n * Shortcut function to the hasher's object interface.\r\n *\r\n * @param {WordArray|string} message The message to hash.\r\n *\r\n * @return {WordArray} The hash.\r\n *\r\n * @static\r\n *\r\n * @example\r\n *\r\n * var hash = CryptoJS.SHA256('message');\r\n * var hash = CryptoJS.SHA256(wordArray);\r\n */\r\nconst SHA256 = Hasher._createHelper(SHA256Hasher);\r\n\r\n/**\r\n * Shortcut function to the HMAC's object interface.\r\n *\r\n * @param {WordArray|string} message The message to hash.\r\n * @param {WordArray|string} key The secret key.\r\n *\r\n * @return {WordArray} The HMAC.\r\n *\r\n * @static\r\n *\r\n * @example\r\n *\r\n * var hmac = CryptoJS.HmacSHA256(message, key);\r\n */\r\nconst HmacSHA256 = Hasher._createHmacHelper(SHA256Hasher);\r\n\r\nexport { SHA256, HmacSHA256 };\r\n","/* eslint-disable new-cap */\r\nimport { SHA256, HmacSHA256 } from \"../crypto-es/sha256.js\";\r\n\r\nconst hash = (str) =>\r\n SHA256(str).toString();\r\n\r\nconst hmac = HmacSHA256;\r\n \r\nexport { hmac, hash };\r\n","\"use strict\";\r\n\r\n// Replace one extra character beyond what encodeURIComponent does, \"*\"\r\n// See https://github.com/aws/aws-sdk-js/blob/38bf84c144281f696768e8c64500f2847fe6f298/lib/util.js#L39-L49\r\nconst encode = (str) =>\r\n encodeURIComponent(str)\r\n .replace(/[*]/g, (x) =>\r\n // eslint-disable-next-line newline-per-chained-call\r\n `%${x.charCodeAt(0).toString(16).toUpperCase()}`\r\n );\r\n\r\nexport default encode;\r\n","import encode from \"../lib/encode.js\";\r\n\r\nconst sort = (a, b) => a.localeCompare(b);\r\n\r\n// Sort query parameters by key\r\n// Then also sort by value because AWS\r\nexport default ({ url }) => {\r\n const source = {};\r\n const params = [];\r\n \r\n url.searchParams.forEach((value, key) => {\r\n if(!source[key]) {\r\n source[key] = [];\r\n }\r\n\r\n source[key].push(value);\r\n });\r\n\r\n Object.keys(source)\r\n .sort(sort)\r\n .forEach((key) => {\r\n source[key]\r\n .sort(sort)\r\n .forEach((value) => {\r\n params.push(`${encode(key)}=${encode(value)}`);\r\n });\r\n });\r\n\r\n return params.join(\"&\");\r\n};\r\n","import encode from \"../lib/encode.js\";\r\n\r\nconst multipleSlashesRegex = /\\/\\/+/g;\r\n\r\nexport default ({ service, url }) => {\r\n // S3 doesn't use normalized paths at all\r\n if(service === \"s3\") {\r\n return url.pathname;\r\n }\r\n \r\n return url.pathname\r\n .replace(multipleSlashesRegex, \"/\")\r\n .split(\"/\")\r\n .map(encode)\r\n .join(\"/\");\r\n};\r\n","import { hash } from \"./hash.js\";\r\n\r\n// https://docs.aws.amazon.com/general/latest/gr/sigv4-create-string-to-sign.html\r\nexport default ({ algorithm, date, region, service }, canonical) => [\r\n // Signing Function\r\n algorithm,\r\n \r\n // Date Time\r\n date.long,\r\n \r\n // Scope\r\n `${date.short}/${region}/${service}/aws4_request`,\r\n \r\n // Signed canonical request\r\n hash(canonical),\r\n ].join(\"\\n\");\r\n","const requestRequired = [\r\n \"url\",\r\n];\r\n\r\nconst configRequired = [\r\n \"accessKeyId\",\r\n \"region\",\r\n \"secretAccessKey\",\r\n \"service\",\r\n];\r\n\r\n// Check for required params\r\nconst validate = (source, config) => {\r\n if(!source) {\r\n throw new Error(`Missing request object`);\r\n }\r\n\r\n if(!config) {\r\n throw new Error(`Missing config object`);\r\n }\r\n\r\n let missing = requestRequired.filter((field) => !source[field]);\r\n\r\n if(missing.length) {\r\n throw new Error(`Missing required request fields: ${missing.join(\", \")}`);\r\n }\r\n \r\n missing = configRequired.filter((field) => !config[field]);\r\n\r\n if(missing.length) {\r\n throw new Error(`Missing required config fields: ${missing.join(\", \")}`);\r\n }\r\n};\r\n\r\nexport default validate;\r\n","import testing from \"consts:testing\";\r\n\r\nimport request from \"./request/request.js\";\r\nimport { sorted } from \"./request/headers.js\";\r\nimport stringToSign from \"./lib/stringtosign.js\";\r\nimport signature from \"./lib/signature.js\";\r\nimport validate from \"./lib/validate.js\";\r\n\r\nconst dateCleanRegex = /[:\\-]|\\.\\d{3}/g;\r\n\r\nconst parseDate = ({ headers : { \"X-Amz-Date\" : amzdate, Date : date } }) => {\r\n const datetime = amzdate ?\r\n amzdate :\r\n (new Date(date || Date.now()))\r\n .toISOString()\r\n .replace(dateCleanRegex, \"\");\r\n\r\n return {\r\n short : datetime.split(\"T\")[0],\r\n long : datetime,\r\n };\r\n};\r\n\r\n// eslint-disable-next-line max-statements\r\nconst sign = (source, config, { before, after }) => {\r\n validate(source, config);\r\n\r\n if(!source.headers) {\r\n source.headers = {};\r\n }\r\n\r\n let details = Object.assign(\r\n Object.create(null),\r\n {\r\n method : \"GET\",\r\n },\r\n source,\r\n config,\r\n {\r\n url : new URL(source.url),\r\n algorithm : \"AWS4-HMAC-SHA256\",\r\n date : parseDate(source),\r\n sortedHeaders : sorted(source),\r\n }\r\n );\r\n\r\n details = before(details);\r\n\r\n const canonical = request(details);\r\n const sts = stringToSign(details, canonical);\r\n const sig = signature(details, sts);\r\n\r\n details.signed = {\r\n canonical,\r\n stringToSign,\r\n signature : sig,\r\n };\r\n\r\n // Add partial output to response for tests so each step can be validated\r\n /* istanbul ignore next */\r\n if(testing) {\r\n details.test = {\r\n canonical,\r\n sts,\r\n };\r\n }\r\n \r\n details = after(details);\r\n\r\n const out = {\r\n url : details.url.toString(),\r\n headers : details.headers,\r\n method : details.method,\r\n body : details.body,\r\n };\r\n\r\n /* istanbul ignore next */\r\n if(testing) {\r\n out.test = details.test;\r\n }\r\n\r\n return out;\r\n};\r\n\r\nexport default sign;\r\n","import { hash } from \"../lib/hash.js\";\r\n\r\nimport query from \"./query.js\";\r\nimport { values, signed } from \"./headers.js\";\r\nimport path from \"./path.js\";\r\n\r\nexport default (req) => {\r\n const { method, body, sortedHeaders } = req;\r\n\r\n // https://docs.aws.amazon.com/general/latest/gr/sigv4-create-canonical-request.html\r\n return [\r\n method.toUpperCase(),\r\n \r\n // Canonical Path\r\n path(req),\r\n \r\n // Canonical Query\r\n query(req),\r\n \r\n // Canonical Headers\r\n values(sortedHeaders),\r\n\r\n // Extra linebreak\r\n \"\",\r\n\r\n // Signed Headers\r\n signed(sortedHeaders),\r\n\r\n // Hashed payload\r\n hash(typeof body === \"string\" ? body.trim() : body),\r\n ].join(\"\\n\");\r\n};\r\n","import { hmac } from \"./hash.js\";\r\n\r\n// https://docs.aws.amazon.com/general/latest/gr/sigv4-calculate-signature.html\r\nexport default ({ date, secretAccessKey, region, service }, sts) => {\r\n const kDate = hmac(date.short, `AWS4${secretAccessKey}`);\r\n const kRegion = hmac(region, kDate);\r\n const kService = hmac(service, kRegion);\r\n const kSignature = hmac(\"aws4_request\", kService);\r\n\r\n return hmac(sts, kSignature);\r\n};\r\n","import testing from \"consts:testing\";\r\n\r\nimport { signed } from \"./request/headers.js\";\r\nimport credential from \"./lib/credential.js\";\r\n\r\nimport sign from \"./sign.js\";\r\n\r\nconst authorization = (details) => {\r\n const {\r\n algorithm,\r\n sortedHeaders,\r\n signed : { signature },\r\n } = details;\r\n\r\n return [\r\n `${algorithm} Credential=${credential(details)}`,\r\n `SignedHeaders=${signed(sortedHeaders)}`,\r\n `Signature=${signature}`,\r\n ].join(\", \");\r\n};\r\n\r\n// NO-OP\r\nconst before = (details) => details;\r\n\r\nconst after = (details) => {\r\n const auth = authorization(details);\r\n\r\n details.headers[\"X-Amz-Date\"] = details.date.long;\r\n \r\n if(details.sessionToken) {\r\n details.headers[\"X-Amz-Security-Token\"] = details.sessionToken;\r\n }\r\n \r\n details.headers.Authorization = auth;\r\n\r\n // Add partial output to response for tests so each step can be validated\r\n /* istanbul ignore next */\r\n if(testing) {\r\n details.test.auth = auth;\r\n }\r\n\r\n return details;\r\n};\r\n\r\nconst signedHeaders = (source, config) => sign(source, config, { before, after });\r\n\r\nexport {\r\n signedHeaders,\r\n};\r\n","import { sorted } from \"./request/headers.js\";\r\nimport encode from \"./lib/encode.js\";\r\nimport credential from \"./lib/credential.js\";\r\n\r\nimport sign from \"./sign.js\";\r\n\r\nconst before = (details) => {\r\n const { url } = details;\r\n\r\n // Query param signatures always have a host header\r\n details.headers.host = url.host;\r\n\r\n // Need to update sortedHeaders after shoving in a host header\r\n details.sortedHeaders = sorted(details);\r\n\r\n const query = [\r\n [ \"X-Amz-Algorithm\", details.algorithm ],\r\n [ \"X-Amz-Credential\", credential(details) ],\r\n [ \"X-Amz-Date\", details.date.long ],\r\n\r\n details.sessionToken ?\r\n [ \"X-Amz-Security-Token\", details.sessionToken ] :\r\n false,\r\n\r\n [ \"X-Amz-SignedHeaders\", details.sortedHeaders.map(([ header ]) => header).join(\",\") ],\r\n ]\r\n .filter(Boolean)\r\n .map(([ key, value ]) => `${key}=${encode(value)}`)\r\n .join(\"&\");\r\n\r\n url.search = url.search.length ?\r\n `${url.search}&${query}` :\r\n query;\r\n \r\n return details;\r\n};\r\n\r\nconst after = (details) => {\r\n const { url, signed } = details;\r\n\r\n const sigparam = `X-Amz-Signature=${encode(signed.signature)}`;\r\n\r\n url.search = `${url.search}&${sigparam}`;\r\n\r\n details.url = url.toString();\r\n\r\n return details;\r\n};\r\n\r\nconst signedQuery = (source, config) => sign(source, config, { before, after });\r\n\r\nexport {\r\n signedQuery,\r\n};\r\n"],"names":["const","trim","val","toString","replace","signed","headers","map","ref","join","sorted","Object","keys","key","toLowerCase","sort","ref$1","keya","localeCompare","keyb","credential","req","accessKeyId","date","region","service","create","F","obj","subtype","prototype","C","C_lib","lib","Base","extend","overrides","this","mixIn","hasOwnProperty","init","$super","apply","arguments","instance","properties","propertyName","clone","WordArray","words","sigBytes","undefined","length","encoder","Hex","stringify","concat","wordArray","thisWords","thatWords","thisSigBytes","thatSigBytes","clamp","i","thatByte","Math","ceil","call","slice","random","nBytes","rcache","r","m_w","m_z","mask","result","_r","push","C_enc","enc","hexChars","bite","parse","hexStr","hexStrLength","parseInt","substr","Latin1","latin1Chars","String","fromCharCode","latin1Str","latin1StrLength","charCodeAt","Utf8","decodeURIComponent","escape","e","Error","utf8Str","unescape","encodeURIComponent","BufferedBlockAlgorithm","reset","_data","_nDataBytes","_append","data","_process","doFlush","dataWords","dataSigBytes","blockSize","nBlocksReady","nWordsReady","max","_minBufferSize","nBytesReady","min","offset","_doProcessBlock","processedWords","splice","C_algo","Hasher","cfg","_doReset","update","messageUpdate","finalize","_doFinalize","_createHelper","hasher","message","_createHmacHelper","HMAC","algo","Crypto","_hasher","hasherBlockSize","hasherBlockSizeBytes","oKey","_oKey","iKey","_iKey","oKeyWords","iKeyWords","innerHash","H","K","isPrime","n","sqrtN","sqrt","factor","getFractionalBits","nPrime","pow","W","SHA256Hasher","SHA256","_hash","M","a","b","c","d","f","g","h","gamma0x","gamma0","gamma1x","gamma1","maj","sigma0","t1","nBitsTotal","nBitsLeft","floor","HmacSHA256","hash","str","hmac","encode","x","toUpperCase","source","params","url","searchParams","forEach","value","multipleSlashesRegex","canonical","algorithm","long","requestRequired","configRequired","dateCleanRegex","parseDate","datetime","amzdate","Date","now","toISOString","short","split","sign","config","let","missing","filter","field","validate","details","assign","method","URL","sortedHeaders","pathname","query","Array","isArray","vals","body","request","before","sig","sts","kDate","secretAccessKey","kRegion","kService","kSignature","signature","stringToSign","after","auth","authorization","sessionToken","Authorization","host","Boolean","search","sigparam"],"mappings":";wMAAAA,IAAMC,WAAQC,GACV,OAAOA,EACFC,WACAF,OACAG,QAAQ,OAAQ,MAenBC,WAAUC,GACZ,OAAOA,EACFC,cAAKC,kBACLC,KAAK,MAGRC,WAAUF,mBAGZ,sBAHwB,IACZG,OAAOC,KAAKN,GAASC,cAAKM,SAAQ,CAAEA,EAAIC,cAAeR,EAAQO,OAEhEE,eAAMP,EAAUQ,4BAAaC,EAAKC,cAAcC,OC5BzDC,WAAcC,GAChB,oDAOA,OAAUC,MAAeC,YAAcC,MAAUC,mBCFjDC,EAASf,OAAOe,QAAW,WAC9B,SAASC,KAET,OAAO,SAAUC,GAChB,IAAIC,EAQJ,OANAF,EAAEG,UAAYF,EAEdC,EAAU,IAAIF,EAEdA,EAAEG,UAAY,KAEPD,MAOLE,EAAI,GAKJC,EAAQD,EAAEE,IAAM,GAKhBC,EAAOF,EAAME,KAGT,CAmBNC,OAAQ,SAAUC,GAEjB,IAAIP,EAAUH,EAAOW,MAoBrB,OAjBID,GACHP,EAAQS,MAAMF,GAIVP,EAAQU,eAAe,SAAWF,KAAKG,OAASX,EAAQW,OAC5DX,EAAQW,KAAO,WACdX,EAAQY,OAAOD,KAAKE,MAAML,KAAMM,aAKlCd,EAAQW,KAAKV,UAAYD,EAGzBA,EAAQY,OAASJ,KAEVR,GAeRH,OAAQ,WACP,IAAIkB,EAAWP,KAAKF,SAGpB,OAFAS,EAASJ,KAAKE,MAAME,EAAUD,WAEvBC,GAeRJ,KAAM,aAcNF,MAAO,SAAUO,GAChB,IAAK,IAAIC,KAAgBD,EACpBA,EAAWN,eAAeO,KAC7BT,KAAKS,GAAgBD,EAAWC,IAK9BD,EAAWN,eAAe,cAC7BF,KAAKlC,SAAW0C,EAAW1C,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AAQI,cAAgBlN,EAAO8M,GAE/BxN,IAAM8N,EAAQ,CACV,CAAE,kBAAmBN,EAAQpB,WAC7B,CAAE,mBAAoBhL,EAAWoM,IACjC,CAAE,aAAcA,EAAQjM,KAAK8K,QAE7BmB,EAAQyB,cACJ,CAAE,uBAAwBzB,EAAQyB,cAGtC,CAAE,sBAAuBzB,EAAQI,cAAcrN,cAAKC,kBAAuBC,KAAK,OAEnF4M,OAAO+B,SACP7O,cAAKC,4BAAsBK,MAAO4K,EAAOQ,MACzCxL,KAAK,KAMN,OAJAqL,EAAIuD,OAASvD,EAAIuD,OAAOjM,OACjB0I,aAAcgC,EACjBA,EAEGN,GAGLsB,WAAStB,GACX,uBAEM8B,EAAW,mBAAmB7D,EAAOpL,EAAOuO,WAMlD,OAJA9C,EAAIuD,OAAYvD,aAAcwD,EAE9B9B,EAAQ1B,IAAMA,EAAI3L,WAEXqN,4BDFY5B,EAAQsB,UAAWD,EAAKrB,EAAQsB,EAAQ,QAAEkB,QAAQU,4BCKpDlD,EAAQsB,UAAWD,EAAKrB,EAAQsB,EAAQ,QAAEkB,QAAQU"} \ No newline at end of file +{"version":3,"file":"aws-sig.umd.js","sources":["../src/request/headers.js","../src/lib/credential.js","../src/crypto-es/core.js","../src/crypto-es/hmac.js","../src/crypto-es/sha256.js","../src/lib/hash.js","../src/lib/encode.js","../src/request/query.js","../src/request/path.js","../src/lib/stringtosign.js","../src/lib/validate.js","../src/lib/header-x-amz-date.js","../src/sign.js","../src/request/request.js","../src/lib/signature.js","../src/signed-headers.js","../src/signed-query.js"],"sourcesContent":["const trim = (val) => {\r\n return val\r\n .toString()\r\n .trim()\r\n .replace(/\\s+/g, \" \");\r\n};\r\n\r\nconst values = (headers) => {\r\n if(!headers.length) {\r\n return \"\";\r\n }\r\n\r\n return headers\r\n .map(([ key, vals ]) => {\r\n return `${key}:${Array.isArray(vals) ? vals.map(trim).join(\",\") : trim(vals)}`;\r\n })\r\n .join(\"\\n\");\r\n};\r\n\r\nconst signed = (headers) => {\r\n return headers\r\n .map(([ key ]) => key)\r\n .join(\";\");\r\n};\r\n\r\nconst sorted = ({ headers = {} }) => {\r\n const out = Object.keys(headers).map((key) => [ key.toLowerCase(), headers[key] ]);\r\n\r\n return out.sort(([ keya ], [ keyb ]) => keya.localeCompare(keyb));\r\n};\r\n\r\nexport { sorted, values, signed };\r\n","const credential = (req) => {\r\n const {\r\n accessKeyId,\r\n date,\r\n region,\r\n service,\r\n } = req;\r\n\r\n return `${accessKeyId}/${date.short}/${region}/${service}/aws4_request`;\r\n};\r\n\r\nexport default credential;\r\n","/**\r\n * CryptoJS core components.\r\n */\r\n/*\r\n\t* Local polyfil of Object.create\r\n\t*/\r\nvar create = Object.create || (function () {\r\n\tfunction F() {};\r\n\r\n\treturn function (obj) {\r\n\t\tvar subtype;\r\n\r\n\t\tF.prototype = obj;\r\n\r\n\t\tsubtype = new F();\r\n\r\n\t\tF.prototype = null;\r\n\r\n\t\treturn subtype;\r\n\t};\r\n}());\r\n\r\n/**\r\n * CryptoJS namespace.\r\n */\r\nvar C = {};\r\n\r\n/**\r\n * Library namespace.\r\n */\r\nvar C_lib = C.lib = {};\r\n\r\n/**\r\n * Base object for prototypal inheritance.\r\n */\r\nvar Base = C_lib.Base = (function () {\r\n\r\n\r\n\treturn {\r\n\t\t/**\r\n\t\t * Creates a new object that inherits from this object.\r\n\t\t *\r\n\t\t * @param {Object} overrides Properties to copy into the new object.\r\n\t\t *\r\n\t\t * @return {Object} The new object.\r\n\t\t *\r\n\t\t * @static\r\n\t\t *\r\n\t\t * @example\r\n\t\t *\r\n\t\t * var MyType = CryptoJS.lib.Base.extend({\r\n\t\t * field: 'value',\r\n\t\t *\r\n\t\t * method: function () {\r\n\t\t * }\r\n\t\t * });\r\n\t\t */\r\n\t\textend: function (overrides) {\r\n\t\t\t// Spawn\r\n\t\t\tvar subtype = create(this);\r\n\r\n\t\t\t// Augment\r\n\t\t\tif (overrides) {\r\n\t\t\t\tsubtype.mixIn(overrides);\r\n\t\t\t}\r\n\r\n\t\t\t// Create default initializer\r\n\t\t\tif (!subtype.hasOwnProperty('init') || this.init === subtype.init) {\r\n\t\t\t\tsubtype.init = function () {\r\n\t\t\t\t\tsubtype.$super.init.apply(this, arguments);\r\n\t\t\t\t};\r\n\t\t\t}\r\n\r\n\t\t\t// Initializer's prototype is the subtype object\r\n\t\t\tsubtype.init.prototype = subtype;\r\n\r\n\t\t\t// Reference supertype\r\n\t\t\tsubtype.$super = this;\r\n\r\n\t\t\treturn subtype;\r\n\t\t},\r\n\r\n\t\t/**\r\n\t\t * Extends this object and runs the init method.\r\n\t\t * Arguments to create() will be passed to init().\r\n\t\t *\r\n\t\t * @return {Object} The new object.\r\n\t\t *\r\n\t\t * @static\r\n\t\t *\r\n\t\t * @example\r\n\t\t *\r\n\t\t * var instance = MyType.create();\r\n\t\t */\r\n\t\tcreate: function () {\r\n\t\t\tvar instance = this.extend();\r\n\t\t\tinstance.init.apply(instance, arguments);\r\n\r\n\t\t\treturn instance;\r\n\t\t},\r\n\r\n\t\t/**\r\n\t\t * Initializes a newly created object.\r\n\t\t * Override this method to add some logic when your objects are created.\r\n\t\t *\r\n\t\t * @example\r\n\t\t *\r\n\t\t * var MyType = CryptoJS.lib.Base.extend({\r\n\t\t * init: function () {\r\n\t\t * // ...\r\n\t\t * }\r\n\t\t * });\r\n\t\t */\r\n\t\tinit: function () {\r\n\t\t},\r\n\r\n\t\t/**\r\n\t\t * Copies properties into this object.\r\n\t\t *\r\n\t\t * @param {Object} properties The properties to mix in.\r\n\t\t *\r\n\t\t * @example\r\n\t\t *\r\n\t\t * MyType.mixIn({\r\n\t\t * field: 'value'\r\n\t\t * });\r\n\t\t */\r\n\t\tmixIn: function (properties) {\r\n\t\t\tfor (var propertyName in properties) {\r\n\t\t\t\tif (properties.hasOwnProperty(propertyName)) {\r\n\t\t\t\t\tthis[propertyName] = properties[propertyName];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// IE won't copy toString using the loop above\r\n\t\t\tif (properties.hasOwnProperty('toString')) {\r\n\t\t\t\tthis.toString = properties.toString;\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\t/**\r\n\t\t * Creates a copy of this object.\r\n\t\t *\r\n\t\t * @return {Object} The clone.\r\n\t\t *\r\n\t\t * @example\r\n\t\t *\r\n\t\t * var clone = instance.clone();\r\n\t\t */\r\n\t\tclone: function () {\r\n\t\t\treturn this.init.prototype.extend(this);\r\n\t\t}\r\n\t};\r\n}());\r\n\r\n/**\r\n * An array of 32-bit words.\r\n *\r\n * @property {Array} words The array of 32-bit words.\r\n * @property {number} sigBytes The number of significant bytes in this word array.\r\n */\r\nvar WordArray = C_lib.WordArray = Base.extend({\r\n\t/**\r\n\t * Initializes a newly created word array.\r\n\t *\r\n\t * @param {Array} words (Optional) An array of 32-bit words.\r\n\t * @param {number} sigBytes (Optional) The number of significant bytes in the words.\r\n\t *\r\n\t * @example\r\n\t *\r\n\t * var wordArray = CryptoJS.lib.WordArray.create();\r\n\t * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607]);\r\n\t * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607], 6);\r\n\t */\r\n\tinit: function (words, sigBytes) {\r\n\t\twords = this.words = words || [];\r\n\r\n\t\tif (sigBytes != undefined) {\r\n\t\t\tthis.sigBytes = sigBytes;\r\n\t\t} else {\r\n\t\t\tthis.sigBytes = words.length * 4;\r\n\t\t}\r\n\t},\r\n\r\n\t/**\r\n\t * Converts this word array to a string.\r\n\t *\r\n\t * @param {Encoder} encoder (Optional) The encoding strategy to use. Default: CryptoJS.enc.Hex\r\n\t *\r\n\t * @return {string} The stringified word array.\r\n\t *\r\n\t * @example\r\n\t *\r\n\t * var string = wordArray + '';\r\n\t * var string = wordArray.toString();\r\n\t * var string = wordArray.toString(CryptoJS.enc.Utf8);\r\n\t */\r\n\ttoString: function (encoder) {\r\n\t\treturn (encoder || Hex).stringify(this);\r\n\t},\r\n\r\n\t/**\r\n\t * Concatenates a word array to this word array.\r\n\t *\r\n\t * @param {WordArray} wordArray The word array to append.\r\n\t *\r\n\t * @return {WordArray} This word array.\r\n\t *\r\n\t * @example\r\n\t *\r\n\t * wordArray1.concat(wordArray2);\r\n\t */\r\n\tconcat: function (wordArray) {\r\n\t\t// Shortcuts\r\n\t\tvar thisWords = this.words;\r\n\t\tvar thatWords = wordArray.words;\r\n\t\tvar thisSigBytes = this.sigBytes;\r\n\t\tvar thatSigBytes = wordArray.sigBytes;\r\n\r\n\t\t// Clamp excess bits\r\n\t\tthis.clamp();\r\n\r\n\t\t// Concat\r\n\t\tif (thisSigBytes % 4) {\r\n\t\t\t// Copy one byte at a time\r\n\t\t\tfor (var i = 0; i < thatSigBytes; i++) {\r\n\t\t\t\tvar thatByte = (thatWords[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;\r\n\t\t\t\tthisWords[(thisSigBytes + i) >>> 2] |= thatByte << (24 - ((thisSigBytes + i) % 4) * 8);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t// Copy one word at a time\r\n\t\t\tfor (var i = 0; i < thatSigBytes; i += 4) {\r\n\t\t\t\tthisWords[(thisSigBytes + i) >>> 2] = thatWords[i >>> 2];\r\n\t\t\t}\r\n\t\t}\r\n\t\tthis.sigBytes += thatSigBytes;\r\n\r\n\t\t// Chainable\r\n\t\treturn this;\r\n\t},\r\n\r\n\t/**\r\n\t * Removes insignificant bits.\r\n\t *\r\n\t * @example\r\n\t *\r\n\t * wordArray.clamp();\r\n\t */\r\n\tclamp: function () {\r\n\t\t// Shortcuts\r\n\t\tvar words = this.words;\r\n\t\tvar sigBytes = this.sigBytes;\r\n\r\n\t\t// Clamp\r\n\t\twords[sigBytes >>> 2] &= 0xffffffff << (32 - (sigBytes % 4) * 8);\r\n\t\twords.length = Math.ceil(sigBytes / 4);\r\n\t},\r\n\r\n\t/**\r\n\t * Creates a copy of this word array.\r\n\t *\r\n\t * @return {WordArray} The clone.\r\n\t *\r\n\t * @example\r\n\t *\r\n\t * var clone = wordArray.clone();\r\n\t */\r\n\tclone: function () {\r\n\t\tvar clone = Base.clone.call(this);\r\n\t\tclone.words = this.words.slice(0);\r\n\r\n\t\treturn clone;\r\n\t},\r\n\r\n\t/**\r\n\t * Creates a word array filled with random bytes.\r\n\t *\r\n\t * @param {number} nBytes The number of random bytes to generate.\r\n\t *\r\n\t * @return {WordArray} The random word array.\r\n\t *\r\n\t * @static\r\n\t *\r\n\t * @example\r\n\t *\r\n\t * var wordArray = CryptoJS.lib.WordArray.random(16);\r\n\t */\r\n\trandom: function (nBytes) {\r\n\t\tvar words = [];\r\n\r\n\t\tvar r = (function (m_w) {\r\n\t\t\tvar m_w = m_w;\r\n\t\t\tvar m_z = 0x3ade68b1;\r\n\t\t\tvar mask = 0xffffffff;\r\n\r\n\t\t\treturn function () {\r\n\t\t\t\tm_z = (0x9069 * (m_z & 0xFFFF) + (m_z >> 0x10)) & mask;\r\n\t\t\t\tm_w = (0x4650 * (m_w & 0xFFFF) + (m_w >> 0x10)) & mask;\r\n\t\t\t\tvar result = ((m_z << 0x10) + m_w) & mask;\r\n\t\t\t\tresult /= 0x100000000;\r\n\t\t\t\tresult += 0.5;\r\n\t\t\t\treturn result * (Math.random() > .5 ? 1 : -1);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tfor (var i = 0, rcache; i < nBytes; i += 4) {\r\n\t\t\tvar _r = r((rcache || Math.random()) * 0x100000000);\r\n\r\n\t\t\trcache = _r() * 0x3ade67b7;\r\n\t\t\twords.push((_r() * 0x100000000) | 0);\r\n\t\t}\r\n\r\n\t\treturn new WordArray.init(words, nBytes);\r\n\t}\r\n});\r\n\r\n/**\r\n * Encoder namespace.\r\n */\r\nvar C_enc = C.enc = {};\r\n\r\n/**\r\n * Hex encoding strategy.\r\n */\r\nvar Hex = C_enc.Hex = {\r\n\t/**\r\n\t * Converts a word array to a hex string.\r\n\t *\r\n\t * @param {WordArray} wordArray The word array.\r\n\t *\r\n\t * @return {string} The hex string.\r\n\t *\r\n\t * @static\r\n\t *\r\n\t * @example\r\n\t *\r\n\t * var hexString = CryptoJS.enc.Hex.stringify(wordArray);\r\n\t */\r\n\tstringify: function (wordArray) {\r\n\t\t// Shortcuts\r\n\t\tvar words = wordArray.words;\r\n\t\tvar sigBytes = wordArray.sigBytes;\r\n\r\n\t\t// Convert\r\n\t\tvar hexChars = [];\r\n\t\tfor (var i = 0; i < sigBytes; i++) {\r\n\t\t\tvar bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;\r\n\t\t\thexChars.push((bite >>> 4).toString(16));\r\n\t\t\thexChars.push((bite & 0x0f).toString(16));\r\n\t\t}\r\n\r\n\t\treturn hexChars.join('');\r\n\t},\r\n\r\n\t/**\r\n\t * Converts a hex string to a word array.\r\n\t *\r\n\t * @param {string} hexStr The hex string.\r\n\t *\r\n\t * @return {WordArray} The word array.\r\n\t *\r\n\t * @static\r\n\t *\r\n\t * @example\r\n\t *\r\n\t * var wordArray = CryptoJS.enc.Hex.parse(hexString);\r\n\t */\r\n\tparse: function (hexStr) {\r\n\t\t// Shortcut\r\n\t\tvar hexStrLength = hexStr.length;\r\n\r\n\t\t// Convert\r\n\t\tvar words = [];\r\n\t\tfor (var i = 0; i < hexStrLength; i += 2) {\r\n\t\t\twords[i >>> 3] |= parseInt(hexStr.substr(i, 2), 16) << (24 - (i % 8) * 4);\r\n\t\t}\r\n\r\n\t\treturn new WordArray.init(words, hexStrLength / 2);\r\n\t}\r\n};\r\n\r\n/**\r\n * Latin1 encoding strategy.\r\n */\r\nvar Latin1 = C_enc.Latin1 = {\r\n\t/**\r\n\t * Converts a word array to a Latin1 string.\r\n\t *\r\n\t * @param {WordArray} wordArray The word array.\r\n\t *\r\n\t * @return {string} The Latin1 string.\r\n\t *\r\n\t * @static\r\n\t *\r\n\t * @example\r\n\t *\r\n\t * var latin1String = CryptoJS.enc.Latin1.stringify(wordArray);\r\n\t */\r\n\tstringify: function (wordArray) {\r\n\t\t// Shortcuts\r\n\t\tvar words = wordArray.words;\r\n\t\tvar sigBytes = wordArray.sigBytes;\r\n\r\n\t\t// Convert\r\n\t\tvar latin1Chars = [];\r\n\t\tfor (var i = 0; i < sigBytes; i++) {\r\n\t\t\tvar bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;\r\n\t\t\tlatin1Chars.push(String.fromCharCode(bite));\r\n\t\t}\r\n\r\n\t\treturn latin1Chars.join('');\r\n\t},\r\n\r\n\t/**\r\n\t * Converts a Latin1 string to a word array.\r\n\t *\r\n\t * @param {string} latin1Str The Latin1 string.\r\n\t *\r\n\t * @return {WordArray} The word array.\r\n\t *\r\n\t * @static\r\n\t *\r\n\t * @example\r\n\t *\r\n\t * var wordArray = CryptoJS.enc.Latin1.parse(latin1String);\r\n\t */\r\n\tparse: function (latin1Str) {\r\n\t\t// Shortcut\r\n\t\tvar latin1StrLength = latin1Str.length;\r\n\r\n\t\t// Convert\r\n\t\tvar words = [];\r\n\t\tfor (var i = 0; i < latin1StrLength; i++) {\r\n\t\t\twords[i >>> 2] |= (latin1Str.charCodeAt(i) & 0xff) << (24 - (i % 4) * 8);\r\n\t\t}\r\n\r\n\t\treturn new WordArray.init(words, latin1StrLength);\r\n\t}\r\n};\r\n\r\n/**\r\n * UTF-8 encoding strategy.\r\n */\r\nvar Utf8 = C_enc.Utf8 = {\r\n\t/**\r\n\t * Converts a word array to a UTF-8 string.\r\n\t *\r\n\t * @param {WordArray} wordArray The word array.\r\n\t *\r\n\t * @return {string} The UTF-8 string.\r\n\t *\r\n\t * @static\r\n\t *\r\n\t * @example\r\n\t *\r\n\t * var utf8String = CryptoJS.enc.Utf8.stringify(wordArray);\r\n\t */\r\n\tstringify: function (wordArray) {\r\n\t\ttry {\r\n\t\t\treturn decodeURIComponent(escape(Latin1.stringify(wordArray)));\r\n\t\t} catch (e) {\r\n\t\t\tthrow new Error('Malformed UTF-8 data');\r\n\t\t}\r\n\t},\r\n\r\n\t/**\r\n\t * Converts a UTF-8 string to a word array.\r\n\t *\r\n\t * @param {string} utf8Str The UTF-8 string.\r\n\t *\r\n\t * @return {WordArray} The word array.\r\n\t *\r\n\t * @static\r\n\t *\r\n\t * @example\r\n\t *\r\n\t * var wordArray = CryptoJS.enc.Utf8.parse(utf8String);\r\n\t */\r\n\tparse: function (utf8Str) {\r\n\t\treturn Latin1.parse(unescape(encodeURIComponent(utf8Str)));\r\n\t}\r\n};\r\n\r\n/**\r\n * Abstract buffered block algorithm template.\r\n *\r\n * The property blockSize must be implemented in a concrete subtype.\r\n *\r\n * @property {number} _minBufferSize The number of blocks that should be kept unprocessed in the buffer. Default: 0\r\n */\r\nvar BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm = Base.extend({\r\n\t/**\r\n\t * Resets this block algorithm's data buffer to its initial state.\r\n\t *\r\n\t * @example\r\n\t *\r\n\t * bufferedBlockAlgorithm.reset();\r\n\t */\r\n\treset: function () {\r\n\t\t// Initial values\r\n\t\tthis._data = new WordArray.init();\r\n\t\tthis._nDataBytes = 0;\r\n\t},\r\n\r\n\t/**\r\n\t * Adds new data to this block algorithm's buffer.\r\n\t *\r\n\t * @param {WordArray|string} data The data to append. Strings are converted to a WordArray using UTF-8.\r\n\t *\r\n\t * @example\r\n\t *\r\n\t * bufferedBlockAlgorithm._append('data');\r\n\t * bufferedBlockAlgorithm._append(wordArray);\r\n\t */\r\n\t_append: function (data) {\r\n\t\t// Convert string to WordArray, else assume WordArray already\r\n\t\tif (typeof data == 'string') {\r\n\t\t\tdata = Utf8.parse(data);\r\n\t\t}\r\n\r\n\t\t// Append\r\n\t\tthis._data.concat(data);\r\n\t\tthis._nDataBytes += data.sigBytes;\r\n\t},\r\n\r\n\t/**\r\n\t * Processes available data blocks.\r\n\t *\r\n\t * This method invokes _doProcessBlock(offset), which must be implemented by a concrete subtype.\r\n\t *\r\n\t * @param {boolean} doFlush Whether all blocks and partial blocks should be processed.\r\n\t *\r\n\t * @return {WordArray} The processed data.\r\n\t *\r\n\t * @example\r\n\t *\r\n\t * var processedData = bufferedBlockAlgorithm._process();\r\n\t * var processedData = bufferedBlockAlgorithm._process(!!'flush');\r\n\t */\r\n\t_process: function (doFlush) {\r\n\t\t// Shortcuts\r\n\t\tvar data = this._data;\r\n\t\tvar dataWords = data.words;\r\n\t\tvar dataSigBytes = data.sigBytes;\r\n\t\tvar blockSize = this.blockSize;\r\n\t\tvar blockSizeBytes = blockSize * 4;\r\n\r\n\t\t// Count blocks ready\r\n\t\tvar nBlocksReady = dataSigBytes / blockSizeBytes;\r\n\t\tif (doFlush) {\r\n\t\t\t// Round up to include partial blocks\r\n\t\t\tnBlocksReady = Math.ceil(nBlocksReady);\r\n\t\t} else {\r\n\t\t\t// Round down to include only full blocks,\r\n\t\t\t// less the number of blocks that must remain in the buffer\r\n\t\t\tnBlocksReady = Math.max((nBlocksReady | 0) - this._minBufferSize, 0);\r\n\t\t}\r\n\r\n\t\t// Count words ready\r\n\t\tvar nWordsReady = nBlocksReady * blockSize;\r\n\r\n\t\t// Count bytes ready\r\n\t\tvar nBytesReady = Math.min(nWordsReady * 4, dataSigBytes);\r\n\r\n\t\t// Process blocks\r\n\t\tif (nWordsReady) {\r\n\t\t\tfor (var offset = 0; offset < nWordsReady; offset += blockSize) {\r\n\t\t\t\t// Perform concrete-algorithm logic\r\n\t\t\t\tthis._doProcessBlock(dataWords, offset);\r\n\t\t\t}\r\n\r\n\t\t\t// Remove processed words\r\n\t\t\tvar processedWords = dataWords.splice(0, nWordsReady);\r\n\t\t\tdata.sigBytes -= nBytesReady;\r\n\t\t}\r\n\r\n\t\t// Return processed words\r\n\t\treturn new WordArray.init(processedWords, nBytesReady);\r\n\t},\r\n\r\n\t/**\r\n\t * Creates a copy of this object.\r\n\t *\r\n\t * @return {Object} The clone.\r\n\t *\r\n\t * @example\r\n\t *\r\n\t * var clone = bufferedBlockAlgorithm.clone();\r\n\t */\r\n\tclone: function () {\r\n\t\tvar clone = Base.clone.call(this);\r\n\t\tclone._data = this._data.clone();\r\n\r\n\t\treturn clone;\r\n\t},\r\n\r\n\t_minBufferSize: 0\r\n});\r\n\r\n/**\r\n * Abstract hasher template.\r\n *\r\n * @property {number} blockSize The number of 32-bit words this hasher operates on. Default: 16 (512 bits)\r\n */\r\nC_lib.Hasher = BufferedBlockAlgorithm.extend({\r\n\t/**\r\n\t * Configuration options.\r\n\t */\r\n\tcfg: Base.extend(),\r\n\r\n\t/**\r\n\t * Initializes a newly created hasher.\r\n\t *\r\n\t * @param {Object} cfg (Optional) The configuration options to use for this hash computation.\r\n\t *\r\n\t * @example\r\n\t *\r\n\t * var hasher = CryptoJS.algo.SHA256.create();\r\n\t */\r\n\tinit: function (cfg) {\r\n\t\t// Apply config defaults\r\n\t\tthis.cfg = this.cfg.extend(cfg);\r\n\r\n\t\t// Set initial values\r\n\t\tthis.reset();\r\n\t},\r\n\r\n\t/**\r\n\t * Resets this hasher to its initial state.\r\n\t *\r\n\t * @example\r\n\t *\r\n\t * hasher.reset();\r\n\t */\r\n\treset: function () {\r\n\t\t// Reset data buffer\r\n\t\tBufferedBlockAlgorithm.reset.call(this);\r\n\r\n\t\t// Perform concrete-hasher logic\r\n\t\tthis._doReset();\r\n\t},\r\n\r\n\t/**\r\n\t * Updates this hasher with a message.\r\n\t *\r\n\t * @param {WordArray|string} messageUpdate The message to append.\r\n\t *\r\n\t * @return {Hasher} This hasher.\r\n\t *\r\n\t * @example\r\n\t *\r\n\t * hasher.update('message');\r\n\t * hasher.update(wordArray);\r\n\t */\r\n\tupdate: function (messageUpdate) {\r\n\t\t// Append\r\n\t\tthis._append(messageUpdate);\r\n\r\n\t\t// Update the hash\r\n\t\tthis._process();\r\n\r\n\t\t// Chainable\r\n\t\treturn this;\r\n\t},\r\n\r\n\t/**\r\n\t * Finalizes the hash computation.\r\n\t * Note that the finalize operation is effectively a destructive, read-once operation.\r\n\t *\r\n\t * @param {WordArray|string} messageUpdate (Optional) A final message update.\r\n\t *\r\n\t * @return {WordArray} The hash.\r\n\t *\r\n\t * @example\r\n\t *\r\n\t * var hash = hasher.finalize();\r\n\t * var hash = hasher.finalize('message');\r\n\t * var hash = hasher.finalize(wordArray);\r\n\t */\r\n\tfinalize: function (messageUpdate) {\r\n\t\t// Final message update\r\n\t\tif (messageUpdate) {\r\n\t\t\tthis._append(messageUpdate);\r\n\t\t}\r\n\r\n\t\t// Perform concrete-hasher logic\r\n\t\tvar hash = this._doFinalize();\r\n\r\n\t\treturn hash;\r\n\t},\r\n\r\n\tblockSize: 512/32,\r\n\r\n\t/**\r\n\t * Creates a shortcut function to a hasher's object interface.\r\n\t *\r\n\t * @param {Hasher} hasher The hasher to create a helper for.\r\n\t *\r\n\t * @return {Function} The shortcut function.\r\n\t *\r\n\t * @static\r\n\t *\r\n\t * @example\r\n\t *\r\n\t * var SHA256 = CryptoJS.lib.Hasher._createHelper(CryptoJS.algo.SHA256);\r\n\t */\r\n\t_createHelper: function (hasher) {\r\n\t\treturn function (message, cfg) {\r\n\t\t\treturn new hasher.init(cfg).finalize(message);\r\n\t\t};\r\n\t},\r\n\r\n\t/**\r\n\t * Creates a shortcut function to the HMAC's object interface.\r\n\t *\r\n\t * @param {Hasher} hasher The hasher to use in this HMAC helper.\r\n\t *\r\n\t * @return {Function} The shortcut function.\r\n\t *\r\n\t * @static\r\n\t *\r\n\t * @example\r\n\t *\r\n\t * var HmacSHA256 = CryptoJS.lib.Hasher._createHmacHelper(CryptoJS.algo.SHA256);\r\n\t */\r\n\t_createHmacHelper: function (hasher) {\r\n\t\treturn function (message, key) {\r\n\t\t\treturn new C_algo.HMAC.init(hasher, key).finalize(message);\r\n\t\t};\r\n\t}\r\n});\r\n\r\n/**\r\n * Algorithm namespace.\r\n */\r\nvar C_algo = C.algo = {};\r\n\r\nexport default C;\r\n","import Crypto from \"./core.js\";\r\n\r\n// Shortcuts\r\nvar C = Crypto;\r\nvar C_lib = C.lib;\r\nvar Base = C_lib.Base;\r\nvar C_enc = C.enc;\r\nvar Utf8 = C_enc.Utf8;\r\nvar C_algo = C.algo;\r\n\r\n/**\r\n * HMAC algorithm.\r\n */\r\nC_algo.HMAC = Base.extend({\r\n\t/**\r\n\t * Initializes a newly created HMAC.\r\n\t *\r\n\t * @param {Hasher} hasher The hash algorithm to use.\r\n\t * @param {WordArray|string} key The secret key.\r\n\t *\r\n\t * @example\r\n\t *\r\n\t * var hmacHasher = CryptoJS.algo.HMAC.create(CryptoJS.algo.SHA256, key);\r\n\t */\r\n\tinit: function (hasher, key) {\r\n\t\t// Init hasher\r\n\t\thasher = this._hasher = new hasher.init();\r\n\r\n\t\t// Convert string to WordArray, else assume WordArray already\r\n\t\tif (typeof key == 'string') {\r\n\t\t\tkey = Utf8.parse(key);\r\n\t\t}\r\n\r\n\t\t// Shortcuts\r\n\t\tvar hasherBlockSize = hasher.blockSize;\r\n\t\tvar hasherBlockSizeBytes = hasherBlockSize * 4;\r\n\r\n\t\t// Allow arbitrary length keys\r\n\t\tif (key.sigBytes > hasherBlockSizeBytes) {\r\n\t\t\tkey = hasher.finalize(key);\r\n\t\t}\r\n\r\n\t\t// Clamp excess bits\r\n\t\tkey.clamp();\r\n\r\n\t\t// Clone key for inner and outer pads\r\n\t\tvar oKey = this._oKey = key.clone();\r\n\t\tvar iKey = this._iKey = key.clone();\r\n\r\n\t\t// Shortcuts\r\n\t\tvar oKeyWords = oKey.words;\r\n\t\tvar iKeyWords = iKey.words;\r\n\r\n\t\t// XOR keys with pad constants\r\n\t\tfor (var i = 0; i < hasherBlockSize; i++) {\r\n\t\t\toKeyWords[i] ^= 0x5c5c5c5c;\r\n\t\t\tiKeyWords[i] ^= 0x36363636;\r\n\t\t}\r\n\t\toKey.sigBytes = iKey.sigBytes = hasherBlockSizeBytes;\r\n\r\n\t\t// Set initial values\r\n\t\tthis.reset();\r\n\t},\r\n\r\n\t/**\r\n\t * Resets this HMAC to its initial state.\r\n\t *\r\n\t * @example\r\n\t *\r\n\t * hmacHasher.reset();\r\n\t */\r\n\treset: function () {\r\n\t\t// Shortcut\r\n\t\tvar hasher = this._hasher;\r\n\r\n\t\t// Reset\r\n\t\thasher.reset();\r\n\t\thasher.update(this._iKey);\r\n\t},\r\n\r\n\t/**\r\n\t * Updates this HMAC with a message.\r\n\t *\r\n\t * @param {WordArray|string} messageUpdate The message to append.\r\n\t *\r\n\t * @return {HMAC} This HMAC instance.\r\n\t *\r\n\t * @example\r\n\t *\r\n\t * hmacHasher.update('message');\r\n\t * hmacHasher.update(wordArray);\r\n\t */\r\n\tupdate: function (messageUpdate) {\r\n\t\tthis._hasher.update(messageUpdate);\r\n\r\n\t\t// Chainable\r\n\t\treturn this;\r\n\t},\r\n\r\n\t/**\r\n\t * Finalizes the HMAC computation.\r\n\t * Note that the finalize operation is effectively a destructive, read-once operation.\r\n\t *\r\n\t * @param {WordArray|string} messageUpdate (Optional) A final message update.\r\n\t *\r\n\t * @return {WordArray} The HMAC.\r\n\t *\r\n\t * @example\r\n\t *\r\n\t * var hmac = hmacHasher.finalize();\r\n\t * var hmac = hmacHasher.finalize('message');\r\n\t * var hmac = hmacHasher.finalize(wordArray);\r\n\t */\r\n\tfinalize: function (messageUpdate) {\r\n\t\t// Shortcut\r\n\t\tvar hasher = this._hasher;\r\n\r\n\t\t// Compute HMAC\r\n\t\tvar innerHash = hasher.finalize(messageUpdate);\r\n\t\thasher.reset();\r\n\t\tvar hmac = hasher.finalize(this._oKey.clone().concat(innerHash));\r\n\r\n\t\treturn hmac;\r\n\t}\r\n});\r\n","import Crypto from \"./core.js\";\r\nimport \"./hmac.js\";\r\n\r\n// Shortcuts\r\nvar C = Crypto;\r\nvar C_lib = C.lib;\r\nvar WordArray = C_lib.WordArray;\r\nvar Hasher = C_lib.Hasher;\r\nvar C_algo = C.algo;\r\n\r\n// Initialization and round constants tables\r\nvar H = [];\r\nvar K = [];\r\n\r\n// Compute constants\r\n(function () {\r\n\tfunction isPrime(n) {\r\n\t\tvar sqrtN = Math.sqrt(n);\r\n\t\tfor (var factor = 2; factor <= sqrtN; factor++) {\r\n\t\t\tif (!(n % factor)) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn true;\r\n\t}\r\n\r\n\tfunction getFractionalBits(n) {\r\n\t\treturn ((n - (n | 0)) * 0x100000000) | 0;\r\n\t}\r\n\r\n\tvar n = 2;\r\n\tvar nPrime = 0;\r\n\twhile (nPrime < 64) {\r\n\t\tif (isPrime(n)) {\r\n\t\t\tif (nPrime < 8) {\r\n\t\t\t\tH[nPrime] = getFractionalBits(Math.pow(n, 1 / 2));\r\n\t\t\t}\r\n\t\t\tK[nPrime] = getFractionalBits(Math.pow(n, 1 / 3));\r\n\r\n\t\t\tnPrime++;\r\n\t\t}\r\n\r\n\t\tn++;\r\n\t}\r\n}());\r\n\r\n// Reusable object\r\nvar W = [];\r\n\r\n/**\r\n * SHA-256 hash algorithm.\r\n */\r\nvar SHA256Hasher = C_algo.SHA256 = Hasher.extend({\r\n\t_doReset: function () {\r\n\t\tthis._hash = new WordArray.init(H.slice(0));\r\n\t},\r\n\r\n\t_doProcessBlock: function (M, offset) {\r\n\t\t// Shortcut\r\n\t\tvar H = this._hash.words;\r\n\r\n\t\t// Working variables\r\n\t\tvar a = H[0];\r\n\t\tvar b = H[1];\r\n\t\tvar c = H[2];\r\n\t\tvar d = H[3];\r\n\t\tvar e = H[4];\r\n\t\tvar f = H[5];\r\n\t\tvar g = H[6];\r\n\t\tvar h = H[7];\r\n\r\n\t\t// Computation\r\n\t\tfor (var i = 0; i < 64; i++) {\r\n\t\t\tif (i < 16) {\r\n\t\t\t\tW[i] = M[offset + i] | 0;\r\n\t\t\t} else {\r\n\t\t\t\tvar gamma0x = W[i - 15];\r\n\t\t\t\tvar gamma0 = ((gamma0x << 25) | (gamma0x >>> 7)) ^\r\n\t\t\t\t\t\t\t\t((gamma0x << 14) | (gamma0x >>> 18)) ^\r\n\t\t\t\t\t\t\t\t(gamma0x >>> 3);\r\n\r\n\t\t\t\tvar gamma1x = W[i - 2];\r\n\t\t\t\tvar gamma1 = ((gamma1x << 15) | (gamma1x >>> 17)) ^\r\n\t\t\t\t\t\t\t\t((gamma1x << 13) | (gamma1x >>> 19)) ^\r\n\t\t\t\t\t\t\t\t(gamma1x >>> 10);\r\n\r\n\t\t\t\tW[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16];\r\n\t\t\t}\r\n\r\n\t\t\tvar ch = (e & f) ^ (~e & g);\r\n\t\t\tvar maj = (a & b) ^ (a & c) ^ (b & c);\r\n\r\n\t\t\tvar sigma0 = ((a << 30) | (a >>> 2)) ^ ((a << 19) | (a >>> 13)) ^ ((a << 10) | (a >>> 22));\r\n\t\t\tvar sigma1 = ((e << 26) | (e >>> 6)) ^ ((e << 21) | (e >>> 11)) ^ ((e << 7) | (e >>> 25));\r\n\r\n\t\t\tvar t1 = h + sigma1 + ch + K[i] + W[i];\r\n\t\t\tvar t2 = sigma0 + maj;\r\n\r\n\t\t\th = g;\r\n\t\t\tg = f;\r\n\t\t\tf = e;\r\n\t\t\te = (d + t1) | 0;\r\n\t\t\td = c;\r\n\t\t\tc = b;\r\n\t\t\tb = a;\r\n\t\t\ta = (t1 + t2) | 0;\r\n\t\t}\r\n\r\n\t\t// Intermediate hash value\r\n\t\tH[0] = (H[0] + a) | 0;\r\n\t\tH[1] = (H[1] + b) | 0;\r\n\t\tH[2] = (H[2] + c) | 0;\r\n\t\tH[3] = (H[3] + d) | 0;\r\n\t\tH[4] = (H[4] + e) | 0;\r\n\t\tH[5] = (H[5] + f) | 0;\r\n\t\tH[6] = (H[6] + g) | 0;\r\n\t\tH[7] = (H[7] + h) | 0;\r\n\t},\r\n\r\n\t_doFinalize: function () {\r\n\t\t// Shortcuts\r\n\t\tvar data = this._data;\r\n\t\tvar dataWords = data.words;\r\n\r\n\t\tvar nBitsTotal = this._nDataBytes * 8;\r\n\t\tvar nBitsLeft = data.sigBytes * 8;\r\n\r\n\t\t// Add padding\r\n\t\tdataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32);\r\n\t\tdataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = Math.floor(nBitsTotal / 0x100000000);\r\n\t\tdataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = nBitsTotal;\r\n\t\tdata.sigBytes = dataWords.length * 4;\r\n\r\n\t\t// Hash final blocks\r\n\t\tthis._process();\r\n\r\n\t\t// Return final computed hash\r\n\t\treturn this._hash;\r\n\t},\r\n\r\n\tclone: function () {\r\n\t\tvar clone = Hasher.clone.call(this);\r\n\t\tclone._hash = this._hash.clone();\r\n\r\n\t\treturn clone;\r\n\t}\r\n});\r\n\r\n/**\r\n * Shortcut function to the hasher's object interface.\r\n *\r\n * @param {WordArray|string} message The message to hash.\r\n *\r\n * @return {WordArray} The hash.\r\n *\r\n * @static\r\n *\r\n * @example\r\n *\r\n * var hash = CryptoJS.SHA256('message');\r\n * var hash = CryptoJS.SHA256(wordArray);\r\n */\r\nconst SHA256 = Hasher._createHelper(SHA256Hasher);\r\n\r\n/**\r\n * Shortcut function to the HMAC's object interface.\r\n *\r\n * @param {WordArray|string} message The message to hash.\r\n * @param {WordArray|string} key The secret key.\r\n *\r\n * @return {WordArray} The HMAC.\r\n *\r\n * @static\r\n *\r\n * @example\r\n *\r\n * var hmac = CryptoJS.HmacSHA256(message, key);\r\n */\r\nconst HmacSHA256 = Hasher._createHmacHelper(SHA256Hasher);\r\n\r\nexport { SHA256, HmacSHA256 };\r\n","/* eslint-disable new-cap */\r\nimport { SHA256, HmacSHA256 } from \"../crypto-es/sha256.js\";\r\n\r\nconst hash = (str) =>\r\n SHA256(str).toString();\r\n\r\nconst hmac = HmacSHA256;\r\n \r\nexport { hmac, hash };\r\n","\"use strict\";\r\n\r\n// Replace one extra character beyond what encodeURIComponent does, \"*\"\r\n// See https://github.com/aws/aws-sdk-js/blob/38bf84c144281f696768e8c64500f2847fe6f298/lib/util.js#L39-L49\r\nconst encode = (str) =>\r\n encodeURIComponent(str)\r\n .replace(/[*]/g, (x) =>\r\n // eslint-disable-next-line newline-per-chained-call\r\n `%${x.charCodeAt(0).toString(16).toUpperCase()}`\r\n );\r\n\r\nexport default encode;\r\n","import encode from \"../lib/encode.js\";\r\n\r\nconst sort = (a, b) => a.localeCompare(b);\r\n\r\n// Sort query parameters by key\r\n// Then also sort by value because AWS\r\nexport default ({ url }) => {\r\n const source = {};\r\n const params = [];\r\n \r\n url.searchParams.forEach((value, key) => {\r\n if(!source[key]) {\r\n source[key] = [];\r\n }\r\n\r\n source[key].push(value);\r\n });\r\n\r\n Object.keys(source)\r\n .sort(sort)\r\n .forEach((key) => {\r\n source[key]\r\n .sort(sort)\r\n .forEach((value) => {\r\n params.push(`${encode(key)}=${encode(value)}`);\r\n });\r\n });\r\n\r\n return params.join(\"&\");\r\n};\r\n","import encode from \"../lib/encode.js\";\r\n\r\nconst multipleSlashesRegex = /\\/\\/+/g;\r\n\r\nexport default ({ service, url }) => {\r\n // S3 doesn't use normalized paths at all\r\n if(service === \"s3\") {\r\n return url.pathname;\r\n }\r\n \r\n return url.pathname\r\n .replace(multipleSlashesRegex, \"/\")\r\n .split(\"/\")\r\n .map(encode)\r\n .join(\"/\");\r\n};\r\n","import { hash } from \"./hash.js\";\r\n\r\n// https://docs.aws.amazon.com/general/latest/gr/sigv4-create-string-to-sign.html\r\nexport default ({ algorithm, date, region, service }, canonical) => [\r\n // Signing Function\r\n algorithm,\r\n \r\n // Date Time\r\n date.long,\r\n \r\n // Scope\r\n `${date.short}/${region}/${service}/aws4_request`,\r\n \r\n // Signed canonical request\r\n hash(canonical),\r\n ].join(\"\\n\");\r\n","const requestRequired = [\r\n \"url\",\r\n];\r\n\r\nconst configRequired = [\r\n \"accessKeyId\",\r\n \"region\",\r\n \"secretAccessKey\",\r\n \"service\",\r\n];\r\n\r\n// Check for required params\r\nconst validate = (source, config) => {\r\n if(!source) {\r\n throw new Error(`Missing request object`);\r\n }\r\n\r\n if(!config) {\r\n throw new Error(`Missing config object`);\r\n }\r\n\r\n let missing = requestRequired.filter((field) => !source[field]);\r\n\r\n if(missing.length) {\r\n throw new Error(`Missing required request fields: ${missing.join(\", \")}`);\r\n }\r\n \r\n missing = configRequired.filter((field) => !config[field]);\r\n\r\n if(missing.length) {\r\n throw new Error(`Missing required config fields: ${missing.join(\", \")}`);\r\n }\r\n};\r\n\r\nexport default validate;\r\n","const dateCleanRegex = /[:\\-]|\\.\\d{3}/g;\r\n\r\n// Doesn't use a default for the date param because false is a nonsense input\r\n// but wouldn't trigger to default value to be used instead\r\nconst xamzdate = (date) => (new Date(date || Date.now()))\r\n .toISOString()\r\n .replace(dateCleanRegex, \"\");\r\n\r\nexport default xamzdate;\r\n","import testing from \"consts:testing\";\r\n\r\nimport request from \"./request/request.js\";\r\nimport { sorted } from \"./request/headers.js\";\r\nimport stringToSign from \"./lib/stringtosign.js\";\r\nimport signature from \"./lib/signature.js\";\r\nimport validate from \"./lib/validate.js\";\r\nimport xamzdate from \"./lib/header-x-amz-date.js\";\r\n\r\nconst parseDate = ({ headers : { \"X-Amz-Date\" : amzdate, Date : date } }) => {\r\n const datetime = amzdate ?\r\n amzdate :\r\n xamzdate(date);\r\n\r\n return {\r\n short : datetime.split(\"T\")[0],\r\n long : datetime,\r\n };\r\n};\r\n\r\n// eslint-disable-next-line max-statements\r\nconst sign = (source, config, { before, after }) => {\r\n validate(source, config);\r\n\r\n if(!source.headers) {\r\n source.headers = {};\r\n }\r\n\r\n let details = Object.assign(\r\n Object.create(null),\r\n {\r\n method : \"GET\",\r\n },\r\n source,\r\n config,\r\n {\r\n url : new URL(source.url),\r\n algorithm : \"AWS4-HMAC-SHA256\",\r\n date : parseDate(source),\r\n sortedHeaders : sorted(source),\r\n }\r\n );\r\n\r\n details = before(details);\r\n\r\n const canonical = request(details);\r\n const sts = stringToSign(details, canonical);\r\n const sig = signature(details, sts);\r\n\r\n details.signed = {\r\n canonical,\r\n stringToSign,\r\n signature : sig,\r\n };\r\n\r\n // Add partial output to response for tests so each step can be validated\r\n /* istanbul ignore next */\r\n if(testing) {\r\n details.test = {\r\n canonical,\r\n sts,\r\n };\r\n }\r\n \r\n details = after(details);\r\n\r\n const out = {\r\n url : details.url.toString(),\r\n headers : details.headers,\r\n method : details.method,\r\n body : details.body,\r\n };\r\n\r\n /* istanbul ignore next */\r\n if(testing) {\r\n out.test = details.test;\r\n }\r\n\r\n return out;\r\n};\r\n\r\nexport default sign;\r\n","import { hash } from \"../lib/hash.js\";\r\n\r\nimport query from \"./query.js\";\r\nimport { values, signed } from \"./headers.js\";\r\nimport path from \"./path.js\";\r\n\r\nexport default (req) => {\r\n const { method, body, sortedHeaders } = req;\r\n\r\n // https://docs.aws.amazon.com/general/latest/gr/sigv4-create-canonical-request.html\r\n return [\r\n method.toUpperCase(),\r\n \r\n // Canonical Path\r\n path(req),\r\n \r\n // Canonical Query\r\n query(req),\r\n \r\n // Canonical Headers\r\n values(sortedHeaders),\r\n\r\n // Extra linebreak\r\n \"\",\r\n\r\n // Signed Headers\r\n signed(sortedHeaders),\r\n\r\n // Hashed payload\r\n hash(typeof body === \"string\" ? body.trim() : body),\r\n ].join(\"\\n\");\r\n};\r\n","import { hmac } from \"./hash.js\";\r\n\r\n// https://docs.aws.amazon.com/general/latest/gr/sigv4-calculate-signature.html\r\nexport default ({ date, secretAccessKey, region, service }, sts) => {\r\n const kDate = hmac(date.short, `AWS4${secretAccessKey}`);\r\n const kRegion = hmac(region, kDate);\r\n const kService = hmac(service, kRegion);\r\n const kSignature = hmac(\"aws4_request\", kService);\r\n\r\n return hmac(sts, kSignature);\r\n};\r\n","import testing from \"consts:testing\";\r\n\r\nimport { signed } from \"./request/headers.js\";\r\nimport credential from \"./lib/credential.js\";\r\n\r\nimport sign from \"./sign.js\";\r\n\r\nconst authorization = (details) => {\r\n const {\r\n algorithm,\r\n sortedHeaders,\r\n signed : { signature },\r\n } = details;\r\n\r\n return [\r\n `${algorithm} Credential=${credential(details)}`,\r\n `SignedHeaders=${signed(sortedHeaders)}`,\r\n `Signature=${signature}`,\r\n ].join(\", \");\r\n};\r\n\r\n// NO-OP\r\nconst before = (details) => details;\r\n\r\nconst after = (details) => {\r\n const auth = authorization(details);\r\n\r\n details.headers[\"X-Amz-Date\"] = details.date.long;\r\n \r\n if(details.sessionToken) {\r\n details.headers[\"X-Amz-Security-Token\"] = details.sessionToken;\r\n }\r\n \r\n details.headers.Authorization = auth;\r\n\r\n // Add partial output to response for tests so each step can be validated\r\n /* istanbul ignore next */\r\n if(testing) {\r\n details.test.auth = auth;\r\n }\r\n\r\n return details;\r\n};\r\n\r\nconst signedHeaders = (source, config) => sign(source, config, { before, after });\r\n\r\nexport {\r\n signedHeaders,\r\n};\r\n","import { sorted } from \"./request/headers.js\";\r\nimport encode from \"./lib/encode.js\";\r\nimport credential from \"./lib/credential.js\";\r\n\r\nimport sign from \"./sign.js\";\r\n\r\nconst before = (details) => {\r\n const { url } = details;\r\n\r\n // Query param signatures always have a host header\r\n details.headers.host = url.host;\r\n\r\n // Need to update sortedHeaders after shoving in a host header\r\n details.sortedHeaders = sorted(details);\r\n\r\n const query = [\r\n [ \"X-Amz-Algorithm\", details.algorithm ],\r\n [ \"X-Amz-Credential\", credential(details) ],\r\n [ \"X-Amz-Date\", details.date.long ],\r\n\r\n details.sessionToken ?\r\n [ \"X-Amz-Security-Token\", details.sessionToken ] :\r\n false,\r\n\r\n [ \"X-Amz-SignedHeaders\", details.sortedHeaders.map(([ header ]) => header).join(\",\") ],\r\n ]\r\n .filter(Boolean)\r\n .map(([ key, value ]) => `${key}=${encode(value)}`)\r\n .join(\"&\");\r\n\r\n url.search = url.search.length ?\r\n `${url.search}&${query}` :\r\n query;\r\n \r\n return details;\r\n};\r\n\r\nconst after = (details) => {\r\n const { url, signed } = details;\r\n\r\n const sigparam = `X-Amz-Signature=${encode(signed.signature)}`;\r\n\r\n url.search = `${url.search}&${sigparam}`;\r\n\r\n details.url = url.toString();\r\n\r\n return details;\r\n};\r\n\r\nconst signedQuery = (source, config) => sign(source, config, { before, after });\r\n\r\nexport {\r\n signedQuery,\r\n};\r\n"],"names":["const","trim","val","toString","replace","signed","headers","map","ref","join","sorted","Object","keys","key","toLowerCase","sort","ref$1","keya","localeCompare","keyb","credential","req","accessKeyId","date","region","service","create","F","obj","subtype","prototype","C","C_lib","lib","Base","extend","overrides","this","mixIn","hasOwnProperty","init","$super","apply","arguments","instance","properties","propertyName","clone","WordArray","words","sigBytes","undefined","length","encoder","Hex","stringify","concat","wordArray","thisWords","thatWords","thisSigBytes","thatSigBytes","clamp","i","thatByte","Math","ceil","call","slice","random","nBytes","rcache","r","m_w","m_z","mask","result","_r","push","C_enc","enc","hexChars","bite","parse","hexStr","hexStrLength","parseInt","substr","Latin1","latin1Chars","String","fromCharCode","latin1Str","latin1StrLength","charCodeAt","Utf8","decodeURIComponent","escape","e","Error","utf8Str","unescape","encodeURIComponent","BufferedBlockAlgorithm","reset","_data","_nDataBytes","_append","data","_process","doFlush","dataWords","dataSigBytes","blockSize","nBlocksReady","nWordsReady","max","_minBufferSize","nBytesReady","min","offset","_doProcessBlock","processedWords","splice","Hasher","cfg","_doReset","update","messageUpdate","finalize","_doFinalize","_createHelper","hasher","message","_createHmacHelper","C_algo","HMAC","algo","Crypto","_hasher","hasherBlockSize","hasherBlockSizeBytes","oKey","_oKey","iKey","_iKey","oKeyWords","iKeyWords","innerHash","H","K","isPrime","n","sqrtN","sqrt","factor","getFractionalBits","nPrime","pow","W","SHA256Hasher","SHA256","_hash","M","a","b","c","d","f","g","h","gamma0x","gamma0","gamma1x","gamma1","maj","sigma0","t1","nBitsTotal","nBitsLeft","floor","HmacSHA256","hash","str","hmac","encode","x","toUpperCase","source","params","url","searchParams","forEach","value","multipleSlashesRegex","canonical","algorithm","long","requestRequired","configRequired","dateCleanRegex","xamzdate","Date","now","toISOString","parseDate","datetime","amzdate","short","split","sign","config","let","missing","filter","field","validate","details","assign","method","URL","sortedHeaders","pathname","query","Array","isArray","vals","body","request","before","sig","sts","kDate","secretAccessKey","kRegion","kService","kSignature","signature","stringToSign","after","auth","authorization","sessionToken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,CAAE,mBAAoBhL,EAAWqM,IACjC,CAAE,aAAcA,EAAQlM,KAAK8K,QAE7BoB,EAAQyB,cACJ,CAAE,uBAAwBzB,EAAQyB,cAGtC,CAAE,sBAAuBzB,EAAQI,cAActN,cAAKC,kBAAuBC,KAAK,OAEnF6M,OAAO+B,SACP9O,cAAKC,4BAAsBK,MAAO4K,EAAOQ,MACzCxL,KAAK,KAMN,OAJAqL,EAAIwD,OAASxD,EAAIwD,OAAOlM,OACjB0I,aAAciC,EACjBA,EAEGN,GAGLsB,WAAStB,GACX,uBAEM8B,EAAW,mBAAmB9D,EAAOpL,EAAOwO,WAMlD,OAJA/C,EAAIwD,OAAYxD,aAAcyD,EAE9B9B,EAAQ3B,IAAMA,EAAI3L,WAEXsN,+CDFY7B,EAAQuB,UAAWD,EAAKtB,EAAQuB,EAAQ,QAAEkB,QAAQU,4BCKpDnD,EAAQuB,UAAWD,EAAKtB,EAAQuB,EAAQ,QAAEkB,QAAQU"} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index c5a3568..374cc0d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "aws-sig", - "version": "2.0.1", + "version": "2.1.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 6f5a174..32e7e4b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "aws-sig", - "version": "2.0.1", + "version": "2.1.0", "description": "AWS sigv4 signing, optimized for size", "author": "Pat Cavit ", "license": "MIT",