@datacules/agent-identity-store-aws 0.8.0 → 0.10.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/README.md +59 -0
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="../../../assets/logo.svg" alt="Agent Identity — by Datacules LLC" width="360"/>
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
# `@datacules/agent-identity-store-aws`
|
|
6
|
+
|
|
7
|
+
AWS Secrets Manager + DynamoDB credential store for the agent-identity framework. Drop-in replacement for `MemoryCredentialStore`.
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install @datacules/agent-identity-store-aws
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Requires AWS SDK v3 (`@aws-sdk/client-secrets-manager`, `@aws-sdk/client-dynamodb`) as peer dependencies.
|
|
16
|
+
|
|
17
|
+
## Usage
|
|
18
|
+
|
|
19
|
+
```typescript
|
|
20
|
+
import { AwsCredentialStore } from '@datacules/agent-identity-store-aws';
|
|
21
|
+
import { createRouterFromStore } from '@datacules/agent-identity';
|
|
22
|
+
|
|
23
|
+
const store = new AwsCredentialStore({
|
|
24
|
+
region: 'us-east-1',
|
|
25
|
+
// Optional: DynamoDB table for reservation locks (prevents concurrent migration corruption)
|
|
26
|
+
dynamoTableName: 'agent-identity-locks',
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
const router = createRouterFromStore(store, rules, logger);
|
|
30
|
+
const resolved = await router.resolveAsync(ctx);
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## What it does
|
|
34
|
+
|
|
35
|
+
- **`findByRef(ref)`** — calls `GetSecretValue` on Secrets Manager for the given ref.
|
|
36
|
+
- **`reserve(ref, migrationId, ttlSeconds)`** — puts a conditional item in DynamoDB to lock the credential for one migration run.
|
|
37
|
+
- **`release(ref, migrationId)`** — deletes the DynamoDB lock item.
|
|
38
|
+
- **`listActive()` / `listByKind()`** — reads the credential index from Secrets Manager.
|
|
39
|
+
|
|
40
|
+
Credential secrets are fetched lazily on `resolve()` — they are never cached in memory beyond the current request.
|
|
41
|
+
|
|
42
|
+
## IAM permissions required
|
|
43
|
+
|
|
44
|
+
```json
|
|
45
|
+
{
|
|
46
|
+
"Effect": "Allow",
|
|
47
|
+
"Action": [
|
|
48
|
+
"secretsmanager:GetSecretValue",
|
|
49
|
+
"secretsmanager:ListSecrets"
|
|
50
|
+
],
|
|
51
|
+
"Resource": "arn:aws:secretsmanager:*:*:secret:agent-identity/*"
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
For reservation locks, also grant `dynamodb:PutItem`, `dynamodb:DeleteItem`, `dynamodb:GetItem` on the locks table.
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
Part of the [agent-identity monorepo](https://github.com/hvrcharon1/agent-identity) by [Datacules LLC](https://datacules.com).
|
package/package.json
CHANGED