@cynodia/axiom-compiler 0.14.0-alpha.5 → 0.15.0-alpha.2
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/dist/server.js +11 -1
- package/package.json +3 -3
package/dist/server.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { actionAuthority, actionGuards, authorityContext, expressionDefsIn, isObservable, maxContract, requiredServerContract, schemaFingerprint, stripAuthoringMetadata, serverIRExpressions, serverStateClosure, stateAuthority, usesExternalIOVocabulary, usesIntegrationVocabulary, usesInvocationVocabulary, usesMigrationVocabulary, usesQueryVocabulary, usesWorkflowVocabulary, usesV4Semantics, validateGraph, } from '@cynodia/axiom-core';
|
|
1
|
+
import { actionAuthority, actionGuards, authorityContext, expressionDefsIn, isObservable, maxContract, requiredServerContract, schemaFingerprint, stripAuthoringMetadata, serverIRExpressions, serverStateClosure, stateAuthority, usesExternalIOVocabulary, usesIntegrationVocabulary, usesInvocationVocabulary, usesMigrationVocabulary, usesQueryVocabulary, usesWorkflowVocabulary, usesAuthorizationVocabulary, usesV4Semantics, validateGraph, } from '@cynodia/axiom-core';
|
|
2
2
|
import { GraphValidationError } from './normalize.js';
|
|
3
3
|
/**
|
|
4
4
|
* Compiles the authoritative half of a graph.
|
|
@@ -33,6 +33,7 @@ export function compileToServerIR(graph, options = {}) {
|
|
|
33
33
|
const queries = [];
|
|
34
34
|
const relationships = [];
|
|
35
35
|
const readPolicies = [];
|
|
36
|
+
const authorizationPolicies = [];
|
|
36
37
|
const migrations = [];
|
|
37
38
|
const workflows = [];
|
|
38
39
|
for (const node of nodes) {
|
|
@@ -77,6 +78,13 @@ export function compileToServerIR(graph, options = {}) {
|
|
|
77
78
|
else if (node.kind === 'read-policy') {
|
|
78
79
|
readPolicies.push(node);
|
|
79
80
|
}
|
|
81
|
+
else if (node.kind === 'authorization-policy') {
|
|
82
|
+
// An authorization policy is authority-side by construction: the decision is made on
|
|
83
|
+
// the authority with the server-computed principal; a client never receives the rule
|
|
84
|
+
// and can never satisfy it by claiming to (spec15 §3, §65). Authoring markers stripped
|
|
85
|
+
// like any other trust-boundary payload.
|
|
86
|
+
authorizationPolicies.push(stripAuthoringMetadata(node));
|
|
87
|
+
}
|
|
80
88
|
else if (node.kind === 'workflow') {
|
|
81
89
|
// A workflow is authority-side by construction: only the authoritative runtime owns
|
|
82
90
|
// durable orchestration state, leases and fencing (spec14 §87). It never reaches a
|
|
@@ -175,6 +183,7 @@ export function compileToServerIR(graph, options = {}) {
|
|
|
175
183
|
...(queries.length > 0 ? { queries } : {}),
|
|
176
184
|
...(relationships.length > 0 ? { relationships } : {}),
|
|
177
185
|
...(readPolicies.length > 0 ? { readPolicies } : {}),
|
|
186
|
+
...(authorizationPolicies.length > 0 ? { authorizationPolicies } : {}),
|
|
178
187
|
...(workflows.length > 0 ? { workflows } : {}),
|
|
179
188
|
};
|
|
180
189
|
// Only the definitions the authority's own rules reach. A calculation used by the client
|
|
@@ -208,6 +217,7 @@ export function compileToServerIR(graph, options = {}) {
|
|
|
208
217
|
usesQueryVocabulary(document) ? 'axiom.server.v6' : 'axiom.server.v1',
|
|
209
218
|
usesMigrationVocabulary(document) ? 'axiom.server.v7' : 'axiom.server.v1',
|
|
210
219
|
usesWorkflowVocabulary(document) ? 'axiom.server.v8' : 'axiom.server.v1',
|
|
220
|
+
usesAuthorizationVocabulary(document) ? 'axiom.server.v9' : 'axiom.server.v1',
|
|
211
221
|
];
|
|
212
222
|
const contract = contractCandidates.reduce(maxContract);
|
|
213
223
|
return { contract, ...document };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cynodia/axiom-compiler",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.0-alpha.2",
|
|
4
4
|
"description": "Normalizes an Axiom application graph and emits a self-contained page.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "AskTech AS",
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
}
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@cynodia/axiom-core": "0.
|
|
35
|
-
"@cynodia/axiom-runtime": "0.
|
|
34
|
+
"@cynodia/axiom-core": "0.15.0-alpha.2",
|
|
35
|
+
"@cynodia/axiom-runtime": "0.15.0-alpha.2"
|
|
36
36
|
},
|
|
37
37
|
"scripts": {
|
|
38
38
|
"build": "tsc -b tsconfig.json tsconfig.test.json",
|