AWS SDK for JavaScript STS Client for Node.js, Browser and React Native, providing temporary security credentials and role assumption capabilities
92
Evaluation — 92%
↑ 1.05xAgent success when using this tile
A command-line utility that helps users switch between different AWS roles using temporary security credentials.
The utility should assume a specified IAM role using temporary security credentials. It should accept a role ARN and session name as input parameters, and return the temporary credentials (access key, secret key, and session token).
The utility should retrieve information about the AWS identity making the request. This includes the account ID, user ID, and ARN of the calling entity.
The utility should allow configuration of the AWS region for the STS client. The region should be configurable and the client should use this region for all subsequent operations.
@generates
/**
* Configuration options for the role switcher
*/
export interface RoleSwitcherConfig {
region: string;
}
/**
* Temporary credentials returned after role assumption
*/
export interface TemporaryCredentials {
accessKeyId: string;
secretAccessKey: string;
sessionToken: string;
expiration?: Date;
}
/**
* Identity information for the current caller
*/
export interface CallerIdentity {
userId: string;
account: string;
arn: string;
}
/**
* Creates a role switcher with the specified configuration
*/
export function createRoleSwitcher(config: RoleSwitcherConfig): RoleSwitcher;
/**
* Role switcher class for managing AWS role assumptions
*/
export class RoleSwitcher {
constructor(config: RoleSwitcherConfig);
/**
* Assumes the specified IAM role and returns temporary credentials
* @param roleArn - The ARN of the role to assume
* @param sessionName - A name for the assumed role session
* @returns Temporary credentials for the assumed role
* @throws Error if the role ARN is invalid or assumption fails
*/
assumeRole(roleArn: string, sessionName: string): Promise<TemporaryCredentials>;
/**
* Gets information about the current caller identity
* @returns Identity information for the current caller
*/
getCallerIdentity(): Promise<CallerIdentity>;
}Provides AWS Security Token Service operations for managing temporary security credentials and role assumption.
@satisfied-by
Install with Tessl CLI
npx tessl i tessl/npm-aws-sdk--client-stsdocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10