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

@aws-sdk/credential-provider-ini

Package Overview
Dependencies
Maintainers
5
Versions
359
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

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

Comparing version 3.8.0 to 3.10.0

dist/types/index.d.ts

12

CHANGELOG.md

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

# [3.10.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.9.0...v3.10.0) (2021-03-26)
### Features
* **credential-provider-ini:** call fromTokenFile in assumeRole chaining ([#2178](https://github.com/aws/aws-sdk-js-v3/issues/2178)) ([fb95408](https://github.com/aws/aws-sdk-js-v3/commit/fb95408d999c8322a12fcc1459e3a56b289048b4))
* use ts-jest for running jest tests ([#2088](https://github.com/aws/aws-sdk-js-v3/issues/2088)) ([456002c](https://github.com/aws/aws-sdk-js-v3/commit/456002cf7fa16864b72c3c279b094886a42abddb))
# [3.8.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.7.0...v3.8.0) (2021-03-05)

@@ -8,0 +20,0 @@

23

dist/cjs/index.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getMasterProfileName = exports.parseKnownFiles = exports.fromIni = exports.ENV_PROFILE = void 0;
const credential_provider_web_identity_1 = require("@aws-sdk/credential-provider-web-identity");
const property_provider_1 = require("@aws-sdk/property-provider");

@@ -13,5 +14,10 @@ const shared_ini_file_loader_1 = require("@aws-sdk/shared-ini-file-loader");

["undefined", "string"].indexOf(typeof arg.aws_session_token) > -1;
const isAssumeRoleProfile = (arg) => Boolean(arg) &&
const isWebIdentityProfile = (arg) => Boolean(arg) &&
typeof arg === "object" &&
typeof arg.web_identity_token_file === "string" &&
typeof arg.role_arn === "string" &&
["undefined", "string"].indexOf(typeof arg.role_session_name) > -1;
const isAssumeRoleWithSourceProfile = (arg) => Boolean(arg) &&
typeof arg === "object" &&
typeof arg.role_arn === "string" &&
typeof arg.source_profile === "string" &&

@@ -60,3 +66,3 @@ ["undefined", "string"].indexOf(typeof arg.role_session_name) > -1 &&

// given precedence over static credentials.
if (isAssumeRoleProfile(data)) {
if (isAssumeRoleWithSourceProfile(data)) {
const { external_id: ExternalId, mfa_serial, role_arn: RoleArn, role_session_name: RoleSessionName = "aws-sdk-js-" + Date.now(), source_profile, } = data;

@@ -90,2 +96,7 @@ if (!options.roleAssumer) {

}
// If no static credentials are present, attempt to assume role with
// web identity if web_identity_token_file and role_arn is available
if (isWebIdentityProfile(data)) {
return resolveWebIdentityCredentials(data, options);
}
// If the profile cannot be parsed or contains neither static credentials

@@ -103,2 +114,8 @@ // nor role assumption metadata, throw an error. This should be considered a

});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEsa0VBQTJEO0FBQzNELDRFQU15QztBQUd6QyxNQUFNLGVBQWUsR0FBRyxTQUFTLENBQUM7QUFDckIsUUFBQSxXQUFXLEdBQUcsYUFBYSxDQUFDO0FBNkV6QyxNQUFNLG9CQUFvQixHQUFHLENBQUMsR0FBUSxFQUE2QixFQUFFLENBQ25FLE9BQU8sQ0FBQyxHQUFHLENBQUM7SUFDWixPQUFPLEdBQUcsS0FBSyxRQUFRO0lBQ3ZCLE9BQU8sR0FBRyxDQUFDLGlCQUFpQixLQUFLLFFBQVE7SUFDekMsT0FBTyxHQUFHLENBQUMscUJBQXFCLEtBQUssUUFBUTtJQUM3QyxDQUFDLFdBQVcsRUFBRSxRQUFRLENBQUMsQ0FBQyxPQUFPLENBQUMsT0FBTyxHQUFHLENBQUMsaUJBQWlCLENBQUMsR0FBRyxDQUFDLENBQUMsQ0FBQztBQU9yRSxNQUFNLG1CQUFtQixHQUFHLENBQUMsR0FBUS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vIHRlcm1pbmFsIHJlc29sdXRpb24gZXJyb3IgaWYgYSBwcm9maWxlIGhhcyBiZWVuIHNwZWNpZmllZCBieSB0aGUgdXNlclxuICAvLyAod2hldGhlciB2aWEgYSBwYXJhbWV0ZXIsIGFuIGVudmlyb25tZW50IHZhcmlhYmxlLCBvciBhbm90aGVyIHByb2ZpbGUnc1xuICAvLyBgc291cmNlX3Byb2ZpbGVgIGtleSkuXG4gIHRocm93IG5ldyBQcm92aWRlckVycm9yKGBQcm9maWxlICR7cHJvZmlsZU5hbWV9IGNvdWxkIG5vdCBiZSBmb3VuZCBvciBwYXJzZWQgaW4gc2hhcmVkYCArIGAgY3JlZGVudGlhbHMgZmlsZS5gKTtcbn07XG5cbmNvbnN0IHJlc29sdmVTdGF0aWNDcmVkZW50aWFscyA9IChwcm9maWxlOiBTdGF0aWNDcmVkc1Byb2ZpbGUpOiBQcm9taXNlPENyZWRlbnRpYWxzPiA9PlxuICBQcm9taXNlLnJlc29sdmUoe1xuICAgIGFjY2Vzc0tleUlkOiBwcm9maWxlLmF3c19hY2Nlc3Nfa2V5X2lkLFxuICAgIHNlY3JldEFjY2Vzc0tleTogcHJvZmlsZS5hd3Nfc2VjcmV0X2FjY2Vzc19rZXksXG4gICAgc2Vzc2lvblRva2VuOiBwcm9maWxlLmF3c19zZXNzaW9uX3Rva2VuLFxuICB9KTtcbiJdfQ==
const resolveWebIdentityCredentials = async (profile, options) => credential_provider_web_identity_1.fromTokenFile({
webIdentityTokenFile: profile.web_identity_token_file,
roleArn: profile.role_arn,
roleSessionName: profile.role_session_name,
roleAssumerWithWebIdentity: options.roleAssumerWithWebIdentity,
})();
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEsZ0dBQTJHO0FBQzN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pZGVyRXJyb3IoYFByb2ZpbGUgJHtwcm9maWxlTmFtZX0gY291bGQgbm90IGJlIGZvdW5kIG9yIHBhcnNlZCBpbiBzaGFyZWRgICsgYCBjcmVkZW50aWFscyBmaWxlLmApO1xufTtcblxuY29uc3QgcmVzb2x2ZVN0YXRpY0NyZWRlbnRpYWxzID0gKHByb2ZpbGU6IFN0YXRpY0NyZWRzUHJvZmlsZSk6IFByb21pc2U8Q3JlZGVudGlhbHM+ID0+XG4gIFByb21pc2UucmVzb2x2ZSh7XG4gICAgYWNjZXNzS2V5SWQ6IHByb2ZpbGUuYXdzX2FjY2Vzc19rZXlfaWQsXG4gICAgc2VjcmV0QWNjZXNzS2V5OiBwcm9maWxlLmF3c19zZWNyZXRfYWNjZXNzX2tleSxcbiAgICBzZXNzaW9uVG9rZW46IHByb2ZpbGUuYXdzX3Nlc3Npb25fdG9rZW4sXG4gIH0pO1xuXG5jb25zdCByZXNvbHZlV2ViSWRlbnRpdHlDcmVkZW50aWFscyA9IGFzeW5jIChwcm9maWxlOiBXZWJJZGVudGl0eVByb2ZpbGUsIG9wdGlvbnM6IEZyb21JbmlJbml0KTogUHJvbWlzZTxDcmVkZW50aWFscz4gPT5cbiAgZnJvbVRva2VuRmlsZSh7XG4gICAgd2ViSWRlbnRpdHlUb2tlbkZpbGU6IHByb2ZpbGUud2ViX2lkZW50aXR5X3Rva2VuX2ZpbGUsXG4gICAgcm9sZUFybjogcHJvZmlsZS5yb2xlX2FybixcbiAgICByb2xlU2Vzc2lvbk5hbWU6IHByb2ZpbGUucm9sZV9zZXNzaW9uX25hbWUsXG4gICAgcm9sZUFzc3VtZXJXaXRoV2ViSWRlbnRpdHk6IG9wdGlvbnMucm9sZUFzc3VtZXJXaXRoV2ViSWRlbnRpdHksXG4gIH0pKCk7XG4iXX0=
import { __assign, __awaiter, __generator } from "tslib";
import { fromTokenFile } from "@aws-sdk/credential-provider-web-identity";
import { ProviderError } from "@aws-sdk/property-provider";

@@ -13,6 +14,13 @@ import { loadSharedConfigFiles, } from "@aws-sdk/shared-ini-file-loader";

};
var isAssumeRoleProfile = function (arg) {
var isWebIdentityProfile = function (arg) {
return Boolean(arg) &&
typeof arg === "object" &&
typeof arg.web_identity_token_file === "string" &&
typeof arg.role_arn === "string" &&
["undefined", "string"].indexOf(typeof arg.role_session_name) > -1;
};
var isAssumeRoleWithSourceProfile = function (arg) {
return Boolean(arg) &&
typeof arg === "object" &&
typeof arg.role_arn === "string" &&
typeof arg.source_profile === "string" &&

@@ -81,3 +89,3 @@ ["undefined", "string"].indexOf(typeof arg.role_session_name) > -1 &&

}
if (!isAssumeRoleProfile(data)) return [3 /*break*/, 4];
if (!isAssumeRoleWithSourceProfile(data)) return [3 /*break*/, 4];
ExternalId = data.external_id, mfa_serial = data.mfa_serial, RoleArn = data.role_arn, _a = data.role_session_name, RoleSessionName = _a === void 0 ? "aws-sdk-js-" + Date.now() : _a, source_profile = data.source_profile;

@@ -114,2 +122,7 @@ if (!options.roleAssumer) {

}
// If no static credentials are present, attempt to assume role with
// web identity if web_identity_token_file and role_arn is available
if (isWebIdentityProfile(data)) {
return [2 /*return*/, resolveWebIdentityCredentials(data, options)];
}
// If the profile cannot be parsed or contains neither static credentials

@@ -132,2 +145,12 @@ // nor role assumption metadata, throw an error. This should be considered a

};
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLE9BQU8sRUFBRSxhQUFhLEVBQUUsTUFBTSw0QkFBNEIsQ0FBQztBQUMzRCxPQUFPLEVBQ0wscUJBQXFCLEdBS3RCLE1BQU0saUNBQWlDLENBQUM7QUFHekMsSUFBTSxlQUFlLEdBQUcsU0FBUyxDQUFDO0FBQ2xDLE1BQU0sQ0FBQyxJQUFNLFdBQVcsR0FBRyxhQUFhLENB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JvbWlzZTxDcmVkZW50aWFscz4gPT5cbiAgUHJvbWlzZS5yZXNvbHZlKHtcbiAgICBhY2Nlc3NLZXlJZDogcHJvZmlsZS5hd3NfYWNjZXNzX2tleV9pZCxcbiAgICBzZWNyZXRBY2Nlc3NLZXk6IHByb2ZpbGUuYXdzX3NlY3JldF9hY2Nlc3Nfa2V5LFxuICAgIHNlc3Npb25Ub2tlbjogcHJvZmlsZS5hd3Nfc2Vzc2lvbl90b2tlbixcbiAgfSk7XG4iXX0=
var resolveWebIdentityCredentials = function (profile, options) { return __awaiter(void 0, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, fromTokenFile({
webIdentityTokenFile: profile.web_identity_token_file,
roleArn: profile.role_arn,
roleSessionName: profile.role_session_name,
roleAssumerWithWebIdentity: options.roleAssumerWithWebIdentity,
})()];
});
}); };
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLE9BQU8sRUFBbUMsYUFBYSxFQUFFLE1BQU0sMkNBQTJDLENBQUM7QUFDM0csT0FBTyxFQUFFLGFBQWEsRUFBRSxNQUFNLDRCQUE0QixDQUFDO0FBQzNELE9BQU8sRUFDTCxxQkFBcUIsR0FLdEIsTUFBTSxpQ0FBaUMsQ0FBQztBQUd6QyxJQUFNLGVBQWUsR0FBRyxTQUFTLENBQUM7QUFDbEMsTUFBTSxDQUFDLElBQU0sV0FBVyxHQUFHLGFBQWEsQ0FBQztBQXNGekMsSUFBTSxvQkFBb0IsR0FBRyxVQUFDLEdBQVE7SUFDcEMsT0FBQSxPQUFPLENBQUMsR0FBRyxDQUFDO1FBQ1osT0FBTyxHQUFHLEtBQUssUUFBUTtRQUN2QixPQUFPLEdBQUcsQ0FBQyxpQkFBaUIsS0FBSyxRQUFRO1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3JlZGVudGlhbHMgPSAocHJvZmlsZTogU3RhdGljQ3JlZHNQcm9maWxlKTogUHJvbWlzZTxDcmVkZW50aWFscz4gPT5cbiAgUHJvbWlzZS5yZXNvbHZlKHtcbiAgICBhY2Nlc3NLZXlJZDogcHJvZmlsZS5hd3NfYWNjZXNzX2tleV9pZCxcbiAgICBzZWNyZXRBY2Nlc3NLZXk6IHByb2ZpbGUuYXdzX3NlY3JldF9hY2Nlc3Nfa2V5LFxuICAgIHNlc3Npb25Ub2tlbjogcHJvZmlsZS5hd3Nfc2Vzc2lvbl90b2tlbixcbiAgfSk7XG5cbmNvbnN0IHJlc29sdmVXZWJJZGVudGl0eUNyZWRlbnRpYWxzID0gYXN5bmMgKHByb2ZpbGU6IFdlYklkZW50aXR5UHJvZmlsZSwgb3B0aW9uczogRnJvbUluaUluaXQpOiBQcm9taXNlPENyZWRlbnRpYWxzPiA9PlxuICBmcm9tVG9rZW5GaWxlKHtcbiAgICB3ZWJJZGVudGl0eVRva2VuRmlsZTogcHJvZmlsZS53ZWJfaWRlbnRpdHlfdG9rZW5fZmlsZSxcbiAgICByb2xlQXJuOiBwcm9maWxlLnJvbGVfYXJuLFxuICAgIHJvbGVTZXNzaW9uTmFtZTogcHJvZmlsZS5yb2xlX3Nlc3Npb25fbmFtZSxcbiAgICByb2xlQXNzdW1lcldpdGhXZWJJZGVudGl0eTogb3B0aW9ucy5yb2xlQXNzdW1lcldpdGhXZWJJZGVudGl0eSxcbiAgfSkoKTtcbiJdfQ==

14

package.json
{
"name": "@aws-sdk/credential-provider-ini",
"version": "3.8.0",
"version": "3.10.0",
"description": "AWS credential provider that sources credentials from ~/.aws/credentials and ~/.aws/config",

@@ -9,7 +9,6 @@ "main": "./dist/cjs/index.js",

"prepublishOnly": "yarn build:cjs && yarn build:es",
"pretest": "yarn build:cjs",
"build:cjs": "tsc -p tsconfig.cjs.json",
"build:es": "tsc -p tsconfig.es.json",
"build": "yarn build:es && yarn build:cjs",
"postbuild": "downlevel-dts types types/ts3.4",
"postbuild": "downlevel-dts dist/types dist/types/ts3.4",
"test": "jest"

@@ -27,5 +26,6 @@ },

"dependencies": {
"@aws-sdk/property-provider": "3.8.0",
"@aws-sdk/shared-ini-file-loader": "3.8.0",
"@aws-sdk/types": "3.6.1",
"@aws-sdk/credential-provider-web-identity": "3.10.0",
"@aws-sdk/property-provider": "3.10.0",
"@aws-sdk/shared-ini-file-loader": "3.10.0",
"@aws-sdk/types": "3.10.0",
"tslib": "^1.8.0"

@@ -39,3 +39,3 @@ },

},
"types": "./types/index.d.ts",
"types": "./dist/types/index.d.ts",
"engines": {

@@ -42,0 +42,0 @@ "node": ">= 10.0.0"

@@ -8,3 +8,3 @@ # @aws-sdk/credential-provider-ini

This module provides a function, `fromSharedConfigFiles` that will create
This module provides a function, `fromIni` that will create
`CredentialProvider` functions that read from a shared credentials file at

@@ -14,3 +14,4 @@ `~/.aws/credentials` and a shared configuration file at `~/.aws/config`. Both

profiles. Sections in the credentials file are treated as profile names, whereas
profile sections in the config file must have the format of`[profile profile-name]`, except for the default profile. Please see the [sample
profile sections in the config file must have the format of`[profile profile-name]`,
except for the default profile. Please see the [sample
files](#sample-files) below for examples of well-formed configuration and

@@ -26,4 +27,3 @@ credentials files.

You may customize how credentials are resolved by providing an options hash to
the `fromSharedConfigFiles` factory function. The following options are
supported:
the `fromIni` factory function. The following options are supported:

@@ -44,3 +44,7 @@ - `profile` - The configuration profile to use. If not specified, the provider

- `roleAssumer` - A function that assumes a role and returns a promise
fulfilled with credentials for the assumed role.
fulfilled with credentials for the assumed role. You may call `sts:assumeRole`
API within this function.
- `roleAssumerWithWebIdentity` - A function that assumes a role with web identity
and returns a promise fulfilled with credentials for the assumed role. You may call
`sts:assumeRoleWithWebIdentity` API within this function.

@@ -84,1 +88,21 @@ ## Sample files

```
### source profile with static credentials
```ini
[second]
aws_access_key_id=foo
aws_secret_access_key=bar
[first]
source_profile=first
role_arn=arn:aws:iam::123456789012:role/example-role-arn
```
### profile with web_identity_token_file
```ini
[default]
web_identity_token_file=/temp/token
role_arn=arn:aws:iam::123456789012:role/example-role-arn
```

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

import { AssumeRoleWithWebIdentityParams, fromTokenFile } from "@aws-sdk/credential-provider-web-identity";
import { ProviderError } from "@aws-sdk/property-provider";

@@ -64,3 +65,3 @@ import {

/**
* A function that returna a promise fulfilled with an MFA token code for
* A function that returns a promise fulfilled with an MFA token code for
* the provided MFA Serial code. If a profile requires an MFA code and

@@ -82,2 +83,11 @@ * `mfaCodeProvider` is not a valid function, the credential provider

roleAssumer?: (sourceCreds: Credentials, params: AssumeRoleParams) => Promise<Credentials>;
/**
* A function that assumes a role with web identity and returns a promise fulfilled with
* credentials for the assumed role.
*
* @param sourceCreds The credentials with which to assume a role.
* @param params
*/
roleAssumerWithWebIdentity?: (params: AssumeRoleWithWebIdentityParams) => Promise<Credentials>;
}

@@ -98,2 +108,14 @@

interface WebIdentityProfile extends Profile {
web_identity_token_file: string;
role_arn: string;
role_session_name?: string;
}
const isWebIdentityProfile = (arg: any): arg is WebIdentityProfile =>
Boolean(arg) &&
typeof arg === "object" &&
typeof arg.web_identity_token_file === "string" &&
typeof arg.role_arn === "string" &&
["undefined", "string"].indexOf(typeof arg.role_session_name) > -1;
interface AssumeRoleProfile extends Profile {

@@ -104,3 +126,3 @@ role_arn: string;

const isAssumeRoleProfile = (arg: any): arg is AssumeRoleProfile =>
const isAssumeRoleWithSourceProfile = (arg: any): arg is AssumeRoleProfile =>
Boolean(arg) &&

@@ -162,3 +184,3 @@ typeof arg === "object" &&

// given precedence over static credentials.
if (isAssumeRoleProfile(data)) {
if (isAssumeRoleWithSourceProfile(data)) {
const {

@@ -213,2 +235,8 @@ external_id: ExternalId,

// If no static credentials are present, attempt to assume role with
// web identity if web_identity_token_file and role_arn is available
if (isWebIdentityProfile(data)) {
return resolveWebIdentityCredentials(data, options);
}
// If the profile cannot be parsed or contains neither static credentials

@@ -228,1 +256,9 @@ // nor role assumption metadata, throw an error. This should be considered a

});
const resolveWebIdentityCredentials = async (profile: WebIdentityProfile, options: FromIniInit): Promise<Credentials> =>
fromTokenFile({
webIdentityTokenFile: profile.web_identity_token_file,
roleArn: profile.role_arn,
roleSessionName: profile.role_session_name,
roleAssumerWithWebIdentity: options.roleAssumerWithWebIdentity,
})();
{
"compilerOptions": {
"declarationDir": "./types",
"declarationDir": "./dist/types",
"rootDir": "./src",

@@ -5,0 +5,0 @@ "outDir": "./dist/cjs",

{
"compilerOptions": {
"lib": ["es5", "es2015.promise", "es2015.collection"],
"declarationDir": "./types",
"declarationDir": "./dist/types",
"rootDir": "./src",

@@ -6,0 +6,0 @@ "outDir": "./dist/es",

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