@crvouga/mockingbird-service-aws-secrets 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +5 -0
- package/README.md +51 -0
- package/dist/chunk-H7EQJKEP.js +2491 -0
- package/dist/chunk-H7EQJKEP.js.map +7 -0
- package/dist/chunk-SXELSHDC.js +330 -0
- package/dist/chunk-SXELSHDC.js.map +7 -0
- package/dist/cli.js +19 -0
- package/dist/cli.js.map +7 -0
- package/dist/index.d.ts +865 -0
- package/dist/index.js +21 -0
- package/dist/index.js.map +7 -0
- package/dist/server.d.ts +1213 -0
- package/dist/server.js +12 -0
- package/dist/server.js.map +7 -0
- package/package.json +86 -0
package/CHANGELOG.md
ADDED
package/README.md
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# @crvouga/mockingbird-service-aws-secrets
|
|
2
|
+
|
|
3
|
+
Stateful, portable mock of AWS Secrets Manager and SSM Parameter Store for the official AWS SDK v3 clients. It models secret versions and stages, binary values, deterministic rotation, SecureString metadata, parameter versions, denials, decryption failures, and redacted controls without contacting AWS.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install -D @crvouga/mockingbird-service-aws-secrets
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
ESM only. Node 22+ or Bun 1.2+.
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
Point both clients' `endpoint` option at the same mock URL. Fixture SigV4 credentials are accepted.
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
import { createServer } from "@crvouga/mockingbird-service-aws-secrets/server"
|
|
19
|
+
|
|
20
|
+
const mock = await createServer({
|
|
21
|
+
secrets: [{ name: "database/password", value: "fixture-password" }],
|
|
22
|
+
parameters: [{ name: "/app/region", value: "us-east-1" }],
|
|
23
|
+
})
|
|
24
|
+
const health = await fetch(`${mock.url}/health`)
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Secrets Manager supports CreateSecret, PutSecretValue, GetSecretValue, and DescribeSecret by name or ARN, including VersionId, VersionStage, SecretString, and SecretBinary. SSM supports PutParameter, GetParameter, and GetParameters with String, StringList, SecureString, WithDecryption, versions, ARNs, and data types.
|
|
28
|
+
|
|
29
|
+
### Admin and deterministic controls
|
|
30
|
+
|
|
31
|
+
- `GET /__admin/secrets` and `/__admin/parameters` expose metadata with every value redacted.
|
|
32
|
+
- `POST /__admin/secrets/:name/rotate` atomically moves AWSCURRENT to AWSPREVIOUS.
|
|
33
|
+
- `PUT /__admin/controls/:name` configures denial, stale-version reads, or decryption failure.
|
|
34
|
+
- Fault presets are `throttled` and `unavailable`.
|
|
35
|
+
|
|
36
|
+
Values are encoded in durable state so timelines and snapshots do not contain plaintext markers. Request journals never record request or response bodies. The shared runtime also provides reset, clock, timeline, metrics, faults, and namespace isolation through `x-mockingbird-namespace`, `/ns/<name>`, or SigV4 access-key mappings.
|
|
37
|
+
|
|
38
|
+
### Deliberately not modelled
|
|
39
|
+
|
|
40
|
+
KMS cryptography, automatic rotation Lambdas, resource policies, replication, SSM hierarchies and labels beyond the supported reads, production quotas, AWS dashboards, billing, and outbound vendor calls are not modelled. SecureString ciphertext returned without decryption is deterministic mock ciphertext, not KMS output.
|
|
41
|
+
|
|
42
|
+
## API
|
|
43
|
+
|
|
44
|
+
- `AwsSecretsAPI`, `AwsSecretsAPIOptions`, `SecretSeed`, `ParameterSeed`: portable handler and fixtures.
|
|
45
|
+
- `Secret`, `SecretVersion`, `SecretControl`, `Parameter`: durable state types.
|
|
46
|
+
- `createRuntime`, `AwsSecretsRuntime`, `AwsSecretsRuntimeOptions`: full Mockingbird runtime.
|
|
47
|
+
- `AWS_SECRETS_NAMESPACE`, `AWS_SECRETS_PRESETS`, `accessKeyCredential`: constants and controls.
|
|
48
|
+
- `document`, `operationIds`, `supportedOperationIds`: generated OpenAPI metadata.
|
|
49
|
+
- `createServer`, `AwsSecretsServerOptions`, `DEFAULT_PORT`, `serveTarget` from `./server`: Node HTTP adapter and CLI integration.
|
|
50
|
+
|
|
51
|
+
Official oracles: [AWS Secrets Manager API Reference](https://docs.aws.amazon.com/secretsmanager/latest/apireference/Welcome.html) and [AWS Systems Manager API Reference](https://docs.aws.amazon.com/systems-manager/latest/APIReference/Welcome.html).
|