@reventlessdev/reventless-core 3.0.0-alpha.313 → 3.0.0-alpha.314
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
CHANGED
|
@@ -3,6 +3,25 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# 3.0.0-alpha.314 (2026-10-29)
|
|
7
|
+
|
|
8
|
+
* feat(ppx)!: `@pii` marks a value about a person, and an event reads it as `Pii.t` ([37174c1](https://github.com/ReventlessDev/reventless-core/commit/37174c10eb80e9e3adbb93a52ad7a9ef5def7100))
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **core:** no log line prints a personal value ([af03709](https://github.com/ReventlessDev/reventless-core/commit/af037090770992c254e5dc69ab71ef251bad2db9))
|
|
12
|
+
|
|
13
|
+
### BREAKING CHANGES
|
|
14
|
+
|
|
15
|
+
* the ledger's events carry `address: Pii.t<Email.t>`. Pattern-match
|
|
16
|
+
`Value(address)` where the address is read.
|
|
17
|
+
|
|
18
|
+
The published per-platform PPX binary does not know `@pii` until it is republished.
|
|
19
|
+
|
|
20
|
+
Step PD2 of docs/plans/a-personal-field-is-marked-redacted-and-encrypted-at-the-seam.md.
|
|
21
|
+
Claude-Session: https://claude.ai/code/session_01HiQfdxVEsHwLHRoHSUcus1
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
6
25
|
# 3.0.0-alpha.313 (2026-10-29)
|
|
7
26
|
|
|
8
27
|
* feat(ppx)!: `@pii` marks a value about a person, and an event reads it as `Pii.t` ([37174c1](https://github.com/ReventlessDev/reventless-core/commit/37174c10eb80e9e3adbb93a52ad7a9ef5def7100))
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reventlessdev/reventless-core",
|
|
3
|
-
"version": "3.0.0-alpha.
|
|
3
|
+
"version": "3.0.0-alpha.314",
|
|
4
4
|
"description": "Core package for Reventless framework",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"jest": {
|
|
@@ -29,16 +29,16 @@
|
|
|
29
29
|
"sury": "11.0.0",
|
|
30
30
|
"uuid": "^13.0.0",
|
|
31
31
|
"@reventlessdev/rescript-effect": "1.0.0-alpha.1",
|
|
32
|
-
"@reventlessdev/rescript-hash-object": "1.2.0-alpha.15",
|
|
33
|
-
"@reventlessdev/rescript-node": "2.0.0-alpha.23",
|
|
34
32
|
"@reventlessdev/rescript-fast-csv": "2.0.0-alpha.23",
|
|
33
|
+
"@reventlessdev/rescript-hash-object": "1.2.0-alpha.15",
|
|
35
34
|
"@reventlessdev/rescript-jest": "1.0.0-alpha.13",
|
|
35
|
+
"@reventlessdev/rescript-node": "2.0.0-alpha.23",
|
|
36
36
|
"@reventlessdev/rescript-pulumi-pulumi": "3.0.0-alpha.0",
|
|
37
37
|
"@reventlessdev/rescript-ssh2": "2.0.0-alpha.24",
|
|
38
|
+
"@reventlessdev/reventless-infra": "3.0.0-alpha.211",
|
|
38
39
|
"@reventlessdev/rescript-uuid": "2.0.0-alpha.1",
|
|
39
|
-
"@reventlessdev/reventless-infra": "3.0.0-alpha.210",
|
|
40
40
|
"@reventlessdev/reventless-interop": "3.0.0-alpha.42",
|
|
41
|
-
"@reventlessdev/reventless-spec": "3.0.0-alpha.
|
|
41
|
+
"@reventlessdev/reventless-spec": "3.0.0-alpha.182"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"rescript": "12.3.1",
|
|
@@ -38,7 +38,7 @@ globalThis.describe("LogFormat", () => {
|
|
|
38
38
|
msgId: "testMsgId",
|
|
39
39
|
correlationId: "testCorrelationId"
|
|
40
40
|
};
|
|
41
|
-
let metaStr = JSON.stringify(Message$ReventlessCore.encode(meta, Message$ReventlessCore.metaSchema));
|
|
41
|
+
let metaStr = JSON.stringify(LogFormat$ReventlessCore.metaForLog(Message$ReventlessCore.encode(meta, Message$ReventlessCore.metaSchema)));
|
|
42
42
|
let arr = commands.map((command, idx) => ({
|
|
43
43
|
id: idx.toString(),
|
|
44
44
|
meta: meta,
|
|
@@ -84,7 +84,7 @@ globalThis.describe("LogFormat", () => {
|
|
|
84
84
|
msgId: "testMsgId",
|
|
85
85
|
correlationId: "testCorrelationId"
|
|
86
86
|
};
|
|
87
|
-
let metaStr = JSON.stringify(Message$ReventlessCore.encode(meta, Message$ReventlessCore.metaSchema));
|
|
87
|
+
let metaStr = JSON.stringify(LogFormat$ReventlessCore.metaForLog(Message$ReventlessCore.encode(meta, Message$ReventlessCore.metaSchema)));
|
|
88
88
|
let arr = commands.map((command, idx) => ({
|
|
89
89
|
id: idx.toString(),
|
|
90
90
|
meta: meta,
|
|
@@ -116,7 +116,7 @@ globalThis.describe("LogFormat", () => {
|
|
|
116
116
|
}
|
|
117
117
|
}, Sury.string, PluginSpec$ReventlessCore.eventSchema);
|
|
118
118
|
let msg = LogFormat$ReventlessCore.event$pJsonToLogMessage(eventJson$p);
|
|
119
|
-
globalThis.expect(msg).toEqual(`\x1b[1mVersionDetected\x1b[0m(testId): {"event":{"TAG":"VersionDetected","_0":"0.0.0"},"meta":{"service":"testService","time":"testTime","msgId":"testMsgId","correlationId":"testCorrelationId","
|
|
119
|
+
globalThis.expect(msg).toEqual(`\x1b[1mVersionDetected\x1b[0m(testId): {"event":{"TAG":"VersionDetected","_0":"0.0.0"},"meta":{"service":"testService","time":"testTime","msgId":"testMsgId","correlationId":"testCorrelationId","user":"testUser"},"id":"testId"}`);
|
|
120
120
|
});
|
|
121
121
|
});
|
|
122
122
|
globalThis.describe("variantFields", () => {
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
// The AES-256-GCM binding an encrypting provider seals values with.
|
|
2
|
+
|
|
3
|
+
open JestGlobals
|
|
4
|
+
|
|
5
|
+
let key = NodeCrypto.aesKey()
|
|
6
|
+
|
|
7
|
+
describe("NodeCrypto AES-256-GCM", () => {
|
|
8
|
+
testSync("round-trips, and never repeats a ciphertext", () => {
|
|
9
|
+
let a = NodeCrypto.aesGcmEncrypt(~key, "Ada Lovelace")
|
|
10
|
+
let b = NodeCrypto.aesGcmEncrypt(~key, "Ada Lovelace")
|
|
11
|
+
expect(a == b)->toBe(false)
|
|
12
|
+
expect(NodeCrypto.aesGcmDecrypt(~key, a))->toEqual(Ok("Ada Lovelace"))
|
|
13
|
+
expect(a->String.includes("Ada"))->toBe(false)
|
|
14
|
+
})
|
|
15
|
+
|
|
16
|
+
testSync("a tampered value does not open", () => {
|
|
17
|
+
let sealed = NodeCrypto.aesGcmEncrypt(~key, "Ada Lovelace")
|
|
18
|
+
let flipped = sealed->String.charAt(20) == "A" ? "B" : "A"
|
|
19
|
+
let tampered =
|
|
20
|
+
sealed->String.slice(~start=0, ~end=20) ++ flipped ++ sealed->String.slice(~start=21)
|
|
21
|
+
expect(NodeCrypto.aesGcmDecrypt(~key, tampered)->Result.isError)->toBe(true)
|
|
22
|
+
})
|
|
23
|
+
|
|
24
|
+
testSync("another key, or another aad, does not open it", () => {
|
|
25
|
+
let sealed = NodeCrypto.aesGcmEncrypt(~key, ~aad="member-1/name", "Ada")
|
|
26
|
+
expect(
|
|
27
|
+
NodeCrypto.aesGcmDecrypt(
|
|
28
|
+
~key=NodeCrypto.aesKey(),
|
|
29
|
+
~aad="member-1/name",
|
|
30
|
+
sealed,
|
|
31
|
+
)->Result.isError,
|
|
32
|
+
)->toBe(true)
|
|
33
|
+
expect(NodeCrypto.aesGcmDecrypt(~key, ~aad="member-2/name", sealed)->Result.isError)->toBe(true)
|
|
34
|
+
expect(NodeCrypto.aesGcmDecrypt(~key, ~aad="member-1/name", sealed))->toEqual(Ok("Ada"))
|
|
35
|
+
})
|
|
36
|
+
|
|
37
|
+
testSync("a value too short to hold a nonce and a tag is refused", () =>
|
|
38
|
+
expect(NodeCrypto.aesGcmDecrypt(~key, "AAAA")->Result.isError)->toBe(true)
|
|
39
|
+
)
|
|
40
|
+
})
|
|
@@ -5,6 +5,7 @@ import * as Pii$Reventless from "@reventlessdev/reventless-spec/src/components/P
|
|
|
5
5
|
import * as Semantic$Reventless from "@reventlessdev/reventless-spec/src/semantic/Semantic.res.mjs";
|
|
6
6
|
import * as Sensitive$Reventless from "@reventlessdev/reventless-spec/src/components/Sensitive.res.mjs";
|
|
7
7
|
import * as Util_Sury$Reventless from "@reventlessdev/reventless-spec/src/util/Util_Sury.res.mjs";
|
|
8
|
+
import * as LogFormat$ReventlessCore from "../../src/util/LogFormat.res.mjs";
|
|
8
9
|
import * as PiiMember$ReventlessCore from "./PiiMember.res.mjs";
|
|
9
10
|
import * as SuryToJsonSchema$ReventlessCore from "../../src/components/Api/SuryToJsonSchema.res.mjs";
|
|
10
11
|
|
|
@@ -140,6 +141,50 @@ globalThis.describe("the JSON schema", () => {
|
|
|
140
141
|
});
|
|
141
142
|
});
|
|
142
143
|
|
|
144
|
+
globalThis.describe("a log line of a @pii event or command", () => {
|
|
145
|
+
globalThis.test("holds no personal value, whichever formatter prints it", () => {
|
|
146
|
+
let eventJson = Util_Sury$Reventless.toJson(joined, PiiMember$ReventlessCore.eventSchema);
|
|
147
|
+
let envelope = Object.fromEntries([
|
|
148
|
+
[
|
|
149
|
+
"id",
|
|
150
|
+
"m-1"
|
|
151
|
+
],
|
|
152
|
+
[
|
|
153
|
+
"meta",
|
|
154
|
+
Object.fromEntries([[
|
|
155
|
+
"ip",
|
|
156
|
+
"10.0.0.1"
|
|
157
|
+
]])
|
|
158
|
+
],
|
|
159
|
+
[
|
|
160
|
+
"event",
|
|
161
|
+
eventJson
|
|
162
|
+
]
|
|
163
|
+
]);
|
|
164
|
+
let lines = [
|
|
165
|
+
LogFormat$ReventlessCore.eventDetail(envelope),
|
|
166
|
+
LogFormat$ReventlessCore.eventFull(envelope)
|
|
167
|
+
];
|
|
168
|
+
lines.forEach(line => {
|
|
169
|
+
globalThis.expect(line.includes("Ada")).toBe(false);
|
|
170
|
+
globalThis.expect(line.includes("ada@example.com")).toBe(false);
|
|
171
|
+
globalThis.expect(line.includes("mathematician")).toBe(false);
|
|
172
|
+
globalThis.expect(line.includes("10.0.0.1")).toBe(false);
|
|
173
|
+
globalThis.expect(line.includes("m-1")).toBe(true);
|
|
174
|
+
});
|
|
175
|
+
let join = {
|
|
176
|
+
TAG: "Join",
|
|
177
|
+
memberId: "m-1",
|
|
178
|
+
name: "Ada",
|
|
179
|
+
address: "ada@example.com"
|
|
180
|
+
};
|
|
181
|
+
let commandJson = Util_Sury$Reventless.toJson(join, PiiMember$ReventlessCore.commandSchema);
|
|
182
|
+
let label = LogFormat$ReventlessCore.cmdLabelOfJson(commandJson);
|
|
183
|
+
globalThis.expect(label.includes("Ada")).toBe(false);
|
|
184
|
+
globalThis.expect(label.includes("m-1")).toBe(true);
|
|
185
|
+
});
|
|
186
|
+
});
|
|
187
|
+
|
|
143
188
|
let M;
|
|
144
189
|
|
|
145
190
|
export {
|