@casual-simulation/aux-records
Advanced tools
Comparing version 2.0.23 to 2.0.27
{ | ||
"name": "@casual-simulation/aux-records", | ||
"version": "2.0.23", | ||
"version": "2.0.27", | ||
"description": "Helpers and managers used by the CasualOS records system.", | ||
@@ -44,3 +44,3 @@ "keywords": [], | ||
}, | ||
"gitHead": "6b57a83ce4a3bbe71f8a872eb2d1c0a997f8d873" | ||
"gitHead": "e4feca4722894119ef9c5ffdf0d35989184122f4" | ||
} |
@@ -38,2 +38,3 @@ /** | ||
export declare function createAWS4Signature(stringToSign: string, secretAccessKey: string, date: Date, region: string, service: string): string; | ||
export declare function createSigningKey(secretAccessKey: string, date: Date, region: string, service: string, enc?: 'hex'): string; | ||
/** | ||
@@ -40,0 +41,0 @@ * Creates a canonical request string that can be used to create a AWS Signature for the given request. |
10
Utils.js
@@ -76,2 +76,6 @@ import { fromByteArray, toByteArray } from 'base64-js'; | ||
export function createAWS4Signature(stringToSign, secretAccessKey, date, region, service) { | ||
const final = createHmac(createSigningKey(secretAccessKey, date, region, service), stringToSign, 'hex'); | ||
return final; | ||
} | ||
export function createSigningKey(secretAccessKey, date, region, service, enc) { | ||
const dateString = date.getUTCFullYear() + | ||
@@ -83,5 +87,4 @@ padStart((1 + date.getUTCMonth()).toString(), 2, '0') + | ||
const dateRegionServiceKey = createHmac(dateRegionKey, service); | ||
const signingKey = createHmac(dateRegionServiceKey, 'aws4_request'); | ||
const final = createHmac(signingKey, stringToSign, 'hex'); | ||
return final; | ||
const signingKey = createHmac(dateRegionServiceKey, 'aws4_request', enc); | ||
return signingKey; | ||
} | ||
@@ -134,2 +137,3 @@ function createHmac(key, data, enc) { | ||
} | ||
str += '\n'; | ||
str += | ||
@@ -136,0 +140,0 @@ headerNames.map(([name, encodedName]) => encodedName).join(';') + '\n'; |
Sorry, the diff of this file is not supported yet
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
75464
1372