aws4-axios
Advanced tools
Comparing version 3.3.2 to 3.3.3
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
@@ -45,6 +22,9 @@ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.aws4Interceptor = void 0; | ||
const aws4_1 = require("aws4"); | ||
const axios_1 = __importStar(require("axios")); | ||
const axios_1 = __importDefault(require("axios")); | ||
const assumeRoleCredentialsProvider_1 = require("./credentials/assumeRoleCredentialsProvider"); | ||
@@ -118,5 +98,6 @@ const isCredentialsProvider_1 = require("./credentials/isCredentialsProvider"); | ||
(0, aws4_1.sign)(signingOptions, resolvedCredentials); | ||
const signedHeaders = signingOptions.headers; | ||
if (signedHeaders) { | ||
config.headers = axios_1.AxiosHeaders.from(outgoingHttpHeadersToAxiosHeaders(signedHeaders)); | ||
if (signingOptions.headers) { | ||
for (const [key, value] of Object.entries(signingOptions.headers)) { | ||
config.headers.set(key, value); | ||
} | ||
} | ||
@@ -134,11 +115,2 @@ if (signingOptions.signQuery) { | ||
exports.aws4Interceptor = aws4Interceptor; | ||
const outgoingHttpHeadersToAxiosHeaders = (headers) => { | ||
const axiosHeaders = {}; | ||
for (const [key, value] of Object.entries(headers)) { | ||
if (value) { | ||
axiosHeaders[key] = value; | ||
} | ||
} | ||
return axiosHeaders; | ||
}; | ||
const getTransformer = (config) => { | ||
@@ -145,0 +117,0 @@ const { transformRequest } = config; |
{ | ||
"name": "aws4-axios", | ||
"version": "3.3.2", | ||
"version": "3.3.3", | ||
"description": "Axios request interceptor for signing requests with AWSv4", | ||
@@ -5,0 +5,0 @@ "author": "James Bourne", |
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
66736
1331