@forumone/throughline-approvals 0.7.1 → 0.8.1
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 +39 -0
- package/dist/tokens.d.ts.map +1 -1
- package/dist/tokens.js +21 -1
- package/dist/tokens.js.map +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,44 @@
|
|
|
1
1
|
# @forumone/throughline-approvals
|
|
2
2
|
|
|
3
|
+
## 0.8.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [262768a]
|
|
8
|
+
- @forumone/throughline-publishing@0.9.2
|
|
9
|
+
- @forumone/throughline-core@0.8.2
|
|
10
|
+
|
|
11
|
+
## 0.8.0
|
|
12
|
+
|
|
13
|
+
### Minor Changes
|
|
14
|
+
|
|
15
|
+
- a12fa96: An emailed approval link lasts 72 hours, not 14 days
|
|
16
|
+
|
|
17
|
+
The action token's default lifetime outlived the thing it acts on. `plugin.ts`
|
|
18
|
+
expires an approval request after seven days (`expirationDays ?? 7`), so the
|
|
19
|
+
second week of a token's life could only ever act on a request that was already
|
|
20
|
+
gone — a link that still verifies and then finds nothing.
|
|
21
|
+
|
|
22
|
+
Seventy-two hours is what an approval actually needs: it covers a weekend, which
|
|
23
|
+
is the realistic gap between sending a request and somebody opening their mail,
|
|
24
|
+
and it stays well inside the request's own expiry so the two cannot disagree.
|
|
25
|
+
`createExpireStaleApprovalsFunction` handles anything that ages out either way.
|
|
26
|
+
|
|
27
|
+
The token is otherwise well built — HMAC-SHA256, constant-time compare, bound to
|
|
28
|
+
one approval, action and approver, single-use, with a confirmation interstitial
|
|
29
|
+
— so this narrows a window rather than closing a hole.
|
|
30
|
+
|
|
31
|
+
`maxAgeMs` per call is unchanged, so a host that wants the old behaviour can
|
|
32
|
+
pass it. **Minor rather than patch**: a link somebody was sitting on for a week
|
|
33
|
+
stops working, which is a behaviour change even though it is the intended one.
|
|
34
|
+
|
|
35
|
+
Nothing asserted the default before. There is now a test that does, and it says
|
|
36
|
+
why the number is what it is, so it cannot drift back without somebody deciding
|
|
37
|
+
to.
|
|
38
|
+
|
|
39
|
+
Found auditing the host that consumes this suite: forumone/forumone-2026#486,
|
|
40
|
+
F-13.
|
|
41
|
+
|
|
3
42
|
## 0.7.1
|
|
4
43
|
|
|
5
44
|
### Patch Changes
|
package/dist/tokens.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["../src/tokens.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,MAAM,MAAM,iBAAiB,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,CAAA;AAE7E,MAAM,WAAW,WAAW;IAC1B,UAAU,EAAE,MAAM,CAAA;IAClB,MAAM,EAAE,iBAAiB,CAAA;IACzB,UAAU,EAAE,MAAM,CAAA;IAClB,uDAAuD;IACvD,QAAQ,EAAE,MAAM,CAAA;CACjB;
|
|
1
|
+
{"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["../src/tokens.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,MAAM,MAAM,iBAAiB,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,CAAA;AAE7E,MAAM,WAAW,WAAW;IAC1B,UAAU,EAAE,MAAM,CAAA;IAClB,MAAM,EAAE,iBAAiB,CAAA;IACzB,UAAU,EAAE,MAAM,CAAA;IAClB,uDAAuD;IACvD,QAAQ,EAAE,MAAM,CAAA;CACjB;AA2BD;;;GAGG;AACH,wBAAsB,mBAAmB,CACvC,KAAK,EAAE,WAAW,EAClB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,MAAM,CAAC,CAKjB;AAED,MAAM,WAAW,aAAa;IAC5B,kDAAkD;IAClD,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,kEAAkE;IAClE,GAAG,CAAC,EAAE,MAAM,CAAA;CACb;AAED,MAAM,MAAM,YAAY,GACpB;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,WAAW,CAAA;CAAE,GAChC;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAA;AAEhC;;;GAGG;AACH,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,aAAkB,GAC1B,OAAO,CAAC,YAAY,CAAC,CAiDvB;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAGvE"}
|
package/dist/tokens.js
CHANGED
|
@@ -8,7 +8,27 @@
|
|
|
8
8
|
* Crypto uses the Web Crypto API (`crypto.subtle`) so the same code runs
|
|
9
9
|
* in Node and edge runtimes.
|
|
10
10
|
*/
|
|
11
|
-
|
|
11
|
+
/**
|
|
12
|
+
* How long an emailed action link stays usable.
|
|
13
|
+
*
|
|
14
|
+
* Was fourteen days, which outlived the thing the link acts on: `plugin.ts`
|
|
15
|
+
* expires an approval request after seven (`expirationDays ?? 7`), so the
|
|
16
|
+
* second week of a token's life could only ever act on something already gone.
|
|
17
|
+
*
|
|
18
|
+
* Seventy-two hours is what an approval actually needs. It covers a weekend,
|
|
19
|
+
* which is the realistic gap between sending a request and somebody opening
|
|
20
|
+
* their mail, and it is well inside the request's own expiry so the two cannot
|
|
21
|
+
* disagree. `createExpireStaleApprovalsFunction` handles anything that ages
|
|
22
|
+
* out either way.
|
|
23
|
+
*
|
|
24
|
+
* The token is otherwise well built — HMAC-SHA256, constant-time compare, bound
|
|
25
|
+
* to one approval, action and approver, single-use, with a confirmation
|
|
26
|
+
* interstitial — so this is narrowing a window rather than closing a hole.
|
|
27
|
+
* forumone/forumone-2026#486, F-13.
|
|
28
|
+
*
|
|
29
|
+
* Overridable per call through `maxAgeMs`, which is unchanged.
|
|
30
|
+
*/
|
|
31
|
+
const DEFAULT_MAX_AGE_MS = 72 * 60 * 60 * 1000;
|
|
12
32
|
const TOKEN_PARTS = 5;
|
|
13
33
|
const VALID_ACTIONS = new Set(['approve', 'decline', 'changes', 'discuss']);
|
|
14
34
|
const ENCODER = new TextEncoder();
|
package/dist/tokens.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tokens.js","sourceRoot":"","sources":["../src/tokens.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAYH,MAAM,kBAAkB,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,
|
|
1
|
+
{"version":3,"file":"tokens.js","sourceRoot":"","sources":["../src/tokens.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAYH;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,kBAAkB,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAA;AAC9C,MAAM,WAAW,GAAG,CAAC,CAAA;AACrB,MAAM,aAAa,GAAG,IAAI,GAAG,CAAoB,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC,CAAA;AAC9F,MAAM,OAAO,GAAG,IAAI,WAAW,EAAE,CAAA;AAEjC;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,KAAkB,EAClB,MAAc;IAEd,qBAAqB,CAAC,KAAK,CAAC,CAAA;IAC5B,MAAM,OAAO,GAAG,GAAG,KAAK,CAAC,UAAU,IAAI,KAAK,CAAC,MAAM,IAAI,KAAK,CAAC,UAAU,IAAI,KAAK,CAAC,QAAQ,EAAE,CAAA;IAC3F,MAAM,SAAS,GAAG,MAAM,WAAW,CAAC,OAAO,EAAE,MAAM,CAAC,CAAA;IACpD,OAAO,eAAe,CAAC,GAAG,OAAO,IAAI,SAAS,EAAE,CAAC,CAAA;AACnD,CAAC;AAaD;;;GAGG;AACH,MAAM,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AAO,CAAC,CAAA;AAC5D,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forumone/throughline-approvals",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.1",
|
|
4
4
|
"description": "Conversational approval workflow server for Throughline. Provides the approval resolver the publishing server consumes plus MCP tools for requesting and responding to approvals.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -42,9 +42,9 @@
|
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"zod": "^3.23.0",
|
|
45
|
-
"@forumone/throughline-core": "0.8.
|
|
45
|
+
"@forumone/throughline-core": "0.8.2",
|
|
46
46
|
"@forumone/throughline-plugin-contract": "0.4.1",
|
|
47
|
-
"@forumone/throughline-publishing": "0.9.
|
|
47
|
+
"@forumone/throughline-publishing": "0.9.2"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@types/node": "^24.13.2",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"inngest": "^4.2.0",
|
|
53
53
|
"payload": "^3.83.0",
|
|
54
54
|
"typescript": "^5.6.0",
|
|
55
|
-
"vitest": "^
|
|
55
|
+
"vitest": "^4.1.10",
|
|
56
56
|
"@forumone/throughline-eslint-config": "0.0.0",
|
|
57
57
|
"@forumone/throughline-tsconfig": "0.0.0"
|
|
58
58
|
},
|