@alipay/faas-server-sdk
Advanced tools
Comparing version 0.0.24 to 0.0.25
@@ -7,5 +7,6 @@ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.SignOptions=exports.sign=void 0;const node_crypto_1=require("node:crypto");function sign(e){const s=e.signedHeaders.join(",");let t="";for(const a of e.signedHeaders){const u=e.headers[a];t+=`${a}:${u} | ||
`+s+` | ||
`+n,r="HMAC-SHA256",c=getHash(d),h=`${r} | ||
`+n+` | ||
`,r="HMAC-SHA256",c=getHash(d),h=`${r} | ||
${e.timestamp} | ||
${c} | ||
`,i=sha256(h,e.secretKey);return`${r} Credential=${e.secretId}, SignedHeaders=${s}, Signature=${i}`}exports.sign=sign;function sha256(e,s=""){return(0,node_crypto_1.createHmac)("sha256",s).update(e).digest("hex")}function getHash(e){return(0,node_crypto_1.createHash)("sha256").update(e).digest("hex")}class SignOptions{path;query;secretId;secretKey;method;body;headers;timestamp;signedHeaders;constructor(s){this.secretId=s.secretId,this.secretKey=s.secretKey,this.method=s.method,this.headers=s.headers,this.timestamp=s.timestamp,this.body=s.body,this.signedHeaders=s.signedHeaders}}exports.SignOptions=SignOptions; |
{ | ||
"name": "@alipay/faas-server-sdk", | ||
"version": "0.0.24", | ||
"version": "0.0.25", | ||
"description": "云函数服务 SDK", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
53961
513