( key: string, dateStamp: string, regionName: string, serviceName: string )
| 5 | } |
| 6 | |
| 7 | export function getSignatureKey( |
| 8 | key: string, |
| 9 | dateStamp: string, |
| 10 | regionName: string, |
| 11 | serviceName: string |
| 12 | ): Buffer { |
| 13 | if (!key || typeof key !== 'string') { |
| 14 | throw new Error('Invalid key provided to getSignatureKey') |
| 15 | } |
| 16 | const kDate = crypto.createHmac('sha256', `AWS4${key}`).update(dateStamp).digest() |
| 17 | const kRegion = crypto.createHmac('sha256', kDate).update(regionName).digest() |
| 18 | const kService = crypto.createHmac('sha256', kRegion).update(serviceName).digest() |
| 19 | const kSigning = crypto.createHmac('sha256', kService).update('aws4_request').digest() |
| 20 | return kSigning |
| 21 | } |
| 22 | |
| 23 | export function parseS3Uri( |
| 24 | s3Uri: string, |
no outgoing calls
no test coverage detected