@ultimat3/policy 22.15.0 → 23.0.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/CLAUDE.md +1 -1
- package/package.json +3 -2
- package/src/test-kit.ts +6 -1
package/CLAUDE.md
CHANGED
|
@@ -161,7 +161,7 @@ reappearing there is a failing test.
|
|
|
161
161
|
| `surfaces.ts` | http/live/job/mcp adapters — the "one system" proof |
|
|
162
162
|
| `roles.ts` | the role map: merge, conflict, inheritance, wildcards |
|
|
163
163
|
| `grant-index.ts` | the per-actor flattened grant set, memoised against the role generation |
|
|
164
|
-
| `test-kit.ts` | `policyMatrix()` for generated policy tests, and `testActor()` |
|
|
164
|
+
| `test-kit.ts` | `policyMatrix()` for generated policy tests, and `testActor()` — whose `.actor` is typed `Actor`, never `null`, so it goes straight into `createContext({ actor })` |
|
|
165
165
|
|
|
166
166
|
## The hot path
|
|
167
167
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ultimat3/policy",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "23.0.0",
|
|
4
4
|
"description": "The one authz rule, evaluated identically in every surface",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
"files": [
|
|
20
20
|
"src",
|
|
21
21
|
"!src/**/*.test.ts",
|
|
22
|
+
"!src/**/*-fixture.ts",
|
|
22
23
|
"CLAUDE.md",
|
|
23
24
|
"README.md",
|
|
24
25
|
"LICENSE"
|
|
@@ -31,6 +32,6 @@
|
|
|
31
32
|
"test": "bun test"
|
|
32
33
|
},
|
|
33
34
|
"dependencies": {
|
|
34
|
-
"@ultimat3/core": "
|
|
35
|
+
"@ultimat3/core": "23.0.0"
|
|
35
36
|
}
|
|
36
37
|
}
|
package/src/test-kit.ts
CHANGED
|
@@ -98,6 +98,11 @@ export const policyMatrix = <I, R = unknown>(
|
|
|
98
98
|
* Going through `userActor()` closes that by construction rather than by keeping a second field
|
|
99
99
|
* list in sync: a field added to `Actor` arrives here, and the result is FROZEN with frozen
|
|
100
100
|
* arrays, exactly as the actor `@ultimat3/auth` resolves per request is.
|
|
101
|
+
*
|
|
102
|
+
* The return type says the actor is THERE. `NamedActor` keeps `null` for the matrix's signed-out
|
|
103
|
+
* row; a minted actor is never that, and while the type said it might be, `createContext({ actor })`
|
|
104
|
+
* refused it — so every fixture that built a context reached for core's `userActor` instead and a
|
|
105
|
+
* generated test held two idioms for one thing.
|
|
101
106
|
*/
|
|
102
107
|
export const testActor = (
|
|
103
108
|
name: string,
|
|
@@ -107,7 +112,7 @@ export const testActor = (
|
|
|
107
112
|
scopes?: readonly string[];
|
|
108
113
|
orgId?: string;
|
|
109
114
|
} = {},
|
|
110
|
-
): NamedActor => {
|
|
115
|
+
): NamedActor & { readonly actor: Actor } => {
|
|
111
116
|
const built = userActor({
|
|
112
117
|
id: name,
|
|
113
118
|
roles: init.roles ?? [],
|