Security News
JSR Working Group Kicks Off with Ambitious Roadmap and Plans for Open Governance
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
@aws-sdk/middleware-sdk-sts
Advanced tools
[![NPM version](https://img.shields.io/npm/v/@aws-sdk/middleware-sdk-sts/latest.svg)](https://www.npmjs.com/package/@aws-sdk/middleware-sdk-sts) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/middleware-sdk-sts.svg)](https://www.npmjs.com/packag
@aws-sdk/middleware-sdk-sts is a middleware package for the AWS SDK for JavaScript. It provides functionality to interact with AWS Security Token Service (STS), which allows you to request temporary, limited-privilege credentials for AWS Identity and Access Management (IAM) users or federated users.
AssumeRole
This feature allows you to assume a role and obtain temporary security credentials. The code sample demonstrates how to use the AssumeRoleCommand to assume a role and log the temporary credentials.
const { STSClient, AssumeRoleCommand } = require('@aws-sdk/client-sts');
const client = new STSClient({ region: 'us-west-2' });
const command = new AssumeRoleCommand({
RoleArn: 'arn:aws:iam::123456789012:role/demo',
RoleSessionName: 'demoSession'
});
client.send(command).then((data) => {
console.log(data.Credentials);
}).catch((error) => {
console.error(error);
});
GetCallerIdentity
This feature allows you to retrieve details about the IAM user or role whose credentials are used to call the operation. The code sample demonstrates how to use the GetCallerIdentityCommand to get the caller's identity.
const { STSClient, GetCallerIdentityCommand } = require('@aws-sdk/client-sts');
const client = new STSClient({ region: 'us-west-2' });
const command = new GetCallerIdentityCommand({});
client.send(command).then((data) => {
console.log(data);
}).catch((error) => {
console.error(error);
});
@aws-sdk/client-iam is another AWS SDK package that provides functionalities to interact with AWS Identity and Access Management (IAM). While @aws-sdk/middleware-sdk-sts focuses on temporary security credentials, @aws-sdk/client-iam provides broader IAM functionalities such as managing users, groups, roles, and policies.
aws-sdk is the official AWS SDK for JavaScript, which includes a wide range of AWS services, including STS. It provides a more comprehensive set of features compared to @aws-sdk/middleware-sdk-sts, which is specialized for STS-related operations.
3.78.0 (2022-04-26)
FAQs
[![NPM version](https://img.shields.io/npm/v/@aws-sdk/middleware-sdk-sts/latest.svg)](https://www.npmjs.com/package/@aws-sdk/middleware-sdk-sts) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/middleware-sdk-sts.svg)](https://www.npmjs.com/packag
The npm package @aws-sdk/middleware-sdk-sts receives a total of 3,441,128 weekly downloads. As such, @aws-sdk/middleware-sdk-sts popularity was classified as popular.
We found that @aws-sdk/middleware-sdk-sts 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
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
Security News
Research
An advanced npm supply chain attack is leveraging Ethereum smart contracts for decentralized, persistent malware control, evading traditional defenses.
Security News
Research
Attackers are impersonating Sindre Sorhus on npm with a fake 'chalk-node' package containing a malicious backdoor to compromise developers' projects.