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

@aws-sdk/credential-provider-imds

Package Overview
Dependencies
Maintainers
7
Versions
140
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aws-sdk/credential-provider-imds - npm Package Compare versions

Comparing version 3.18.0 to 3.19.0

16

CHANGELOG.md

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

# [3.19.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.18.0...v3.19.0) (2021-06-24)
### Bug Fixes
* **credential-provider-imds:** destroy request handle on promise resolve/reject ([#2452](https://github.com/aws/aws-sdk-js-v3/issues/2452)) ([122c139](https://github.com/aws/aws-sdk-js-v3/commit/122c13976311de921155dc62f6ccd07b139c274a))
### Features
* **credential-provider-node:** throw cannot load credential error from credentail chain ([#2408](https://github.com/aws/aws-sdk-js-v3/issues/2408)) ([5e0a46a](https://github.com/aws/aws-sdk-js-v3/commit/5e0a46a9f4a35cdb200f7eccef09fb4c6ad76e9c))
# [3.18.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.17.0...v3.18.0) (2021-06-04)

@@ -8,0 +24,0 @@

10

dist/cjs/fromContainerMetadata.js

@@ -23,3 +23,3 @@ "use strict";

if (!ImdsCredentials_1.isImdsCredentials(credsResponse)) {
throw new property_provider_1.ProviderError("Invalid response received from instance metadata service.");
throw new property_provider_1.CredentialsProviderError("Invalid response received from instance metadata service.");
}

@@ -62,6 +62,6 @@ return ImdsCredentials_1.fromImdsCredentials(credsResponse);

if (!parsed.hostname || !(parsed.hostname in GREENGRASS_HOSTS)) {
throw new property_provider_1.ProviderError(`${parsed.hostname} is not a valid container metadata service hostname`, false);
throw new property_provider_1.CredentialsProviderError(`${parsed.hostname} is not a valid container metadata service hostname`, false);
}
if (!parsed.protocol || !(parsed.protocol in GREENGRASS_PROTOCOLS)) {
throw new property_provider_1.ProviderError(`${parsed.protocol} is not a valid container metadata service protocol`, false);
throw new property_provider_1.CredentialsProviderError(`${parsed.protocol} is not a valid container metadata service protocol`, false);
}

@@ -73,6 +73,6 @@ return {

}
throw new property_provider_1.ProviderError("The container metadata credential provider cannot be used unless" +
throw new property_provider_1.CredentialsProviderError("The container metadata credential provider cannot be used unless" +
` the ${exports.ENV_CMDS_RELATIVE_URI} or ${exports.ENV_CMDS_FULL_URI} environment` +
" variable is set", false);
};
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZnJvbUNvbnRhaW5lck1ldGFkYXRhLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2Zyb21Db250YWluZXJNZXRhZGF0YS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSxrRUFBMkQ7QUFHM0QsNkJBQTRCO0FBRTVCLDhEQUEyRDtBQUMzRCxzRUFBMEY7QUFDMUYsNEVBQWlHO0FBQ2pHLGtEQUErQztBQUVsQyxRQUFBLGlCQUFpQixHQUFHLG9DQUFvQyxDQUFDO0FBQ3pELFFBQUEscUJBQXFCLEdBQUcsd0NBQXdDLENBQUM7QUFDakUsUUFBQSxtQkFBbUIsR0FBRyxtQ0FBbUMsQ0FBQztBQUV2RTs7O0dBR0c7QUFDSSxNQUFNLHFCQUFxQixHQUFHLENBQUMsT0FBMkIsRUFBRSxFQUFzQixFQUFFO0lBQ3pGLE1BQU0sRUFBRSxPQUFPLEVBQUUsVUFBVSxFQUFFLEdBQUcsMkNBQXNCLENBQUMsSUFBSSxDQUFDLENBQUM7SUFDN0QsT0FBTyxHQUFHLEVBQUUsQ0FDVixhQUFLLENBQUMsS0FBSyxJQUFJLEVBQUU7UUFDZixNQUFNLGNBQWMsR0FBRyxNQUFNLFVBQVUsRUFBRSxDQUFDO1FBQzFDLE1BQU0sYUFBYSxHQUFHLElBQUksQ0FBQyxLQUFLLENBQUMsTUFBTSxrQkFBa0IsQ0FBQyxPQUFPLEVBQUUsY0FBYyxDQUFD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09MUykpIHtcbiAgICAgIHRocm93IG5ldyBDcmVkZW50aWFsc1Byb3ZpZGVyRXJyb3IoXG4gICAgICAgIGAke3BhcnNlZC5wcm90b2NvbH0gaXMgbm90IGEgdmFsaWQgY29udGFpbmVyIG1ldGFkYXRhIHNlcnZpY2UgcHJvdG9jb2xgLFxuICAgICAgICBmYWxzZVxuICAgICAgKTtcbiAgICB9XG5cbiAgICByZXR1cm4ge1xuICAgICAgLi4ucGFyc2VkLFxuICAgICAgcG9ydDogcGFyc2VkLnBvcnQgPyBwYXJzZUludChwYXJzZWQucG9ydCwgMTApIDogdW5kZWZpbmVkLFxuICAgIH07XG4gIH1cblxuICB0aHJvdyBuZXcgQ3JlZGVudGlhbHNQcm92aWRlckVycm9yKFxuICAgIFwiVGhlIGNvbnRhaW5lciBtZXRhZGF0YSBjcmVkZW50aWFsIHByb3ZpZGVyIGNhbm5vdCBiZSB1c2VkIHVubGVzc1wiICtcbiAgICAgIGAgdGhlICR7RU5WX0NNRFNfUkVMQVRJVkVfVVJJfSBvciAke0VOVl9DTURTX0ZVTExfVVJJfSBlbnZpcm9ubWVudGAgK1xuICAgICAgXCIgdmFyaWFibGUgaXMgc2V0XCIsXG4gICAgZmFsc2VcbiAgKTtcbn07XG4iXX0=

@@ -95,6 +95,6 @@ "use strict";

if (!ImdsCredentials_1.isImdsCredentials(credsResponse)) {
throw new property_provider_1.ProviderError("Invalid response received from instance metadata service.");
throw new property_provider_1.CredentialsProviderError("Invalid response received from instance metadata service.");
}
return ImdsCredentials_1.fromImdsCredentials(credsResponse);
};
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZnJvbUluc3RhbmNlTWV0YWRhdGEuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvZnJvbUluc3RhbmNlTWV0YWRhdGEudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEsa0VBQTJEO0FBSTNELDhEQ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FNfUEFUSCArIHByb2ZpbGUsXG4gICAgICB9KVxuICAgICkudG9TdHJpbmcoKVxuICApO1xuXG4gIGlmICghaXNJbWRzQ3JlZGVudGlhbHMoY3JlZHNSZXNwb25zZSkpIHtcbiAgICB0aHJvdyBuZXcgQ3JlZGVudGlhbHNQcm92aWRlckVycm9yKFwiSW52YWxpZCByZXNwb25zZSByZWNlaXZlZCBmcm9tIGluc3RhbmNlIG1ldGFkYXRhIHNlcnZpY2UuXCIpO1xuICB9XG5cbiAgcmV0dXJuIGZyb21JbWRzQ3JlZGVudGlhbHMoY3JlZHNSZXNwb25zZSk7XG59O1xuIl19

@@ -15,5 +15,7 @@ "use strict";

reject(Object.assign(new property_provider_1.ProviderError("Unable to connect to instance metadata service"), err));
req.destroy();
});
req.on("timeout", () => {
reject(new Error("TimeoutError"));
reject(new property_provider_1.ProviderError("TimeoutError from instance metadata service"));
req.destroy();
});

@@ -24,2 +26,3 @@ req.on("response", (res) => {

reject(Object.assign(new property_provider_1.ProviderError("Error response received from instance metadata service"), { statusCode }));
req.destroy();
}

@@ -32,2 +35,3 @@ const chunks = [];

resolve(buffer_1.Buffer.concat(chunks));
req.destroy();
});

@@ -39,2 +43,2 @@ });

exports.httpRequest = httpRequest;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaHR0cFJlcXVlc3QuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvcmVtb3RlUHJvdmlkZXIvaHR0cFJlcXVlc3QudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEsa0VBQTJEO0FBQzNELG1DQUFnQztBQUNoQywrQkFBZ0U7QUFFaEU7O0dBRUc7QUFDSCxTQUFnQixXQUFXLENBQUMsT0FBdUI7SUFDakQsT0FBTyxJQUFJLE9BQU8sQ0FBQyxDQUFDLE9BQU8sRUFBRSxNQUFNLEVBQUUsRUFBRTtRQUNyQyxNQUFNLEd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T4ge1xuICAgICAgICByZXNvbHZlKEJ1ZmZlci5jb25jYXQoY2h1bmtzKSk7XG4gICAgICAgIHJlcS5kZXN0cm95KCk7XG4gICAgICB9KTtcbiAgICB9KTtcblxuICAgIHJlcS5lbmQoKTtcbiAgfSk7XG59XG4iXX0=
import { __assign, __awaiter, __generator } from "tslib";
import { ProviderError } from "@aws-sdk/property-provider";
import { CredentialsProviderError } from "@aws-sdk/property-provider";
import { parse } from "url";

@@ -31,3 +31,3 @@ import { httpRequest } from "./remoteProvider/httpRequest";

if (!isImdsCredentials(credsResponse)) {
throw new ProviderError("Invalid response received from instance metadata service.");
throw new CredentialsProviderError("Invalid response received from instance metadata service.");
}

@@ -76,10 +76,10 @@ return [2 /*return*/, fromImdsCredentials(credsResponse)];

if (!parsed.hostname || !(parsed.hostname in GREENGRASS_HOSTS)) {
throw new ProviderError(parsed.hostname + " is not a valid container metadata service hostname", false);
throw new CredentialsProviderError(parsed.hostname + " is not a valid container metadata service hostname", false);
}
if (!parsed.protocol || !(parsed.protocol in GREENGRASS_PROTOCOLS)) {
throw new ProviderError(parsed.protocol + " is not a valid container metadata service protocol", false);
throw new CredentialsProviderError(parsed.protocol + " is not a valid container metadata service protocol", false);
}
return [2 /*return*/, __assign(__assign({}, parsed), { port: parsed.port ? parseInt(parsed.port, 10) : undefined })];
}
throw new ProviderError("The container metadata credential provider cannot be used unless" +
throw new CredentialsProviderError("The container metadata credential provider cannot be used unless" +
(" the " + ENV_CMDS_RELATIVE_URI + " or " + ENV_CMDS_FULL_URI + " environment") +

@@ -89,2 +89,2 @@ " variable is set", false);

}); };
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZnJvbUNvbnRhaW5lck1ldGFkYXRhLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2Zyb21Db250YWluZXJNZXRhZGF0YS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEs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hIHZhbGlkIGNvbnRhaW5lciBtZXRhZGF0YSBzZXJ2aWNlIGhvc3RuYW1lYCxcbiAgICAgICAgZmFsc2VcbiAgICAgICk7XG4gICAgfVxuXG4gICAgaWYgKCFwYXJzZWQucHJvdG9jb2wgfHwgIShwYXJzZWQucHJvdG9jb2wgaW4gR1JFRU5HUkFTU19QUk9UT0NPTFMpKSB7XG4gICAgICB0aHJvdyBuZXcgQ3JlZGVudGlhbHNQcm92aWRlckVycm9yKFxuICAgICAgICBgJHtwYXJzZWQucHJvdG9jb2x9IGlzIG5vdCBhIHZhbGlkIGNvbnRhaW5lciBtZXRhZGF0YSBzZXJ2aWNlIHByb3RvY29sYCxcbiAgICAgICAgZmFsc2VcbiAgICAgICk7XG4gICAgfVxuXG4gICAgcmV0dXJuIHtcbiAgICAgIC4uLnBhcnNlZCxcbiAgICAgIHBvcnQ6IHBhcnNlZC5wb3J0ID8gcGFyc2VJbnQocGFyc2VkLnBvcnQsIDEwKSA6IHVuZGVmaW5lZCxcbiAgICB9O1xuICB9XG5cbiAgdGhyb3cgbmV3IENyZWRlbnRpYWxzUHJvdmlkZXJFcnJvcihcbiAgICBcIlRoZSBjb250YWluZXIgbWV0YWRhdGEgY3JlZGVudGlhbCBwcm92aWRlciBjYW5ub3QgYmUgdXNlZCB1bmxlc3NcIiArXG4gICAgICBgIHRoZSAke0VOVl9DTURTX1JFTEFUSVZFX1VSSX0gb3IgJHtFTlZfQ01EU19GVUxMX1VSSX0gZW52aXJvbm1lbnRgICtcbiAgICAgIFwiIHZhcmlhYmxlIGlzIHNldFwiLFxuICAgIGZhbHNlXG4gICk7XG59O1xuIl19
import { __assign, __awaiter, __generator } from "tslib";
import { ProviderError } from "@aws-sdk/property-provider";
import { CredentialsProviderError } from "@aws-sdk/property-provider";
import { httpRequest } from "./remoteProvider/httpRequest";

@@ -128,3 +128,3 @@ import { fromImdsCredentials, isImdsCredentials } from "./remoteProvider/ImdsCredentials";

if (!isImdsCredentials(credsResponse)) {
throw new ProviderError("Invalid response received from instance metadata service.");
throw new CredentialsProviderError("Invalid response received from instance metadata service.");
}

@@ -135,2 +135,2 @@ return [2 /*return*/, fromImdsCredentials(credsResponse)];

}); };
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZnJvbUluc3RhbmNlTWV0YWRhdGEuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvZnJvbUluc3RhbmNlTWV0YWRhdGEudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLE9BQU8sRUFBRSxhQUFhLEVBQUUsTUFBTSw0QkFBNEIsQ0FBQztBQUkzRCxPQUFPLEVBQUUsV0FBVyxFQUFFLE1BQU0sOEJBQThCLENBQUM7QUFDM0QsT0FBTyxFQUFFLG1CQUFtQixFQUFFLGlCQUFpQixFQUFFLE1BQU0sa0NBQWtDLENBQUM7QUFDMUYsT0FBTyxFQUFFLHNCQUFzQixFQUFzQixNQUFNLHFDQUFxQyxDQUFDO0FBQ2pHLE9BQU8sRUFBRSxLQUFLLEVBQUUsTUFBTSx3QkFBd0IsQ0FBQztBQUUvQyxJQUFNLE9BQU8sR0FBRyxpQkFBaUIsQ0FBQztBQUNsQyxJQUFNLFNBQVMsR0FBRyw2Q0FBNkMsQ0FBQztBQUNoRSxJQUFNLGVBQWUsR0FBRyxtQkFBbUIsQ0FBQztBQUU1Qzs7O0dBR0c7QUFDSCxNQUFNLENBQUMsSUFBTSxvQkFBb0IsR0FBRyxVQUFDLElBQTZCO0lBQTdCLHFCQUFBLEVBQUEsU0FBNkI7SUFDaEUsMERBQTBEO0lBQzFELElBQUksaUJBQWlCLEdBQUcsS0FBSyxDQUFDO0lBQ3hCLElBQUEsS0FBMEIsc0JBQXNCLENBQUMsSUFBSSxDQUFDLEVBQXBELE9BQU8sYUFBQSxFQUFFLFVBQVUsZ0JBQWlDLENBQUM7SUFFN0QsSUFBTSxjQUFjLEdBQUcsVUFBTyxV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GlhbHMgPSBhc3luYyAobWF4UmV0cmllczogbnVtYmVyLCBvcHRpb25zOiBSZXF1ZXN0T3B0aW9ucykgPT4ge1xuICAgIGNvbnN0IHByb2ZpbGUgPSAoXG4gICAgICBhd2FpdCByZXRyeTxzdHJpbmc+KGFzeW5jICgpID0+IHtcbiAgICAgICAgbGV0IHByb2ZpbGU6IHN0cmluZztcbiAgICAgICAgdHJ5IHtcbiAgICAgICAgICBwcm9maWxlID0gYXdhaXQgZ2V0UHJvZmlsZShvcHRpb25zKTtcbiAgICAgICAgfSBjYXRjaCAoZXJyKSB7XG4gICAgICAgICAgaWYgKGVyci5zdGF0dXNDb2RlID09PSA0MDEpIHtcbiAgICAgICAgICAgIGRpc2FibGVGZXRjaFRva2VuID0gZmFsc2U7XG4gICAgICAgICAgfVxuICAgICAgICAgIHRocm93IGVycjtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcHJvZmlsZTtcbiAgICAgIH0sIG1heFJldHJpZXMpXG4gICAgKS50cmltKCk7XG5cbiAgICByZXR1cm4gcmV0cnkoYXN5bmMgKCkgPT4ge1xuICAgICAgbGV0IGNyZWRzOiBDcmVkZW50aWFscztcbiAgICAgIHRyeSB7XG4gICAgICAgIGNyZWRzID0gYXdhaXQgZ2V0Q3JlZGVudGlhbHNGcm9tUHJvZmlsZShwcm9maWxlLCBvcHRpb25zKTtcbiAgICAgIH0gY2F0Y2ggKGVycikge1xuICAgICAgICBpZiAoZXJyLnN0YXR1c0NvZGUgPT09IDQwMSkge1xuICAgICAgICAgIGRpc2FibGVGZXRjaFRva2VuID0gZmFsc2U7XG4gICAgICAgIH1cbiAgICAgICAgdGhyb3cgZXJyO1xuICAgICAgfVxuICAgICAgcmV0dXJuIGNyZWRzO1xuICAgIH0sIG1heFJldHJpZXMpO1xuICB9O1xuXG4gIHJldHVybiBhc3luYyAoKSA9PiB7XG4gICAgaWYgKGRpc2FibGVGZXRjaFRva2VuKSB7XG4gICAgICByZXR1cm4gZ2V0Q3JlZ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bGV0IHByb2ZpbGU6IHN0cmluZztcbiAgICAgICAgdHJ5IHtcbiAgICAgICAgICBwcm9maWxlID0gYXdhaXQgZ2V0UHJvZmlsZShvcHRpb25zKTtcbiAgICAgICAgfSBjYXRjaCAoZXJyKSB7XG4gICAgICAgICAgaWYgKGVyci5zdGF0dXNDb2RlID09PSA0MDEpIHtcbiAgICAgICAgICAgIGRpc2FibGVGZXRjaFRva2VuID0gZmFsc2U7XG4gICAgICAgICAgfVxuICAgICAgICAgIHRocm93IGVycjtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcHJvZmlsZTtcbiAgICAgIH0sIG1heFJldHJpZXMpXG4gICAgKS50cmltKCk7XG5cbiAgICByZXR1cm4gcmV0cnkoYXN5bmMgKCkgPT4ge1xuICAgICAgbGV0IGNyZWRzOiBDcmVkZW50aWFscztcbiAgICAgIHRyeSB7XG4gICAgICAgIGNyZWRzID0gYXdhaXQgZ2V0Q3JlZGVudGlhbHNGcm9tUHJvZmlsZShwcm9maWxlLCBvcHRpb25zKTtcbiAgICAgIH0gY2F0Y2ggKGVycikge1xuICAgICAgICBpZiAoZXJyLnN0YXR1c0NvZGUgPT09IDQwMSkge1xuICAgICAgICAgIGRpc2FibGVGZXRjaFRva2VuID0gZmFsc2U7XG4gICAgICAgIH1cbiAgICAgICAgdGhyb3cgZXJyO1xuICAgICAgfVxuICAgICAgcmV0dXJuIGNyZWRzO1xuICAgIH0sIG1heFJldHJpZXMpO1xuICB9O1xuXG4gIHJldHVybiBhc3luYyAoKSA9PiB7XG4gICAgaWYgKGRpc2FibGVGZXRjaFRva2VuKSB7XG4gICAgICByZXR1cm4gZ2V0Q3JlZGVudGlhbHMobWF4UmV0cmllcywgeyB0aW1lb3V0IH0pO1xuICAgIH0gZWxzZSB7XG4gICAgICBsZXQgdG9rZW46IHN0cmluZztcbiAgICAgIHRyeSB7XG4gICAgICAgIHRva2VuID0gKGF3YWl0IGdldE1ldGFkYXRhVG9rZW4oeyB0aW1lb3V0IH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wXCIsXG4gICAgfSxcbiAgfSk7XG5cbmNvbnN0IGdldFByb2ZpbGUgPSBhc3luYyAob3B0aW9uczogUmVxdWVzdE9wdGlvbnMpID0+XG4gIChhd2FpdCBodHRwUmVxdWVzdCh7IC4uLm9wdGlvbnMsIGhvc3Q6IElNRFNfSVAsIHBhdGg6IElNRFNfUEFUSCB9KSkudG9TdHJpbmcoKTtcblxuY29uc3QgZ2V0Q3JlZGVudGlhbHNGcm9tUHJvZmlsZSA9IGFzeW5jIChwcm9maWxlOiBzdHJpbmcsIG9wdGlvbnM6IFJlcXVlc3RPcHRpb25zKSA9PiB7XG4gIGNvbnN0IGNyZWRzUmVzcG9uc2UgPSBKU09OLnBhcnNlKFxuICAgIChcbiAgICAgIGF3YWl0IGh0dHBSZXF1ZXN0KHtcbiAgICAgICAgLi4ub3B0aW9ucyxcbiAgICAgICAgaG9zdDogSU1EU19JUCxcbiAgICAgICAgcGF0aDogSU1EU19QQVRIICsgcHJvZmlsZSxcbiAgICAgIH0pXG4gICAgKS50b1N0cmluZygpXG4gICk7XG5cbiAgaWYgKCFpc0ltZHNDcmVkZW50aWFscyhjcmVkc1Jlc3BvbnNlKSkge1xuICAgIHRocm93IG5ldyBDcmVkZW50aWFsc1Byb3ZpZGVyRXJyb3IoXCJJbnZhbGlkIHJlc3BvbnNlIHJlY2VpdmVkIGZyb20gaW5zdGFuY2UgbWV0YWRhdGEgc2VydmljZS5cIik7XG4gIH1cblxuICByZXR1cm4gZnJvbUltZHNDcmVkZW50aWFscyhjcmVkc1Jlc3BvbnNlKTtcbn07XG4iXX0=

@@ -13,5 +13,7 @@ import { __assign } from "tslib";

reject(Object.assign(new ProviderError("Unable to connect to instance metadata service"), err));
req.destroy();
});
req.on("timeout", function () {
reject(new Error("TimeoutError"));
reject(new ProviderError("TimeoutError from instance metadata service"));
req.destroy();
});

@@ -22,2 +24,3 @@ req.on("response", function (res) {

reject(Object.assign(new ProviderError("Error response received from instance metadata service"), { statusCode: statusCode }));
req.dest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uICAgICAgaWYgKHN0YXR1c0NvZGUgPCAyMDAgfHwgMzAwIDw9IHN0YXR1c0NvZGUpIHtcbiAgICAgICAgcmVqZWN0KFxuICAgICAgICAgIE9iamVjdC5hc3NpZ24obmV3IFByb3ZpZGVyRXJyb3IoXCJFcnJvciByZXNwb25zZSByZWNlaXZlZCBmcm9tIGluc3RhbmNlIG1ldGFkYXRhIHNlcnZpY2VcIiksIHsgc3RhdHVzQ29kZSB9KVxuICAgICAgICApO1xuICAgICAgICByZXEuZGVzdHJveSgpO1xuICAgICAgfVxuXG4gICAgICBjb25zdCBjaHVua3M6IEFycmF5PEJ1ZmZlcj4gPSBbXTtcbiAgICAgIHJlcy5vbihcImRhdGFcIiwgKGNodW5rKSA9PiB7XG4gICAgICAgIGNodW5rcy5wdXNoKGNodW5rIGFzIEJ1ZmZlcik7XG4gICAgICB9KTtcbiAgICAgIHJlcy5vbihcImVuZFwiLCAoKSA9PiB7XG4gICAgICAgIHJlc29sdmUoQnVmZmVyLmNvbmNhdChjaHVua3MpKTtcbiAgICAgICAgcmVxLmRlc3Ryb3koKTtcbiAgICAgIH0pO1xuICAgIH0pO1xuXG4gICAgcmVxLmVuZCgpO1xuICB9KTtcbn1cbiJdfQ==
{
"name": "@aws-sdk/credential-provider-imds",
"version": "3.18.0",
"version": "3.19.0",
"description": "AWS credential provider that sources credentials from the EC2 instance metadata service and ECS container metadata service",

@@ -24,3 +24,3 @@ "main": "./dist/cjs/index.js",

"dependencies": {
"@aws-sdk/property-provider": "3.18.0",
"@aws-sdk/property-provider": "3.19.0",
"@aws-sdk/types": "3.18.0",

@@ -27,0 +27,0 @@ "tslib": "^2.0.0"

@@ -1,2 +0,2 @@

import { ProviderError } from "@aws-sdk/property-provider";
import { CredentialsProviderError } from "@aws-sdk/property-provider";
import { CredentialProvider } from "@aws-sdk/types";

@@ -26,3 +26,3 @@ import { RequestOptions } from "http";

if (!isImdsCredentials(credsResponse)) {
throw new ProviderError("Invalid response received from instance metadata service.");
throw new CredentialsProviderError("Invalid response received from instance metadata service.");
}

@@ -69,7 +69,13 @@ return fromImdsCredentials(credsResponse);

if (!parsed.hostname || !(parsed.hostname in GREENGRASS_HOSTS)) {
throw new ProviderError(`${parsed.hostname} is not a valid container metadata service hostname`, false);
throw new CredentialsProviderError(
`${parsed.hostname} is not a valid container metadata service hostname`,
false
);
}
if (!parsed.protocol || !(parsed.protocol in GREENGRASS_PROTOCOLS)) {
throw new ProviderError(`${parsed.protocol} is not a valid container metadata service protocol`, false);
throw new CredentialsProviderError(
`${parsed.protocol} is not a valid container metadata service protocol`,
false
);
}

@@ -83,3 +89,3 @@

throw new ProviderError(
throw new CredentialsProviderError(
"The container metadata credential provider cannot be used unless" +

@@ -86,0 +92,0 @@ ` the ${ENV_CMDS_RELATIVE_URI} or ${ENV_CMDS_FULL_URI} environment` +

@@ -1,2 +0,2 @@

import { ProviderError } from "@aws-sdk/property-provider";
import { CredentialsProviderError } from "@aws-sdk/property-provider";
import { CredentialProvider, Credentials } from "@aws-sdk/types";

@@ -106,3 +106,3 @@ import { RequestOptions } from "http";

if (!isImdsCredentials(credsResponse)) {
throw new ProviderError("Invalid response received from instance metadata service.");
throw new CredentialsProviderError("Invalid response received from instance metadata service.");
}

@@ -109,0 +109,0 @@

@@ -14,6 +14,8 @@ import { ProviderError } from "@aws-sdk/property-provider";

reject(Object.assign(new ProviderError("Unable to connect to instance metadata service"), err));
req.destroy();
});
req.on("timeout", () => {
reject(new Error("TimeoutError"));
reject(new ProviderError("TimeoutError from instance metadata service"));
req.destroy();
});

@@ -27,2 +29,3 @@

);
req.destroy();
}

@@ -36,2 +39,3 @@

resolve(Buffer.concat(chunks));
req.destroy();
});

@@ -38,0 +42,0 @@ });

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