@aws-lite/sts

中文文档
0.1.2发布于 2024/08/02Apache-2.0ES Module零依赖近 30 天下载 8308

Official aws-lite plugin for STS

原始使用文档
文档目录13 节
  1. Install
  2. Reference
  3. Reference
  4. Methods
  5. AssumeRole
  6. AssumeRoleWithSAML
  7. AssumeRoleWithWebIdentity
  8. DecodeAuthorizationMessage
  9. GetAccessKeyInfo
  10. GetCallerIdentity
  11. GetFederationToken
  12. GetSessionToken
  13. Learn more

@aws-lite/sts

Official aws-lite plugin for STS

Maintained by: @architect

Install

npm i @aws-lite/sts

Optionally install types:

npm i -D @aws-lite/sts-types

Reference

Reference documentation with examples at aws-lite.org

Reference

Reference documentation with examples at aws-lite.org

Methods

AssumeRole

Canonical AWS API doc

Properties:

  • RoleArn (string) [required]
    • ARN of the role to assume
  • RoleSessionName (string) [required]
    • Identifier for the assumed role session; must conform to [w+=,.@-]*
  • DurationSeconds (number)
    • Duration of the role session; from 900 to 43200
  • ExternalId (string)
    • Unique identifier that might be required when assuming a role in another account
  • Policy (string)
    • JSON IAM policy document to use as an inline session policy
  • PolicyArns (array)
    • ARNs of the IAM managed policies to use
  • ProvidedContexts (array)
    • List of previously acquired trusted context assertions in the format of a JSON array
    • More details (AWS)
  • SerialNumber (string)
    • MFA device ID associated with the user making the call
  • SourceIdentity (string)
    • Source identity specified by the principal making the call
  • Tags (array)
    • Session tags; each tag is an object containing a Key and Value property
  • TokenCode (string)
    • MFA value (if required by the role's trust policy)
  • TransitiveTagKeys (array)
    • Session tags, set as transitive to subsequent sessions in the role chain
    • More details (AWS)

AssumeRoleWithSAML

Canonical AWS API doc

Properties:

  • RoleArn (string) [required]
    • ARN of the role to assume
  • PrincipalArn (string) [required]
    • ARN of the SAML provider that describes the IdP
  • SAMLAssertion (string) [required]
    • base64-encoded SAML authentication response provided by the IdP
  • DurationSeconds (number)
    • Duration of the role session; from 900 to 43200
  • Policy (string)
    • JSON IAM policy document to use as an inline session policy
  • PolicyArns (array)
    • ARNs of the IAM managed policies to use

AssumeRoleWithWebIdentity

Canonical AWS API doc

Properties:

  • RoleArn (string) [required]
    • ARN of the role to assume
  • RoleSessionName (string) [required]
    • Identifier for the assumed role session; must conform to [w+=,.@-]*
  • WebIdentityToken (string) [required]
    • OAuth 2.0 access token or OpenID Connect ID token provided by the IdP
  • DurationSeconds (number)
    • Duration of the role session; from 900 to 43200
  • ProviderId (string)
    • Fully qualified host of the domain name of the OAuth 2.0 IdP; do not specify this value for an OpenID Connect identity provider
  • Policy (string)
    • JSON IAM policy document to use as an inline session policy
  • PolicyArns (array)
    • ARNs of the IAM managed policies to use

DecodeAuthorizationMessage

Canonical AWS API doc

Properties:

  • EncodedMessage (string) [required]
    • Encoded message returned with the response

GetAccessKeyInfo

Canonical AWS API doc

Properties:

  • AccessKeyId (string) [required]
    • AWS access key to query

GetCallerIdentity

Canonical AWS API doc

Properties:

GetFederationToken

Canonical AWS API doc

Properties:

  • Name (string) [required]
    • Name of the federated user
  • DurationSeconds (number)
    • Duration of the role session; from 900 to 43200
  • Policy (string)
    • JSON IAM policy document to use as an inline session policy
  • PolicyArns (array)
    • ARNs of the IAM managed policies to use
  • Tags (array)
    • Session tags; each tag is an object containing a Key and Value property

GetSessionToken

Canonical AWS API doc

Properties:

  • DurationSeconds (number)
    • Duration of the role session; from 900 to 43200
  • SerialNumber (string)
    • MFA device ID associated with the user making the call
  • TokenCode (string)
    • MFA value (if required by the role's trust policy)

Learn more

版本与发布记录

@aws-lite/sts 共发布 4 个版本,首次发布于 2024/05/18;过去 12 个月发布了 0 个版本。

版本发布日期距今
0.1.2latest2024/08/022 年前
0.1.12024/08/012 年前
0.1.02024/05/292 年前
0.0.02024/05/182 年前

关于 @aws-lite/sts 的常见问题

@aws-lite/sts 是什么?

Official aws-lite plugin for STS

如何安装 @aws-lite/sts?

在项目目录运行 npm install @aws-lite/sts,或使用 pnpm add / yarn add / bun add。

@aws-lite/sts 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/aws-lite__sts 是否存在。

@aws-lite/sts 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@aws-lite/sts 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=16。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@aws-lite/sts 可以商用吗?

@aws-lite/sts 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@aws-lite/sts 的下载量有多少?

根据 npm 官方下载统计,@aws-lite/sts 在 2026/10/08 – 2026/11/06 这 30 天内被下载 8,308 次,日均约 277 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@aws-lite/sts 还在维护吗?

最新版本 0.1.2 发布于 2024/08/02(2 年前);至今共发布 4 个版本,其中过去 12 个月发布了 0 个;首次发布于 2024/05/18。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。