1.0.5 • Published 1 year ago

wind-api-signature v1.0.5

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

Api 签名工具

const API_SIGNER = ApiRequestSinger.hmacSha256(
    { accessId: 'xxx', secretKey:'xxx' },
    { headerPrefix: 'xxx', debug: false },
);

/**
 * 接口签名
 * @param method
 * @param url
 * @param queryParams
 * @param requestBody
 * @param contentType
 * @returns
 */
const signature = (method: any, url: any, queryParams: any, requestBody: any, contentType: any) => {
    const result = API_SIGNER.sign({
        method,
        requestPath: url,
        queryParams: queryParams,
        requestBody: serializeSignRequestBody(requestBody, contentType),
    });
    return {
        ...result
    };
};
1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0-beta

1 year ago

1.0.0

1 year ago