Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@aws-sdk/middleware-signing

Package Overview
Dependencies
Maintainers
5
Versions
192
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aws-sdk/middleware-signing - npm Package Compare versions

Comparing version 3.6.1 to 3.8.1

11

CHANGELOG.md

@@ -6,2 +6,13 @@ # Change Log

## [3.8.1](https://github.com/aws/aws-sdk-js-v3/compare/v3.8.0...v3.8.1) (2021-03-11)
### Bug Fixes
* **middleware-signing:** memoize temporary credentials ([#2109](https://github.com/aws/aws-sdk-js-v3/issues/2109)) ([cf238b9](https://github.com/aws/aws-sdk-js-v3/commit/cf238b931ee5c0514246832e9e2e36a9173e1f05))
## [3.6.1](https://github.com/aws/aws-sdk-js-v3/compare/v3.6.0...v3.6.1) (2021-02-22)

@@ -8,0 +19,0 @@

25

dist/cjs/configurations.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.resolveAwsAuthConfig = void 0;
const property_provider_1 = require("@aws-sdk/property-provider");
const signature_v4_1 = require("@aws-sdk/signature-v4");
function resolveAwsAuthConfig(input) {
const credentials = input.credentials || input.credentialDefaultProvider(input);
const normalizedCreds = normalizeProvider(credentials);
// 5 minutes buffer time the refresh the credential before it really expires
const CREDENTIAL_EXPIRE_WINDOW = 300000;
const resolveAwsAuthConfig = (input) => {
const normalizedCreds = input.credentials
? normalizeCredentialProvider(input.credentials)
: input.credentialDefaultProvider(input);
const { signingEscapePath = true, systemClockOffset = input.systemClockOffset || 0, sha256 } = input;

@@ -42,5 +46,5 @@ let signer;

};
}
};
exports.resolveAwsAuthConfig = resolveAwsAuthConfig;
function normalizeProvider(input) {
const normalizeProvider = (input) => {
if (typeof input === "object") {

@@ -51,3 +55,10 @@ const promisified = Promise.resolve(input);

return input;
}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29uZmlndXJhdGlvbnMuan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0gUHJvbWlzZS5yZXNvbHZlKGlucHV0KTtcbiAgICByZXR1cm4gKCkgPT4gcHJvbWlzaWZpZWQ7XG4gIH1cbiAgcmV0dXJuIGlucHV0IGFzIFByb3ZpZGVyPFQ+O1xufVxuIl19
};
const normalizeCredentialProvider = (credentials) => {
if (typeof credentials === "function") {
return property_provider_1.memoize(credentials, (credentials) => credentials.expiration !== undefined &&
credentials.expiration.getTime() - Date.now() < CREDENTIAL_EXPIRE_WINDOW, (credentials) => credentials.expiration !== undefined);
}
return normalizeProvider(credentials);
};
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29uZmlndXJhdGlvbnMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvY29uZmlndXJhdGlvbnMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEsa0VBQXFEO0FBQ3JELHdEQUFvRDtBQUdwRCw0RUFBNEU7QUFDNUUsTUFBTSx3QkFBd0IsR0FBRyxNQUFNLENBQUM7QUE0Q2pDLE1BQU0sb0JBQW9CLEdBQUcsQ0FDbEMsS0FBa0QsRUFDdkIsRUFBRTtJQUM3QixNQUFNLGVBQWUsR0FBRyxLQUFLLENBQUMsV0FBVztRQUN2QyxDQUFDLENBQUMsMkJBQTJCLENBQUMsS0FBSyxDQUFDLFdBQVcsQ0FBQztRQUNoRCxDQUFDLENBQUMsS0FBSyxDQUFDLHlCQUF5QixDQUFDLEtBQVksQ0FBQyxDQUFDO0lBQ2xELE1BQU0sRUFBRSxpQkFBaUIsR0FBRyxJQUFJLEVBQUUsaUJBQWlCLEdBQUcsS0FBSyxDQUFDLGlCQUFpQixJQUFJLENBQUMsRUFBRSxNQUFNLEVBQUUsR0FBRyxLQUFLLENBQUM7SUFDckcsSUFBSSxNQUErQixDQUFDO0lBQ3BDLElBQUksS0FBSyxDQUFDLE1BQU0sRUFBRTtRQUNoQiwyRkFBMkY7UUFDM0Ys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pemVkQ3JlZHMsXG4gICAgc2lnbmVyLFxuICB9O1xufTtcblxuY29uc3Qgbm9ybWFsaXplUHJvdmlkZXIgPSA8VD4oaW5wdXQ6IFQgfCBQcm92aWRlcjxUPik6IFByb3ZpZGVyPFQ+ID0+IHtcbiAgaWYgKHR5cGVvZiBpbnB1dCA9PT0gXCJvYmplY3RcIikge1xuICAgIGNvbnN0IHByb21pc2lmaWVkID0gUHJvbWlzZS5yZXNvbHZlKGlucHV0KTtcbiAgICByZXR1cm4gKCkgPT4gcHJvbWlzaWZpZWQ7XG4gIH1cbiAgcmV0dXJuIGlucHV0IGFzIFByb3ZpZGVyPFQ+O1xufTtcblxuY29uc3Qgbm9ybWFsaXplQ3JlZGVudGlhbFByb3ZpZGVyID0gKGNyZWRlbnRpYWxzOiBDcmVkZW50aWFscyB8IFByb3ZpZGVyPENyZWRlbnRpYWxzPik6IFByb3ZpZGVyPENyZWRlbnRpYWxzPiA9PiB7XG4gIGlmICh0eXBlb2YgY3JlZGVudGlhbHMgPT09IFwiZnVuY3Rpb25cIikge1xuICAgIHJldHVybiBtZW1vaXplKFxuICAgICAgY3JlZGVudGlhbHMsXG4gICAgICAoY3JlZGVudGlhbHMpID0+XG4gICAgICAgIGNyZWRlbnRpYWxzLmV4cGlyYXRpb24gIT09IHVuZGVmaW5lZCAmJlxuICAgICAgICBjcmVkZW50aWFscy5leHBpcmF0aW9uLmdldFRpbWUoKSAtIERhdGUubm93KCkgPCBDUkVERU5USUFMX0VYUElSRV9XSU5ET1csXG4gICAgICAoY3JlZGVudGlhbHMpID0+IGNyZWRlbnRpYWxzLmV4cGlyYXRpb24gIT09IHVuZGVmaW5lZFxuICAgICk7XG4gIH1cbiAgcmV0dXJuIG5vcm1hbGl6ZVByb3ZpZGVyKGNyZWRlbnRpYWxzKTtcbn07XG4iXX0=
import { __assign, __awaiter, __generator, __read } from "tslib";
import { memoize } from "@aws-sdk/property-provider";
import { SignatureV4 } from "@aws-sdk/signature-v4";
export function resolveAwsAuthConfig(input) {
var _this = this;
var credentials = input.credentials || input.credentialDefaultProvider(input);
var normalizedCreds = normalizeProvider(credentials);
// 5 minutes buffer time the refresh the credential before it really expires
var CREDENTIAL_EXPIRE_WINDOW = 300000;
export var resolveAwsAuthConfig = function (input) {
var normalizedCreds = input.credentials
? normalizeCredentialProvider(input.credentials)
: input.credentialDefaultProvider(input);
var _a = input.signingEscapePath, signingEscapePath = _a === void 0 ? true : _a, _b = input.systemClockOffset, systemClockOffset = _b === void 0 ? input.systemClockOffset || 0 : _b, sha256 = input.sha256;

@@ -17,3 +20,3 @@ var signer;

return normalizeProvider(input.region)()
.then(function (region) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
.then(function (region) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
switch (_a.label) {

@@ -45,4 +48,4 @@ case 0: return [4 /*yield*/, input.regionInfoProvider(region)];

signingEscapePath: signingEscapePath, credentials: normalizedCreds, signer: signer });
}
function normalizeProvider(input) {
};
var normalizeProvider = function (input) {
if (typeof input === "object") {

@@ -53,3 +56,12 @@ var promisified_1 = Promise.resolve(input);

return input;
}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29uZmlndXJhdGlvbnMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvY29uZmlndXJhdGlvbnMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLE9BQU8sRUFBRSxXQUFXLEVBQUUsTUFBTSx1QkFBdUIsQ0FBQztBQTRDcEQsTUFBTSxVQUFVLG9CQUFvQixDQUFJLEtBQWtEO0lBQTFGLGlCQXVDQztJQXRDQyxJQUFNLFdBQVcsR0FBRyxLQUFLLENBQUMsV0FBVyxJQUFJLEtBQUssQ0FBQyx5QkFBeUIsQ0FBQyxLQUFZLENBQUMsQ0FBQztJQUN2RixJQUFNLGVBQWUsR0FBRyxpQkFBaUIsQ0FBQyxXQ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entials) {
if (typeof credentials === "function") {
return memoize(credentials, function (credentials) {
return credentials.expiration !== undefined &&
credentials.expiration.getTime() - Date.now() < CREDENTIAL_EXPIRE_WINDOW;
}, function (credentials) { return credentials.expiration !== undefined; });
}
return normalizeProvider(credentials);
};
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29uZmlndXJhdGlvbnMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvY29uZmlndXJhdGlvbnMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLE9BQU8sRUFBRSxPQUFPLEVBQUUsTUFBTSw0QkFBNEIsQ0FBQztBQUNyRCxPQUFPLEVBQUUsV0FBVyxFQUFFLE1BQU0sdUJBQXVCLENBQUM7QUFHcEQsNEVBQTRFO0FBQzVFLElBQU0sd0JBQXdCLEdBQUcsTUFBTSxDQUFDO0FBNEN4QyxNQUFNLENBQUMsSUFBTSxvQkFBb0IsR0FBRyxVQUNsQyxLQUFrRDtJQUVsRCxJQUFNLGVBQWUsR0FBRyxLQUFLLENBQUMsV0FBVztRQUN2QyxDQUFDLENBQUMsMkJBQTJCLENBQUMsS0FBSyxDQUFDLFdBQVcsQ0FBQztRQUNoRCxDQUFDLENBQUMsS0FBSyxDQUFDLHlCQUF5QixDQUFDLEtBQVksQ0FBQyxDQUFDO0lBQzFDLElBQUEsS0FBdUYsS0FBSyxrQkFBcEUsRUFBeEIsaUJBQWlCLG1CQUFHLElBQUksS0FBQSxFQUFFLEtBQTZELEtBQUssa0JBQWxCLEVBQWhELGlCQUFpQixtQkFBRyxLQUFLLENBQUMsaUJBQWlCLElBQUksQ0FBQyxLQUFBLEVBQUUsTUFBTSxHQUFLLEtBQUssT0FBVixDQUFXO0lBQ3JHLElBQUksTUFBK0IsQ0FBQztJQUNwQyxJQUFJLEtBQUssQ0FBQyxNQUFNLEVBQUU7UUFDaEIsMkZBQTJGO1FBQzNGLE1BQU0s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biAgICBzaWduaW5nRXNjYXBlUGF0aCxcbiAgICBjcmVkZW50aWFsczogbm9ybWFsaXplZENyZWRzLFxuICAgIHNpZ25lcixcbiAgfTtcbn07XG5cbmNvbnN0IG5vcm1hbGl6ZVByb3ZpZGVyID0gPFQ+KGlucHV0OiBUIHwgUHJvdmlkZXI8VD4pOiBQcm92aWRlcjxUPiA9PiB7XG4gIGlmICh0eXBlb2YgaW5wdXQgPT09IFwib2JqZWN0XCIpIHtcbiAgICBjb25zdCBwcm9taXNpZmllZCA9IFByb21pc2UucmVzb2x2ZShpbnB1dCk7XG4gICAgcmV0dXJuICgpID0+IHByb21pc2lmaWVkO1xuICB9XG4gIHJldHVybiBpbnB1dCBhcyBQcm92aWRlcjxUPjtcbn07XG5cbmNvbnN0IG5vcm1hbGl6ZUNyZWRlbnRpYWxQcm92aWRlciA9IChjcmVkZW50aWFsczogQ3JlZGVudGlhbHMgfCBQcm92aWRlcjxDcmVkZW50aWFscz4pOiBQcm92aWRlcjxDcmVkZW50aWFscz4gPT4ge1xuICBpZiAodHlwZW9mIGNyZWRlbnRpYWxzID09PSBcImZ1bmN0aW9uXCIpIHtcbiAgICByZXR1cm4gbWVtb2l6ZShcbiAgICAgIGNyZWRlbnRpYWxzLFxuICAgICAgKGNyZWRlbnRpYWxzKSA9PlxuICAgICAgICBjcmVkZW50aWFscy5leHBpcmF0aW9uICE9PSB1bmRlZmluZWQgJiZcbiAgICAgICAgY3JlZGVudGlhbHMuZXhwaXJhdGlvbi5nZXRUaW1lKCkgLSBEYXRlLm5vdygpIDwgQ1JFREVOVElBTF9FWFBJUkVfV0lORE9XLFxuICAgICAgKGNyZWRlbnRpYWxzKSA9PiBjcmVkZW50aWFscy5leHBpcmF0aW9uICE9PSB1bmRlZmluZWRcbiAgICApO1xuICB9XG4gIHJldHVybiBub3JtYWxpemVQcm92aWRlcihjcmVkZW50aWFscyk7XG59O1xuIl19
{
"name": "@aws-sdk/middleware-signing",
"version": "3.6.1",
"version": "3.8.1",
"scripts": {

@@ -27,2 +27,3 @@ "prepublishOnly": "yarn build:cjs && yarn build:es",

"dependencies": {
"@aws-sdk/property-provider": "3.8.0",
"@aws-sdk/protocol-http": "3.6.1",

@@ -29,0 +30,0 @@ "@aws-sdk/signature-v4": "3.6.1",

@@ -0,4 +1,8 @@

import { memoize } from "@aws-sdk/property-provider";
import { SignatureV4 } from "@aws-sdk/signature-v4";
import { Credentials, HashConstructor, Provider, RegionInfo, RegionInfoProvider, RequestSigner } from "@aws-sdk/types";
// 5 minutes buffer time the refresh the credential before it really expires
const CREDENTIAL_EXPIRE_WINDOW = 300000;
export interface AwsAuthInputConfig {

@@ -45,5 +49,9 @@ /**

}
export function resolveAwsAuthConfig<T>(input: T & AwsAuthInputConfig & PreviouslyResolved): T & AwsAuthResolvedConfig {
const credentials = input.credentials || input.credentialDefaultProvider(input as any);
const normalizedCreds = normalizeProvider(credentials);
export const resolveAwsAuthConfig = <T>(
input: T & AwsAuthInputConfig & PreviouslyResolved
): T & AwsAuthResolvedConfig => {
const normalizedCreds = input.credentials
? normalizeCredentialProvider(input.credentials)
: input.credentialDefaultProvider(input as any);
const { signingEscapePath = true, systemClockOffset = input.systemClockOffset || 0, sha256 } = input;

@@ -85,5 +93,5 @@ let signer: Provider<RequestSigner>;

};
}
};
function normalizeProvider<T>(input: T | Provider<T>): Provider<T> {
const normalizeProvider = <T>(input: T | Provider<T>): Provider<T> => {
if (typeof input === "object") {

@@ -94,2 +102,15 @@ const promisified = Promise.resolve(input);

return input as Provider<T>;
}
};
const normalizeCredentialProvider = (credentials: Credentials | Provider<Credentials>): Provider<Credentials> => {
if (typeof credentials === "function") {
return memoize(
credentials,
(credentials) =>
credentials.expiration !== undefined &&
credentials.expiration.getTime() - Date.now() < CREDENTIAL_EXPIRE_WINDOW,
(credentials) => credentials.expiration !== undefined
);
}
return normalizeProvider(credentials);
};

@@ -39,3 +39,3 @@ import { Credentials, HashConstructor, Provider, RegionInfoProvider, RequestSigner } from "@aws-sdk/types";

}
export declare function resolveAwsAuthConfig<T>(input: T & AwsAuthInputConfig & PreviouslyResolved): T & AwsAuthResolvedConfig;
export declare const resolveAwsAuthConfig: <T>(input: T & AwsAuthInputConfig & PreviouslyResolved) => T & AwsAuthResolvedConfig;
export {};

@@ -39,3 +39,3 @@ import { Credentials, HashConstructor, Provider, RegionInfoProvider, RequestSigner } from "@aws-sdk/types";

}
export declare function resolveAwsAuthConfig<T>(input: T & AwsAuthInputConfig & PreviouslyResolved): T & AwsAuthResolvedConfig;
export declare const resolveAwsAuthConfig: <T>(input: T & AwsAuthInputConfig & PreviouslyResolved) => T & AwsAuthResolvedConfig;
export {};
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc