alipay-sdk
Advanced tools
Comparing version 4.6.0 to 4.7.0
@@ -0,1 +1,2 @@ | ||
import { IncomingHttpHeaders } from 'urllib'; | ||
import type { HttpMethod, RawResponseWithMeta } from 'urllib'; | ||
@@ -15,2 +16,3 @@ import { AlipayFormStream } from './AlipayFormStream.js'; | ||
responseDataRaw?: string; | ||
responseHttpHeaders?: IncomingHttpHeaders; | ||
links?: AlipayRequestErrorSupportLink[]; | ||
@@ -23,2 +25,3 @@ } | ||
responseDataRaw?: string; | ||
responseHttpHeaders?: IncomingHttpHeaders; | ||
links?: AlipayRequestErrorSupportLink[]; | ||
@@ -25,0 +28,0 @@ constructor(message: string, options?: AlipayRequestErrorOptions); |
@@ -23,4 +23,8 @@ /// <reference types="node" /> | ||
export declare function sign(method: string, params: Record<string, any>, config: Required<AlipaySdkConfig>): Record<string, any>; | ||
/** OpenAPI 3.0 签名,使用应用私钥签名 */ | ||
export declare function signatureV3(signString: string, appPrivateKey: string): string; | ||
/** OpenAPI 3.0 验签,使用支付宝公钥验证签名 */ | ||
export declare function verifySignatureV3(signString: string, expectedSignature: string, alipayPublicKey: string): boolean; | ||
export declare function createRequestId(): string; | ||
export declare function readableToBytes(stream: Readable | ReadableStream): Promise<Buffer>; | ||
export declare function decamelize(text: string): string; |
@@ -6,3 +6,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.decamelize = exports.readableToBytes = exports.createRequestId = exports.sign = exports.aesDecrypt = exports.aesEncrypt = exports.aesDecryptText = exports.aesEncryptText = exports.ALIPAY_ALGORITHM_MAPPING = void 0; | ||
exports.decamelize = exports.readableToBytes = exports.createRequestId = exports.verifySignatureV3 = exports.signatureV3 = exports.sign = exports.aesDecrypt = exports.aesEncrypt = exports.aesDecryptText = exports.aesEncryptText = exports.ALIPAY_ALGORITHM_MAPPING = void 0; | ||
const node_util_1 = require("node:util"); | ||
@@ -122,2 +122,16 @@ const node_crypto_1 = require("node:crypto"); | ||
exports.sign = sign; | ||
/** OpenAPI 3.0 签名,使用应用私钥签名 */ | ||
function signatureV3(signString, appPrivateKey) { | ||
return (0, node_crypto_1.createSign)('RSA-SHA256') | ||
.update(signString, 'utf-8') | ||
.sign(appPrivateKey, 'base64'); | ||
} | ||
exports.signatureV3 = signatureV3; | ||
/** OpenAPI 3.0 验签,使用支付宝公钥验证签名 */ | ||
function verifySignatureV3(signString, expectedSignature, alipayPublicKey) { | ||
return (0, node_crypto_1.createVerify)('RSA-SHA256') | ||
.update(signString, 'utf-8') | ||
.verify(alipayPublicKey, expectedSignature, 'base64'); | ||
} | ||
exports.verifySignatureV3 = verifySignatureV3; | ||
function createRequestId() { | ||
@@ -176,2 +190,2 @@ return (0, node_crypto_1.randomUUID)().replaceAll('-', ''); | ||
/* c8 ignore stop */ | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXRpbC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlsLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7OztBQUFBLHlDQUFxQztBQUNyQyw2Q0FBcUQ7QUFHckQscUNBQXlDO0FBQ3pDLG9FQUEyQztBQUMzQywwREFBaUM7QUFHakMsTUFBTSxLQUFLLEdBQUcsSUFBQSxvQkFBUSxFQUFDLGlCQUFpQixDQUFDLENBQUM7QUFFN0IsUUFBQSx3QkFBd0IsR0FBRztJQUN0QyxHQUFHLEVBQUUsVUFBVTtJQUNmLElBQUksRUFBRSxZQUFZO0NBQ25CLENBQUM7QUFFRiwwRkFBMEY7QUFDMUYsMERBQTBEO0FBQzFELHNIQUFzSDtBQUN0SCxNQUFNLEVBQUUsR0FBRyxtQkFBUSxDQUFDLEdBQUcsQ0FBQyxHQUFHLENBQUMsS0FBSyxDQUFDLGtDQUFrQyxDQUFDLENBQUM7QUFFdEUsU0FBUyxRQUFRLENBQUMsTUFBYztJQUM5QixPQUFPO1FBQ0wsRUFBRS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SxDQUFDLEVBQUUsR0FBRyxTQUFTLEdBQUcsRUFBRSxDQUFDLFdBQVcsRUFBRSxDQUNqRCxDQUFDO0FBQ0osQ0FBQztBQUNELG9CQUFvQiJ9 |
@@ -0,1 +1,2 @@ | ||
import { IncomingHttpHeaders } from 'urllib'; | ||
import type { HttpMethod, RawResponseWithMeta } from 'urllib'; | ||
@@ -15,2 +16,3 @@ import { AlipayFormStream } from './AlipayFormStream.js'; | ||
responseDataRaw?: string; | ||
responseHttpHeaders?: IncomingHttpHeaders; | ||
links?: AlipayRequestErrorSupportLink[]; | ||
@@ -23,2 +25,3 @@ } | ||
responseDataRaw?: string; | ||
responseHttpHeaders?: IncomingHttpHeaders; | ||
links?: AlipayRequestErrorSupportLink[]; | ||
@@ -25,0 +28,0 @@ constructor(message: string, options?: AlipayRequestErrorOptions); |
@@ -23,4 +23,8 @@ /// <reference types="node" resolution-mode="require"/> | ||
export declare function sign(method: string, params: Record<string, any>, config: Required<AlipaySdkConfig>): Record<string, any>; | ||
/** OpenAPI 3.0 签名,使用应用私钥签名 */ | ||
export declare function signatureV3(signString: string, appPrivateKey: string): string; | ||
/** OpenAPI 3.0 验签,使用支付宝公钥验证签名 */ | ||
export declare function verifySignatureV3(signString: string, expectedSignature: string, alipayPublicKey: string): boolean; | ||
export declare function createRequestId(): string; | ||
export declare function readableToBytes(stream: Readable | ReadableStream): Promise<Buffer>; | ||
export declare function decamelize(text: string): string; |
import { debuglog } from 'node:util'; | ||
import { createSign, randomUUID } from 'node:crypto'; | ||
import { createSign, createVerify, randomUUID } from 'node:crypto'; | ||
import { YYYYMMDDHHmmss } from 'utility'; | ||
@@ -110,2 +110,14 @@ import snakeCaseKeys from 'snakecase-keys'; | ||
} | ||
/** OpenAPI 3.0 签名,使用应用私钥签名 */ | ||
export function signatureV3(signString, appPrivateKey) { | ||
return createSign('RSA-SHA256') | ||
.update(signString, 'utf-8') | ||
.sign(appPrivateKey, 'base64'); | ||
} | ||
/** OpenAPI 3.0 验签,使用支付宝公钥验证签名 */ | ||
export function verifySignatureV3(signString, expectedSignature, alipayPublicKey) { | ||
return createVerify('RSA-SHA256') | ||
.update(signString, 'utf-8') | ||
.verify(alipayPublicKey, expectedSignature, 'base64'); | ||
} | ||
export function createRequestId() { | ||
@@ -161,2 +173,2 @@ return randomUUID().replaceAll('-', ''); | ||
/* c8 ignore stop */ | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXRpbC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlsLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxRQUFRLEVBQUUsTUFBTSxXQUFXLENBQUM7QUFDckMsT0FBTyxFQUFFLFVBQVUsRUFBRSxVQUFVLEVBQUUsTUFBTSxhQUFhLENBQUM7QUFHckQsT0FBTyxFQUFFLGNBQWMsRUFBRSxNQUFNLFNBQVMsQ0FBQztBQUN6QyxPQUFPLGFBQWEsTUFBTSxnQkFBZ0IsQ0FBQztBQUMzQyxPQUFPLFFBQVEsTUFBTSxXQUFXLENBQUM7QUFHakMsTUFBTSxLQUFLLEdBQUcsUUFBUSxDQUFDLGlCQUFpQixDQUFDLENBQUM7QUFFMUMsTUFBTSxDQUFDLE1BQU0sd0JBQXdCLEdBQUc7SUFDdEMsR0FBRyxFQUFFLFVBQVU7SUFDZixJQUFJLEVBQUUsWUFBWTtDQUNuQixDQUFDO0FBRUYsMEZBQTBGO0FBQzFGLDBEQUEwRDtBQUMxRCxzSEFBc0g7QUFDdEgsTUFBTSxFQUFFLEdBQUcsUUFBUSxDQUFDLEdBQUcsQ0FBQyxHQUFHLENBQUMsS0FBSyxDQUFDLGtDQUFrQyxDQUFDLENBQUM7QUFFdEUsU0FBUyxRQUFRLENBQUMsTUFBYztJQUM5QixPQUFPO1FBQ0wsRUFBRSxFQUFFLEVBQUU7UUFDTixHQUFHLEVBQUUsUUF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QUNKLENBQUM7QUFDRCxvQkFBb0IifQ== |
{ | ||
"name": "alipay-sdk", | ||
"version": "4.6.0", | ||
"version": "4.7.0", | ||
"engines": { | ||
@@ -59,2 +59,3 @@ "node": ">=18.0.0" | ||
"import": { | ||
"source": "./src/index.ts", | ||
"types": "./dist/esm/index.d.ts", | ||
@@ -64,2 +65,3 @@ "default": "./dist/esm/index.js" | ||
"require": { | ||
"source": "./src/index.ts", | ||
"types": "./dist/commonjs/index.d.ts", | ||
@@ -66,0 +68,0 @@ "default": "./dist/commonjs/index.js" |
import { debuglog } from 'node:util'; | ||
import { createVerify, randomUUID, createSign } from 'node:crypto'; | ||
import { createVerify, randomUUID } from 'node:crypto'; | ||
import { Readable } from 'node:stream'; | ||
import urllib, { Agent } from 'urllib'; | ||
import urllib, { Agent, IncomingHttpHeaders } from 'urllib'; | ||
import type { | ||
@@ -18,2 +18,3 @@ HttpClientResponse, HttpMethod, RequestOptions, RawResponseWithMeta, | ||
aesDecryptText, | ||
signatureV3, verifySignatureV3, | ||
} from './util.js'; | ||
@@ -42,2 +43,3 @@ import { getSNFromPath, getSN, loadPublicKey, loadPublicKeyFromPath } from './antcertutil.js'; | ||
responseDataRaw?: string; | ||
responseHttpHeaders?: IncomingHttpHeaders; | ||
links?: AlipayRequestErrorSupportLink[]; | ||
@@ -51,2 +53,3 @@ } | ||
responseDataRaw?: string; | ||
responseHttpHeaders?: IncomingHttpHeaders; | ||
links?: AlipayRequestErrorSupportLink[]; | ||
@@ -62,2 +65,3 @@ | ||
this.responseHttpStatus = options?.responseHttpStatus; | ||
this.responseHttpHeaders = options?.responseHttpHeaders; | ||
this.responseDataRaw = options?.responseDataRaw; | ||
@@ -334,8 +338,14 @@ this.links = options?.links; | ||
}; | ||
// 默认需要对响应做验签,确保响应是由支付宝返回的 | ||
let validateResponseSignature = true; | ||
if (dataType === 'stream') { | ||
// 使用 HTTP/2 请求才支持流式响应 | ||
requestOptions.dispatcher = http2Agent; | ||
// 流式响应不需要对响应做验签 | ||
validateResponseSignature = false; | ||
} | ||
if (validateResponseSignature && !this.config.alipayPublicKey) { | ||
throw new TypeError('请确保支付宝公钥 config.alipayPublicKey 已经配置,需要使用它对响应进行验签'); | ||
} | ||
const requestId = options?.requestId ?? createRequestId(); | ||
requestOptions.headers = { | ||
@@ -446,7 +456,5 @@ 'user-agent': this.version, | ||
} | ||
const signature = createSign('RSA-SHA256') | ||
.update(signString, 'utf-8') | ||
.sign(this.config.privateKey, 'base64'); | ||
const signature = signatureV3(signString, this.config.privateKey); | ||
const authorization = `ALIPAY-SHA256withRSA ${authString},sign=${signature}`; | ||
debug('signString: \n--------\n%s\n--------\n, authorization: %o', signString, authorization); | ||
debug('signString: \n--------\n%s\n--------\nauthorization: %o', signString, authorization); | ||
requestOptions.headers.authorization = authorization; | ||
@@ -488,2 +496,3 @@ debug('curl %s %s, with body: %s, headers: %j, dataType: %s', | ||
responseHttpStatus: httpResponse.status, | ||
responseHttpHeaders: httpResponse.headers, | ||
traceId, | ||
@@ -500,6 +509,34 @@ }); | ||
} | ||
let responseDataText = httpResponse.data as string; | ||
let httpResponseBody = httpResponse.data as string; | ||
// 对支付宝响应进行验签 https://opendocs.alipay.com/open-v3/054d0z?pathHash=dcad8d5c | ||
if (validateResponseSignature) { | ||
const headers = httpResponse.headers; | ||
const responseSignString = `${headers['alipay-timestamp']}\n${headers['alipay-nonce']}\n${httpResponseBody}\n`; | ||
const expectedSignature = headers['alipay-signature'] as string; | ||
const expectedAlipaySN = headers['alipay-sn'] as string; | ||
if (expectedAlipaySN && this.config.alipayCertSn && expectedAlipaySN !== this.config.alipayCertSn) { | ||
throw new AlipayRequestError(`支付宝公钥证书号不匹配,服务端返回的是:${expectedAlipaySN},SDK 配置的是:${this.config.alipayCertSn}`, { | ||
code: 'response-alipay-sn-verify-error', | ||
responseDataRaw: httpResponse.data, | ||
responseHttpStatus: httpResponse.status, | ||
responseHttpHeaders: httpResponse.headers, | ||
traceId, | ||
}); | ||
} | ||
debug('responseSignString: \n--------\n%s\n--------\nexpectedSignature: %o', responseSignString, expectedSignature); | ||
if (!verifySignatureV3(responseSignString, expectedSignature, this.config.alipayPublicKey)) { | ||
throw new AlipayRequestError(`支付宝响应验签失败,请确保支付宝公钥 config.alipayPublicKey 是最新有效版本,签名字符串为:${expectedSignature},验证字符串为:${JSON.stringify(responseSignString)}`, { | ||
code: 'response-signature-verify-error', | ||
responseDataRaw: httpResponse.data, | ||
responseHttpStatus: httpResponse.status, | ||
responseHttpHeaders: httpResponse.headers, | ||
traceId, | ||
}); | ||
} | ||
} | ||
if (options?.needEncrypt) { | ||
responseDataText = aesDecryptText(responseDataText, this.config.encryptKey); | ||
if (!responseDataText) { | ||
httpResponseBody = aesDecryptText(httpResponseBody, this.config.encryptKey); | ||
if (!httpResponseBody) { | ||
throw new AlipayRequestError('解密失败,请确认 config.encryptKey 设置正确', { | ||
@@ -509,2 +546,3 @@ code: 'decrypt-error', | ||
responseHttpStatus: httpResponse.status, | ||
responseHttpHeaders: httpResponse.headers, | ||
traceId, | ||
@@ -515,3 +553,3 @@ }); | ||
return { | ||
data: JSON.parse(responseDataText), | ||
data: JSON.parse(httpResponseBody), | ||
responseHttpStatus: httpResponse.status, | ||
@@ -518,0 +556,0 @@ traceId, |
import { debuglog } from 'node:util'; | ||
import { createSign, randomUUID } from 'node:crypto'; | ||
import { createSign, createVerify, randomUUID } from 'node:crypto'; | ||
import type { Readable } from 'node:stream'; | ||
@@ -128,2 +128,16 @@ import type { ReadableStream } from 'node:stream/web'; | ||
/** OpenAPI 3.0 签名,使用应用私钥签名 */ | ||
export function signatureV3(signString: string, appPrivateKey: string) { | ||
return createSign('RSA-SHA256') | ||
.update(signString, 'utf-8') | ||
.sign(appPrivateKey, 'base64'); | ||
} | ||
/** OpenAPI 3.0 验签,使用支付宝公钥验证签名 */ | ||
export function verifySignatureV3(signString: string, expectedSignature: string, alipayPublicKey: string) { | ||
return createVerify('RSA-SHA256') | ||
.update(signString, 'utf-8') | ||
.verify(alipayPublicKey, expectedSignature, 'base64'); | ||
} | ||
export function createRequestId() { | ||
@@ -130,0 +144,0 @@ return randomUUID().replaceAll('-', ''); |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
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
301439
4421