Security News
NVD Backlog Tops 20,000 CVEs Awaiting Analysis as NIST Prepares System Updates
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
@aws-sdk/credential-provider-ini
Advanced tools
AWS credential provider that sources credentials from ~/.aws/credentials and ~/.aws/config
The @aws-sdk/credential-provider-ini package is a module that allows Node.js developers to load AWS credentials from INI-formatted files, such as the ones created by the AWS CLI. This package is part of the AWS SDK for JavaScript (v3) and is used to retrieve AWS credentials from local configuration files, enabling developers to authenticate AWS SDK calls.
Loading credentials from a shared INI file
This feature allows developers to load AWS credentials from a shared INI file, typically located at `~/.aws/credentials`. The `fromIni` function reads the file and returns the credentials for the default profile or a specified profile.
const { fromIni } = require('@aws-sdk/credential-provider-ini');
const credentials = fromIni();
Specifying a custom profile
Developers can specify a custom profile to load credentials for a specific AWS account or role. This is useful when working with multiple AWS accounts or when different permissions are needed.
const { fromIni } = require('@aws-sdk/credential-provider-ini');
const credentials = fromIni({ profile: 'myCustomProfile' });
Assuming a role with MFA
This feature supports assuming an IAM role that requires Multi-Factor Authentication (MFA). The `mfaCodeProvider` is a function that returns the MFA code, which is then used to assume the role.
const { fromIni } = require('@aws-sdk/credential-provider-ini');
const credentials = fromIni({
profile: 'myRoleProfile',
mfaCodeProvider: async () => '123456', // Replace with actual MFA code provider
});
The original AWS SDK for JavaScript (v2) includes credential loading capabilities similar to @aws-sdk/credential-provider-ini. It allows loading credentials from INI files, but it is part of a larger package rather than a modular approach taken by the newer AWS SDK (v3).
This package provides utilities for working with AWS profiles stored in INI files. It offers similar functionality for loading credentials but is not officially maintained by AWS and may not have the same level of support or integration with the AWS SDK.
awscred is another npm package that can load AWS credentials from various sources, including INI files. It provides a simple interface for retrieving credentials but does not offer the modular, per-service approach of the AWS SDK (v3).
An internal package
You probably shouldn't, at least directly. Please use @aws-sdk/credential-providers instead.
FAQs
AWS credential provider that sources credentials from ~/.aws/credentials and ~/.aws/config
The npm package @aws-sdk/credential-provider-ini receives a total of 19,138,214 weekly downloads. As such, @aws-sdk/credential-provider-ini popularity was classified as popular.
We found that @aws-sdk/credential-provider-ini demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.
Security News
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.