# @crvouga/mockingbird-service-sts 中文文档

规范地址：https://npmcn.com/package/%40crvouga/mockingbird-service-sts/

版本：1\.10\.0
npm 元数据更新时间：2026-11-11T02:39:44.092Z
中文译文更新时间：2026-11-11T09:46:07.986Z
软件包许可：MIT

本文由上游 README 翻译，可能存在偏差，请结合原文核对 API、命令与配置。版权与许可归原作者所有。

原始 npm 页面：https://www.npmjs.com/package/%40crvouga/mockingbird-service-sts
原文对照：https://npmcn.com/package/%40crvouga/mockingbird-service-sts/?lang=original
项目主页：https://github.com/crvouga/mockingbird/tree/main/packages/service/sts#readme
源码仓库：https://github.com/crvouga/mockingbird

## 关键信息（来自 npm 元数据）

- 包体积（解压后）：4.7 MB，18 个文件
- 模块格式：ES Module
- TypeScript 类型：包内自带
- 运行依赖：1 个
- 首次发布：2026-10-05T09:31:29.417Z
- 最新版本发布：2026-11-11T02:39:43.708Z
- 近 30 天下载量：2367（2026-10-11 至 2026-11-09，npm 官方下载统计）
- 已发布版本数：18（近 12 个月 18 个）

## 中文简介

具有AWS SDK电线相容性和定点局部控制的状态的亚马逊安全托肯服务模拟器.

## 安装

```sh
npm install @crvouga/mockingbird-service-sts
```

也可以使用：`pnpm add @crvouga/mockingbird-service-sts`、`yarn add @crvouga/mockingbird-service-sts`、`bun add @crvouga/mockingbird-service-sts`

## README

# @crvouga/ mockingbird-service-sts (英语)

> 本地模拟器。 真正的API合同. 部分 [嘲笑鸟](https://github.com/crvouga/mockingbird)。 。 。 .

Amazon Security Token Service的州立地方模拟器。 无害环境管理;节点22+或Bun 1.2+.

## 使用量

```ts
import { AssumeRoleCommand, GetCallerIdentityCommand, STSClient } from "@aws-sdk/client-sts"
import { createServer } from "@crvouga/mockingbird-service-sts/server"

// Test setup: start the emulator and point the SDK's endpoint at it.
const server = await createServer()
const sts = new STSClient({
  endpoint: server.url,
  region: "us-east-1",
  credentials: { accessKeyId: "fixture", secretAccessKey: "fixture" },
})

// Application code: the STS SDK calls it already makes.
const identity = await sts.send(new GetCallerIdentityCommand({}))
console.log(identity.Arn) // arn:aws:iam::000000000000:root
const assumed = await sts.send(
  new AssumeRoleCommand({
    RoleArn: "arn:aws:iam::000000000000:role/deploy",
    RoleSessionName: "ci",
  }),
)
console.log(assumed.AssumedRoleUser?.Arn) // arn:aws:sts::000000000000:assumed-role/deploy/ci

await server.close()
```

国家住在SQLite收藏 并参与共享运行时间命名空间隔离, 重置,时间表,时钟,日记,度量衡和故障控制. 不需要 AWS 账户 .

已执行的AWS业务: `GetCallerIdentity`, (中文(简体) ), `AssumeRole`, (中文(简体) ), `GetSessionToken`, (中文(简体) ), `GetFederationToken`。 。 。 .

本列表以外的操作明显失败 。 这个软件包模拟了API状态,而不是AWS基础设施, 生产配额、计费、IAM执行或供应商控制台。 特定服务的疏漏和 甲骨文证据记录于 [aWS 覆盖分类账](https://npmcn.com/docs/AWS_COVERAGE.md)。 。 。 .

运行 `bun run parity` 启用本地端盘 `http://127.0.0.1:4566`; 不可用预告失败运行 . 没有记录此整合的本地Stack 运行 。 等同指令是一个有边框的只读 SDK 信封探测器,而不是完全供应商等同的证据.

## 安装

```sh
bun add @crvouga/mockingbird-service-sts
```

## API 密码

-   `StsAPI(options?)`: 低级 AWS 运输实例 `fetch` 财务报告和审定财务报表 `reset`。 。 。 .
    
-   `createRuntime(options?)`:在进程中获取 API 和共享状态控制 .
    
-   `createServer(options?)` 从 `/server` 条目: HTTP 收听器 `url`, (中文(简体) ), `runtime`,以及 `close()`。 。 。 .
    
-   `document`, (中文(简体) ), `operationIds`,以及 `supportedOperationIds`:生成运输合同元数据.

## 常见问题

### @crvouga/mockingbird-service-sts 是什么？

具有AWS SDK电线相容性和定点局部控制的状态的亚马逊安全托肯服务模拟器\.

### 如何安装 @crvouga/mockingbird-service-sts？

在项目目录运行 npm install @crvouga/mockingbird-service-sts，或使用 pnpm add / yarn add / bun add。它还提供命令行工具 mockingbird-sts，可以用 npx mockingbird-sts 直接运行。

### @crvouga/mockingbird-service-sts 支持 TypeScript 吗？

支持。包内自带 TypeScript 类型声明（package\.json 声明了 types 入口），安装后即可获得类型提示，无需再安装 @types 包。

### @crvouga/mockingbird-service-sts 支持 ESM 还是 CommonJS？

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

### @crvouga/mockingbird-service-sts 可以商用吗？

@crvouga/mockingbird-service-sts 使用 MIT 许可。宽松许可：允许商业使用、修改和再分发，通常只需在分发时保留原版权与许可声明。以上为概括，不构成法律意见，请以许可原文为准。

### @crvouga/mockingbird-service-sts 的下载量有多少？

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

### @crvouga/mockingbird-service-sts 还在维护吗？

最新版本 1\.10\.0 发布于 2026/11/11（今天）；至今共发布 18 个版本，其中过去 12 个月发布了 18 个；首次发布于 2026/10/05。发布频率只是参考信号：功能稳定的工具可能很少需要更新，建议结合源码仓库的 issue 和提交记录判断。

