@crvouga/ mockingbird-service-kms (英语)
本地模拟器。 真正的API合同. 部分 嘲笑鸟。 。 。 .
亚马逊密钥管理服务的州立地方模拟器. 无害环境管理;节点22+或Bun 1.2+.
使用量
import { CreateKeyCommand, DecryptCommand, EncryptCommand, KMSClient } from "@aws-sdk/client-kms"
import { createServer } from "@crvouga/mockingbird-service-kms/server"
// Test setup: the KMS client your application already uses, pointed at the emulator.
const server = await createServer()
const kms = new KMSClient({
endpoint: server.url,
region: "us-east-1",
credentials: { accessKeyId: "fixture", secretAccessKey: "fixture" },
})
// Application code, unchanged.
const { KeyMetadata } = await kms.send(new CreateKeyCommand({ Description: "orders" }))
const { CiphertextBlob } = await kms.send(
new EncryptCommand({ KeyId: KeyMetadata?.KeyId, Plaintext: new TextEncoder().encode("secret") }),
)
const { Plaintext } = await kms.send(new DecryptCommand({ CiphertextBlob }))
// new TextDecoder().decode(Plaintext) === "secret"
await server.close()
国家住在SQLite收藏 并参与共享运行时间命名空间隔离, 重置,时间表,时钟,日记,度量衡和故障控制. 不需要 AWS 账户 .
已执行的AWS业务: CreateKey, (中文(简体) ), DescribeKey, (中文(简体) ), ListKeys, (中文(简体) ), EnableKey, (中文(简体) ), DisableKey, (中文(简体) ), ScheduleKeyDeletion, (中文(简体) ), CancelKeyDeletion, (中文(简体) ), CreateAlias, (中文(简体) ), UpdateAlias, (中文(简体) ), DeleteAlias, (中文(简体) ), ListAliases, (中文(简体) ), Encrypt, (中文(简体) ), Decrypt, (中文(简体) ), ReEncrypt, (中文(简体) ), GenerateDataKey, (中文(简体) ), GenerateDataKeyWithoutPlaintext, (中文(简体) ), GetKeyPolicy, (中文(简体) ), PutKeyPolicy, (中文(简体) ), ListKeyPolicies, (中文(简体) ), EnableKeyRotation, (中文(简体) ), DisableKeyRotation, (中文(简体) ), GetKeyRotationStatus, (中文(简体) ), TagResource, (中文(简体) ), UntagResource, (中文(简体) ), ListResourceTags。 。 。 .
本列表以外的操作明显失败 。 这个软件包模拟了API状态,而不是AWS基础设施, 生产配额、计费、IAM执行或供应商控制台。 特定服务的疏漏和 甲骨文证据记录于 aWS 覆盖分类账。 。 。 .
运行 bun run parity 启用本地端盘 http://127.0.0.1:4566; 不可用预告失败运行 .
没有记录此整合的本地Stack 运行 。 等同指令是一个有边框的只读 SDK 信封探测器,而不是完全供应商等同的证据.
安装
bun add @crvouga/mockingbird-service-kms
API 密码
-
KmsAPI(options?): 低级 AWS 运输实例fetch财务报告和审定财务报表reset。 。 。 . -
createRuntime(options?):在进程中获取 API 和共享状态控制 . -
createServer(options?)从/server条目: HTTP 收听器url, (中文(简体) ),runtime,以及close()。 。 。 . -
document, (中文(简体) ),operationIds,以及supportedOperationIds:生成运输合同元数据.