@intentius/behold 0.2.3 → 0.3.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/AGENTS.md +64 -0
- package/README.md +25 -1
- package/dist/cli.js +298 -88
- package/example-writes/README.md +88 -0
- package/example-writes/chant.config.ts +12 -0
- package/example-writes/ops/apply.op.ts +7 -0
- package/example-writes/ops/floci.op.ts +20 -0
- package/example-writes/ops/reconcile.op.ts +6 -0
- package/example-writes/package-lock.json +1249 -0
- package/example-writes/package.json +14 -0
- package/example-writes/src/bucket.ts +54 -0
- package/example-writes/tsconfig.json +1 -0
- package/package.json +4 -2
- package/web/app.js +468 -115
- package/web/index.html +143 -91
- package/web/panel.js +163 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "behold-example-writes",
|
|
3
|
+
"private": true,
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "A cheap AWS project (one S3 bucket) + Ops, for behold's delegated Sync/Adopt demos.",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"build": "./node_modules/.bin/chant build src --lexicon aws -o template.json"
|
|
8
|
+
},
|
|
9
|
+
"dependencies": {
|
|
10
|
+
"@intentius/chant": "^0.32.0",
|
|
11
|
+
"@intentius/chant-lexicon-aws": "^0.32.0",
|
|
12
|
+
"@intentius/chant-lexicon-temporal": "^0.32.0"
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Bucket,
|
|
3
|
+
Bucket_PublicAccessBlockConfiguration,
|
|
4
|
+
Bucket_BucketEncryption,
|
|
5
|
+
Bucket_ServerSideEncryptionRule,
|
|
6
|
+
Bucket_ServerSideEncryptionByDefault,
|
|
7
|
+
S3BucketPolicy,
|
|
8
|
+
Ref,
|
|
9
|
+
} from "@intentius/chant-lexicon-aws";
|
|
10
|
+
|
|
11
|
+
// One S3 bucket — the whole "infra" for behold's first-apply demo. With
|
|
12
|
+
// `behold serve … --local` this deploys to the local Floci emulator (no cloud
|
|
13
|
+
// creds); against a real account, change BucketName to something globally unique.
|
|
14
|
+
export const store = new Bucket({
|
|
15
|
+
BucketName: "behold-floci-demo",
|
|
16
|
+
PublicAccessBlockConfiguration: new Bucket_PublicAccessBlockConfiguration({
|
|
17
|
+
BlockPublicAcls: true,
|
|
18
|
+
BlockPublicPolicy: true,
|
|
19
|
+
IgnorePublicAcls: true,
|
|
20
|
+
RestrictPublicBuckets: true,
|
|
21
|
+
}),
|
|
22
|
+
// Server-side encryption (WAW006).
|
|
23
|
+
BucketEncryption: new Bucket_BucketEncryption({
|
|
24
|
+
ServerSideEncryptionConfiguration: [
|
|
25
|
+
new Bucket_ServerSideEncryptionRule({
|
|
26
|
+
ServerSideEncryptionByDefault: new Bucket_ServerSideEncryptionByDefault({ SSEAlgorithm: "AES256" }),
|
|
27
|
+
}),
|
|
28
|
+
],
|
|
29
|
+
}),
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
// Deny non-TLS access (WAW042). Both values are hoisted to consts so they're plain
|
|
33
|
+
// identifier references in the constructor (EVL001 forbids call expressions and
|
|
34
|
+
// inline objects as property values). `Ref(store)` ties the policy to `store` by
|
|
35
|
+
// logical id, which is how WAW042 matches policy → bucket.
|
|
36
|
+
const storeRef = Ref(store);
|
|
37
|
+
const denyInsecureTransport = {
|
|
38
|
+
Version: "2012-10-17",
|
|
39
|
+
Statement: [
|
|
40
|
+
{
|
|
41
|
+
Sid: "DenyInsecureTransport",
|
|
42
|
+
Effect: "Deny",
|
|
43
|
+
Principal: "*",
|
|
44
|
+
Action: "s3:*",
|
|
45
|
+
Resource: ["arn:aws:s3:::behold-floci-demo", "arn:aws:s3:::behold-floci-demo/*"],
|
|
46
|
+
Condition: { Bool: { "aws:SecureTransport": "false" } },
|
|
47
|
+
},
|
|
48
|
+
],
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export const storePolicy = new S3BucketPolicy({
|
|
52
|
+
Bucket: storeRef,
|
|
53
|
+
PolicyDocument: denyInsecureTransport,
|
|
54
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{ "compilerOptions": { "target": "ES2022", "module": "ESNext", "moduleResolution": "Bundler", "strict": true, "skipLibCheck": true, "noEmit": true }, "include": ["src/**/*", "ops/**/*", "chant.config.ts"] }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intentius/behold",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "behold — a live control plane on chant. See your whole estate (every substrate in one graph), coloured by drift; act through delegated, gated Ops.",
|
|
6
6
|
"bin": {
|
|
@@ -9,7 +9,9 @@
|
|
|
9
9
|
"files": [
|
|
10
10
|
"bin",
|
|
11
11
|
"dist",
|
|
12
|
-
"web"
|
|
12
|
+
"web",
|
|
13
|
+
"example-writes",
|
|
14
|
+
"AGENTS.md"
|
|
13
15
|
],
|
|
14
16
|
"publishConfig": {
|
|
15
17
|
"access": "public",
|