@astrale-os/kernel-protocol 0.5.0-beta.21 → 0.5.0-beta.24
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
|
@@ -24,6 +24,127 @@
|
|
|
24
24
|
* the first supported V2 release is a coordinated `1.0.0`, not a compatible continuation of the
|
|
25
25
|
current `0.x` line; package and wire versions remain independent as specified in
|
|
26
26
|
[the protocol architecture](./.spec/architecture.md)
|
|
27
|
+
## [0.5.0-beta.24](https://github.com/astrale-os/kernel/compare/kernel-protocol-v0.5.0-beta.23...kernel-protocol-v0.5.0-beta.24) (2026-08-29)
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
### Features
|
|
31
|
+
|
|
32
|
+
* **api:** carry view iframe requirements ([#531](https://github.com/astrale-os/kernel/issues/531)) ([4eedb0b](https://github.com/astrale-os/kernel/commit/4eedb0b3430f5f642942e913cf1c5806e09b7cf1))
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
### Dependencies
|
|
36
|
+
|
|
37
|
+
* The following workspace dependencies were updated
|
|
38
|
+
* dependencies
|
|
39
|
+
* @astrale-os/kernel-core bumped to 0.9.0-beta.23
|
|
40
|
+
|
|
41
|
+
## [0.5.0-beta.23](https://github.com/astrale-os/kernel/compare/kernel-protocol-v0.5.0-beta.22...kernel-protocol-v0.5.0-beta.23) (2026-08-29)
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
### ⚠ BREAKING CHANGES
|
|
45
|
+
|
|
46
|
+
* View declarations now contain only target and optional description. Legacy View.auth fields are rejected; callable authorization, View.resolve admission, Policies, and Shell handshakes remain independent.
|
|
47
|
+
|
|
48
|
+
### Features
|
|
49
|
+
|
|
50
|
+
* add aliased domain dependency projection ([afb799b](https://github.com/astrale-os/kernel/commit/afb799b0d61fd6f7436fe659f558a6a62ef1e7a1))
|
|
51
|
+
* add aliased Domain dependency projection ([9c4c4fb](https://github.com/astrale-os/kernel/commit/9c4c4fb4f942c0c5e3961faf4428ed299d42f847))
|
|
52
|
+
* add compiled remote domain serving ([ac9e365](https://github.com/astrale-os/kernel/commit/ac9e36538982a91359712e4cbbc68353ea2cc1a2))
|
|
53
|
+
* add compiled remote Domain serving ([6149628](https://github.com/astrale-os/kernel/commit/6149628820d1294981156ff5b50ceaa522ea0403))
|
|
54
|
+
* add source-qualified Invocation identity ([#331](https://github.com/astrale-os/kernel/issues/331)) ([ac87f3c](https://github.com/astrale-os/kernel/commit/ac87f3c67907290f43b21ca1efe2c3b51541c73d))
|
|
55
|
+
* **api:** ratify token exchange lifecycle ([#519](https://github.com/astrale-os/kernel/issues/519)) ([33831ff](https://github.com/astrale-os/kernel/commit/33831ffac82dc96f5d71488d6f410d1710b85ca0))
|
|
56
|
+
* **callable:** preserve native binary streams and status ([d14c6f1](https://github.com/astrale-os/kernel/commit/d14c6f13492c14a3363b2c4af59c738034752fa2))
|
|
57
|
+
* **clients:** normalize safe failure evidence ([459cd4d](https://github.com/astrale-os/kernel/commit/459cd4ddd8b7fe000841ae854d0e5645e3809842))
|
|
58
|
+
* **clients:** normalize safe failure evidence ([034a5e5](https://github.com/astrale-os/kernel/commit/034a5e5a45cafd3ee297ef36ffe98625c77c1813))
|
|
59
|
+
* **invocation:** preserve same-schema remote domain calls ([1c54830](https://github.com/astrale-os/kernel/commit/1c54830829c0e49612f354f5c4b8d4a12cc7e22c))
|
|
60
|
+
* remove Property visibility and cut DSL V2 ([#518](https://github.com/astrale-os/kernel/issues/518)) ([4d99e8f](https://github.com/astrale-os/kernel/commit/4d99e8f0837136cf6be257ab3a6df666b62e06b5))
|
|
61
|
+
* remove View authentication declarations ([4a5bfe0](https://github.com/astrale-os/kernel/commit/4a5bfe016717267d31257748f95e7f646782f876))
|
|
62
|
+
* **runtime:** preserve remote Domain calls across same-schema deployments ([40c237b](https://github.com/astrale-os/kernel/commit/40c237bc4877068ba94b53a29d916e7c8f633f1e))
|
|
63
|
+
* **runtime:** support buffered and streaming binary ([fcd73f9](https://github.com/astrale-os/kernel/commit/fcd73f99c75963257b595449b1a0e0e4e234a05d))
|
|
64
|
+
* **schema:** make atomic installs convergent ([ed198fb](https://github.com/astrale-os/kernel/commit/ed198fba6d8d9d4e0092cd1bc64f454b717851e5))
|
|
65
|
+
* **schema:** split inspection and add convergence ([6afbd39](https://github.com/astrale-os/kernel/commit/6afbd39506b8a9e37225aded1c02f94ffa64e54b))
|
|
66
|
+
* **schema:** split ready reads and make atomic installs convergent ([dd96d3e](https://github.com/astrale-os/kernel/commit/dd96d3ed13c374b0db19f7edbfeff1dc65ae03f9))
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
### Bug Fixes
|
|
70
|
+
|
|
71
|
+
* align the official kernel package cohort ([#371](https://github.com/astrale-os/kernel/issues/371)) ([30fda63](https://github.com/astrale-os/kernel/commit/30fda63157bbaf756af2d46efed4e2fc5bc17d4b))
|
|
72
|
+
* **api:** finish binary delivery taxonomy ([#462](https://github.com/astrale-os/kernel/issues/462)) ([2fce294](https://github.com/astrale-os/kernel/commit/2fce29427449280e2629d07817780b121f6c6b79))
|
|
73
|
+
* **api:** keep introspection codec runtime-only ([12678d7](https://github.com/astrale-os/kernel/commit/12678d7cd6446dc2b068a3cc32fef6196e657f2d))
|
|
74
|
+
* **api:** let Vite bundle MessagePack ([c882bcd](https://github.com/astrale-os/kernel/commit/c882bcd05f37b5fdba807601b77abc7e8de3f5b7))
|
|
75
|
+
* **api:** let Vite bundle MessagePack ([99f16cf](https://github.com/astrale-os/kernel/commit/99f16cf2fd9b7984db8a344af12aa2e6407065ac))
|
|
76
|
+
* **api:** retain visibility-free DSL as V1 ([#526](https://github.com/astrale-os/kernel/issues/526)) ([e24c1ea](https://github.com/astrale-os/kernel/commit/e24c1ea257e8567d9bd33c6ada0de63bb346a496))
|
|
77
|
+
* **ci:** enforce the official Kernel cohort ([#469](https://github.com/astrale-os/kernel/issues/469)) ([f6ea87a](https://github.com/astrale-os/kernel/commit/f6ea87a47f7b1f9c415e404dc1a09b480a2a3f5f))
|
|
78
|
+
* **core:** preserve callable identity and runtime boundaries ([#394](https://github.com/astrale-os/kernel/issues/394)) ([ad67dad](https://github.com/astrale-os/kernel/commit/ad67dad84aef3c8b79f769009595ea1f1229026b))
|
|
79
|
+
* **deps:** refresh the Kernel dependency cohort ([#393](https://github.com/astrale-os/kernel/issues/393)) ([883e7bb](https://github.com/astrale-os/kernel/commit/883e7bb7ce17eecb7dad1c94ad2089c576ba3746))
|
|
80
|
+
* **dsl:** close runtime facade contracts ([ff99450](https://github.com/astrale-os/kernel/commit/ff99450ce3889013f57c39293e7022b32e186ca6))
|
|
81
|
+
* **dsl:** close semantic qualification gaps ([4a48cd7](https://github.com/astrale-os/kernel/commit/4a48cd729bcaf839ceda880b26ade064d6505fe2))
|
|
82
|
+
* **kernel:** enforce executable callable boundaries ([e4e6c24](https://github.com/astrale-os/kernel/commit/e4e6c24a58b8d7b81b02d978298e9effcccd084a))
|
|
83
|
+
* **packages:** keep workspace guard private ([e0ba76c](https://github.com/astrale-os/kernel/commit/e0ba76c5ae163245e31115e2a72e0663db0f5320))
|
|
84
|
+
* **packages:** keep workspace guard private ([d260a52](https://github.com/astrale-os/kernel/commit/d260a52329cde5ce4b0260c43a3bbf28cb78f408))
|
|
85
|
+
* **packages:** keep workspace guard private ([a3e82ec](https://github.com/astrale-os/kernel/commit/a3e82ec671f07252a5966b4de988e275e4078b8c))
|
|
86
|
+
* **protocol:** admit intrinsic kernel capability requirements ([11f9b18](https://github.com/astrale-os/kernel/commit/11f9b18cb0b837eac05d484f8dd42ba5d939c3fd))
|
|
87
|
+
* **protocol:** admit intrinsic Kernel capability requirements ([5345d82](https://github.com/astrale-os/kernel/commit/5345d826110b318907a4bcb96f2c8c2b1f58a116))
|
|
88
|
+
* **protocol:** keep introspection runtime-only ([9ebc40b](https://github.com/astrale-os/kernel/commit/9ebc40b7b329922f462c44eee98ab8cc0201f1a7))
|
|
89
|
+
* **protocol:** publish runtime artifact export ([13fc0e1](https://github.com/astrale-os/kernel/commit/13fc0e1c4d25f68760190be2c8afc2d95bed6610))
|
|
90
|
+
* **protocol:** resolve functional dependencies from bundle closure ([4cf5c4e](https://github.com/astrale-os/kernel/commit/4cf5c4e0ddbe07bcadf28550a70aada90bc8dd6f))
|
|
91
|
+
* **protocol:** resolve functional dependencies from bundle closure ([cdfcfeb](https://github.com/astrale-os/kernel/commit/cdfcfebc72cdacd41da844a4d0db9080c4231e58))
|
|
92
|
+
* publish a TypeScript-compatible cohort ([#406](https://github.com/astrale-os/kernel/issues/406)) ([f1a0cd0](https://github.com/astrale-os/kernel/commit/f1a0cd09f2f0b4498f9fa8924b2e319cac6552b7))
|
|
93
|
+
* **release:** add package repository metadata ([8238077](https://github.com/astrale-os/kernel/commit/8238077d47a96c0f7b50a1bae8769fe4faab45b7))
|
|
94
|
+
* **release:** align the published beta cohort ([8f2dc4a](https://github.com/astrale-os/kernel/commit/8f2dc4a7156aeee4dc9034624d2ffa2b3583d5b8))
|
|
95
|
+
* **release:** publish exact Kernel cohort edges ([04629b8](https://github.com/astrale-os/kernel/commit/04629b89515aa665ede2f9fe058888bad45ab896))
|
|
96
|
+
* **release:** publish exact Kernel cohort edges ([14f2c52](https://github.com/astrale-os/kernel/commit/14f2c52329874fdad43114a964521599c8313eab))
|
|
97
|
+
* **runtime:** clarify Domain transition Foundation without narrowing behavior ([bce2184](https://github.com/astrale-os/kernel/commit/bce21848e645d2570cf056d56cc0d4489c656d14))
|
|
98
|
+
* **runtime:** close domain transition foundation drift ([310f95f](https://github.com/astrale-os/kernel/commit/310f95fadfb1a85fb19ac52b69a58427d22a5788))
|
|
99
|
+
* **runtime:** preserve existing dependency behavior ([73c2b6c](https://github.com/astrale-os/kernel/commit/73c2b6c5a0d8a0dc11102d8687d7e67d9f437741))
|
|
100
|
+
* **schema:** harden introspection evidence and caches ([9516eb5](https://github.com/astrale-os/kernel/commit/9516eb510242427296861ef9e730b01861e45463))
|
|
101
|
+
* **server:** preserve compatible remote schema continuity ([#508](https://github.com/astrale-os/kernel/issues/508)) ([306a275](https://github.com/astrale-os/kernel/commit/306a275dd7253810085f5b8c86cef15fffd95089))
|
|
102
|
+
* stabilize governed Kernel integration ([#347](https://github.com/astrale-os/kernel/issues/347)) ([6869e3f](https://github.com/astrale-os/kernel/commit/6869e3fc4de1e73ff701bb38383e89c934ddfdf2))
|
|
103
|
+
* **system:** clear Codegraph diagnostic debt ([f7a8e1f](https://github.com/astrale-os/kernel/commit/f7a8e1f5c5694d9c3c45d95fde184f0d5f2c7343))
|
|
104
|
+
* **system:** clear Codegraph diagnostic debt ([45f86a9](https://github.com/astrale-os/kernel/commit/45f86a9ce14a224efed0e07966a5df8d7a892078))
|
|
105
|
+
* **system:** preserve erased domain and runtime facade contracts ([b525d47](https://github.com/astrale-os/kernel/commit/b525d4781d2d58776ec6b4bbe1e045a3c1accebb))
|
|
106
|
+
* **system:** preserve public revision vocabulary ([5e990d0](https://github.com/astrale-os/kernel/commit/5e990d0b28578a040b80c508943552c46b8632ae))
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
### Performance Improvements
|
|
110
|
+
|
|
111
|
+
* **operations:** release only the Host production closure ([3f9d61a](https://github.com/astrale-os/kernel/commit/3f9d61afe6b4f19f4dfd0bd5e454e38f951aaf2a))
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
### Documentation
|
|
115
|
+
|
|
116
|
+
* **api:** finish buffered and streaming binary vocabulary ([af00cda](https://github.com/astrale-os/kernel/commit/af00cda06b1744b5120cdd3ea3bc39ca58efcceb))
|
|
117
|
+
* **api:** finish buffered and streaming binary vocabulary ([11a28be](https://github.com/astrale-os/kernel/commit/11a28bec361ead8c0ae32e55f545c63042bb1539))
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
### Dependencies
|
|
121
|
+
|
|
122
|
+
* The following workspace dependencies were updated
|
|
123
|
+
* dependencies
|
|
124
|
+
* @astrale-os/kernel-core bumped to 0.9.0-beta.22
|
|
125
|
+
* @astrale-os/kernel-dsl bumped to 0.2.0-beta.17
|
|
126
|
+
|
|
127
|
+
## [0.5.0-beta.22](https://github.com/astrale-os/kernel/compare/kernel-protocol-v0.5.0-beta.21...kernel-protocol-v0.5.0-beta.22) (2026-08-29)
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
### Features
|
|
131
|
+
|
|
132
|
+
* **api:** ratify token exchange lifecycle ([#519](https://github.com/astrale-os/kernel/issues/519)) ([33831ff](https://github.com/astrale-os/kernel/commit/33831ffac82dc96f5d71488d6f410d1710b85ca0))
|
|
133
|
+
* remove Property visibility and cut DSL V2 ([#518](https://github.com/astrale-os/kernel/issues/518)) ([4d99e8f](https://github.com/astrale-os/kernel/commit/4d99e8f0837136cf6be257ab3a6df666b62e06b5))
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
### Bug Fixes
|
|
137
|
+
|
|
138
|
+
* **api:** retain visibility-free DSL as V1 ([#526](https://github.com/astrale-os/kernel/issues/526)) ([e24c1ea](https://github.com/astrale-os/kernel/commit/e24c1ea257e8567d9bd33c6ada0de63bb346a496))
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
### Dependencies
|
|
142
|
+
|
|
143
|
+
* The following workspace dependencies were updated
|
|
144
|
+
* dependencies
|
|
145
|
+
* @astrale-os/kernel-core bumped to 0.9.0-beta.21
|
|
146
|
+
* @astrale-os/kernel-dsl bumped to 0.2.0-beta.16
|
|
147
|
+
|
|
27
148
|
## [0.5.0-beta.21](https://github.com/astrale-os/kernel/compare/kernel-protocol-v0.5.0-beta.20...kernel-protocol-v0.5.0-beta.21) (2026-08-28)
|
|
28
149
|
|
|
29
150
|
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { admitCallableBinding, admitCallableKey, type CallableBinding } from './callable.js';
|
|
2
2
|
export { acceptInvocationEndpoints, type InvocationEndpoints } from './invocation.js';
|
|
3
|
-
export { admitViewBinding, type ViewBinding } from './view.js';
|
|
3
|
+
export { admitViewBinding, type IframeRequirements, type ViewBinding } from './view.js';
|
|
@@ -3,5 +3,12 @@ export interface ViewBinding {
|
|
|
3
3
|
readonly view: Key.View;
|
|
4
4
|
readonly href: string;
|
|
5
5
|
readonly handshake: 'shell' | 'none';
|
|
6
|
+
readonly iframe?: IframeRequirements;
|
|
7
|
+
}
|
|
8
|
+
export interface IframeRequirements {
|
|
9
|
+
readonly sandbox?: readonly string[];
|
|
10
|
+
readonly allow?: readonly string[];
|
|
6
11
|
}
|
|
7
12
|
export declare function admitViewBinding(input: unknown, origin: string): ViewBinding;
|
|
13
|
+
/** Authoring-only normalization used before a Publication receives its canonical ETag. */
|
|
14
|
+
export declare function canonicalizeViewBinding(input: unknown, origin: string): ViewBinding;
|
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
import { Key } from '@astrale-os/kernel-dsl/v1/addressing';
|
|
2
2
|
import { absoluteHttpUrl, exact, record } from '../content.js';
|
|
3
3
|
import { fail } from '../error.js';
|
|
4
|
+
const TOKEN = /^[a-z][a-z0-9-]*$/u;
|
|
4
5
|
export function admitViewBinding(input, origin) {
|
|
6
|
+
return readViewBinding(input, origin, false);
|
|
7
|
+
}
|
|
8
|
+
/** Authoring-only normalization used before a Publication receives its canonical ETag. */
|
|
9
|
+
export function canonicalizeViewBinding(input, origin) {
|
|
10
|
+
return readViewBinding(input, origin, true);
|
|
11
|
+
}
|
|
12
|
+
function readViewBinding(input, origin, canonicalize) {
|
|
5
13
|
const value = record(input, 'PUBLICATION_VIEW_INVALID', 'Published View binding is invalid.');
|
|
6
|
-
exact(value, ['view', 'href', 'handshake'], 'PUBLICATION_VIEW_INVALID');
|
|
14
|
+
exact(value, ['view', 'href', 'handshake', 'iframe'], 'PUBLICATION_VIEW_INVALID');
|
|
7
15
|
let view;
|
|
8
16
|
try {
|
|
9
17
|
view = Key(String(value.view));
|
|
@@ -20,9 +28,110 @@ export function admitViewBinding(input, origin) {
|
|
|
20
28
|
if (value.handshake !== 'shell' && value.handshake !== 'none') {
|
|
21
29
|
fail('PUBLICATION_VIEW_INVALID', 'View handshake is invalid.');
|
|
22
30
|
}
|
|
31
|
+
const iframe = admitIframeRequirements(dataValue(value, 'iframe'), value.handshake, canonicalize);
|
|
23
32
|
return Object.freeze({
|
|
24
33
|
view,
|
|
25
34
|
href: absoluteHttpUrl(value.href, true, 'PUBLICATION_VIEW_INVALID'),
|
|
26
35
|
handshake: value.handshake,
|
|
36
|
+
...(iframe === undefined ? {} : { iframe }),
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
function admitIframeRequirements(input, handshake, canonicalize) {
|
|
40
|
+
if (input === undefined)
|
|
41
|
+
return undefined;
|
|
42
|
+
const value = plainRecord(input);
|
|
43
|
+
exactOwnKeys(value, ['sandbox', 'allow']);
|
|
44
|
+
if (!canonicalize && (!Object.hasOwn(value, 'sandbox') || !Object.hasOwn(value, 'allow'))) {
|
|
45
|
+
invalid();
|
|
46
|
+
}
|
|
47
|
+
const sandbox = tokens(dataValue(value, 'sandbox'), canonicalize);
|
|
48
|
+
const allow = tokens(dataValue(value, 'allow'), canonicalize);
|
|
49
|
+
assertRelationships(sandbox);
|
|
50
|
+
const baselineSandbox = handshake === 'shell' ? ['allow-same-origin', 'allow-scripts'] : ['allow-scripts'];
|
|
51
|
+
const baselineAllow = handshake === 'shell' ? ['clipboard-write'] : [];
|
|
52
|
+
if (!canonicalize &&
|
|
53
|
+
(sandbox.some((token) => baselineSandbox.includes(token)) ||
|
|
54
|
+
allow.some((feature) => baselineAllow.includes(feature)))) {
|
|
55
|
+
invalid();
|
|
56
|
+
}
|
|
57
|
+
const canonicalSandbox = canonicalize
|
|
58
|
+
? sandbox.filter((token) => !baselineSandbox.includes(token))
|
|
59
|
+
: sandbox;
|
|
60
|
+
const canonicalAllow = canonicalize
|
|
61
|
+
? allow.filter((feature) => !baselineAllow.includes(feature))
|
|
62
|
+
: allow;
|
|
63
|
+
if (!canonicalize && canonicalSandbox.length === 0 && canonicalAllow.length === 0)
|
|
64
|
+
invalid();
|
|
65
|
+
if (canonicalSandbox.length === 0 && canonicalAllow.length === 0)
|
|
66
|
+
return undefined;
|
|
67
|
+
return Object.freeze({
|
|
68
|
+
sandbox: Object.freeze(canonicalSandbox),
|
|
69
|
+
allow: Object.freeze(canonicalAllow),
|
|
27
70
|
});
|
|
28
71
|
}
|
|
72
|
+
function plainRecord(input) {
|
|
73
|
+
if (input === null || typeof input !== 'object' || Array.isArray(input))
|
|
74
|
+
invalid();
|
|
75
|
+
const prototype = Object.getPrototypeOf(input);
|
|
76
|
+
if (prototype !== Object.prototype && prototype !== null)
|
|
77
|
+
invalid();
|
|
78
|
+
return input;
|
|
79
|
+
}
|
|
80
|
+
function exactOwnKeys(input, allowed) {
|
|
81
|
+
const keys = new Set(allowed);
|
|
82
|
+
if (Reflect.ownKeys(input).some((key) => typeof key !== 'string' || !keys.has(key)))
|
|
83
|
+
invalid();
|
|
84
|
+
}
|
|
85
|
+
function dataValue(input, key) {
|
|
86
|
+
const descriptor = Object.getOwnPropertyDescriptor(input, key);
|
|
87
|
+
if (descriptor === undefined)
|
|
88
|
+
return undefined;
|
|
89
|
+
if (!('value' in descriptor))
|
|
90
|
+
invalid();
|
|
91
|
+
return descriptor.value;
|
|
92
|
+
}
|
|
93
|
+
function tokens(input, canonicalize) {
|
|
94
|
+
if (input === undefined)
|
|
95
|
+
return [];
|
|
96
|
+
if (!Array.isArray(input))
|
|
97
|
+
invalid();
|
|
98
|
+
const descriptors = Object.getOwnPropertyDescriptors(input);
|
|
99
|
+
const values = [];
|
|
100
|
+
for (let index = 0; index < input.length; index += 1) {
|
|
101
|
+
const descriptor = descriptors[String(index)];
|
|
102
|
+
if (descriptor === undefined || !('value' in descriptor))
|
|
103
|
+
invalid();
|
|
104
|
+
if (typeof descriptor.value !== 'string' || !TOKEN.test(descriptor.value))
|
|
105
|
+
invalid();
|
|
106
|
+
values.push(descriptor.value);
|
|
107
|
+
}
|
|
108
|
+
for (const key of Reflect.ownKeys(descriptors)) {
|
|
109
|
+
if (key === 'length')
|
|
110
|
+
continue;
|
|
111
|
+
if (typeof key !== 'string' || !/^(0|[1-9][0-9]*)$/u.test(key) || Number(key) >= input.length) {
|
|
112
|
+
invalid();
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
if (canonicalize)
|
|
116
|
+
return [...new Set(values)].sort();
|
|
117
|
+
for (let index = 1; index < values.length; index += 1) {
|
|
118
|
+
if (values[index - 1] >= values[index])
|
|
119
|
+
invalid();
|
|
120
|
+
}
|
|
121
|
+
return values;
|
|
122
|
+
}
|
|
123
|
+
function assertRelationships(sandbox) {
|
|
124
|
+
const tokens = new Set(sandbox);
|
|
125
|
+
if (tokens.has('allow-popups-to-escape-sandbox') && !tokens.has('allow-popups'))
|
|
126
|
+
invalid();
|
|
127
|
+
if (tokens.has('allow-top-navigation') && tokens.has('allow-top-navigation-by-user-activation')) {
|
|
128
|
+
invalid();
|
|
129
|
+
}
|
|
130
|
+
if (tokens.has('allow-top-navigation-to-custom-protocols') &&
|
|
131
|
+
(tokens.has('allow-top-navigation') || tokens.has('allow-popups'))) {
|
|
132
|
+
invalid();
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
function invalid() {
|
|
136
|
+
return fail('PUBLICATION_VIEW_INVALID', 'View iframe requirements are invalid.');
|
|
137
|
+
}
|
|
@@ -14,4 +14,4 @@ export { ClassOperationOrder, admitRequirements, validateRequirements, type Capa
|
|
|
14
14
|
export { acceptReference, compareReference, compareReferences, matchesReference, reference, type PublicationRef, type PublicationReferenceRelation, } from './reference.js';
|
|
15
15
|
export type { BodyPick, CredentialSource, HttpMethod, HttpRoute, HttpRouteDeclaration, RouteBody, RouteHeaders, SingleCredentialSource, } from './route.js';
|
|
16
16
|
export type { Schema } from './schema.js';
|
|
17
|
-
export { acceptInvocationEndpoints, type CallableBinding, type InvocationEndpoints, type ViewBinding, } from './bindings/index.js';
|
|
17
|
+
export { acceptInvocationEndpoints, type CallableBinding, type IframeRequirements, type InvocationEndpoints, type ViewBinding, } from './bindings/index.js';
|
|
@@ -3,6 +3,7 @@ import { accept as acceptIssuerId } from '@astrale-os/kernel-core/auth/issuer';
|
|
|
3
3
|
import { Key, patterns } from '@astrale-os/kernel-dsl/v1/addressing';
|
|
4
4
|
import * as portable from '@astrale-os/kernel-dsl/value';
|
|
5
5
|
import { admitCallableBinding, admitViewBinding } from './bindings/index.js';
|
|
6
|
+
import { canonicalizeViewBinding } from './bindings/view.js';
|
|
6
7
|
import { array, deepFreeze, exact, record, unique } from './content.js';
|
|
7
8
|
import { admitEndpoint as admitDeliveryEndpoint } from './delivery-endpoint.js';
|
|
8
9
|
import { fail } from './error.js';
|
|
@@ -33,7 +34,8 @@ export function url(input) {
|
|
|
33
34
|
return `${admitted.replace(/\/+$/u, '')}${PATH}`;
|
|
34
35
|
}
|
|
35
36
|
export function seal(input) {
|
|
36
|
-
|
|
37
|
+
const canonical = withoutEtag(acceptPublication({ ...input, etag: 'canonicalizing' }, false, true));
|
|
38
|
+
return acceptPublication({ ...canonical, etag: computeEtag(canonical) }, false);
|
|
37
39
|
}
|
|
38
40
|
export function accept(input) {
|
|
39
41
|
const publication = acceptPublication(input, true);
|
|
@@ -45,7 +47,7 @@ export function accept(input) {
|
|
|
45
47
|
export function encode(input) {
|
|
46
48
|
return portable.json.encode(input);
|
|
47
49
|
}
|
|
48
|
-
function acceptPublication(input, requireEtag) {
|
|
50
|
+
function acceptPublication(input, requireEtag, canonicalizeViews = false) {
|
|
49
51
|
const value = record(input, 'PUBLICATION_INVALID', 'Expected a Publication object.');
|
|
50
52
|
exact(value, [
|
|
51
53
|
'format',
|
|
@@ -80,7 +82,7 @@ function acceptPublication(input, requireEtag) {
|
|
|
80
82
|
exact(bindingSet, ['callables', 'views'], 'PUBLICATION_BINDING_INVALID');
|
|
81
83
|
const callables = array(bindingSet.callables, 'PUBLICATION_BINDING_INVALID').map((entry) => admitCallableBinding(entry, origin));
|
|
82
84
|
unique(callables.map(({ callable }) => callable), 'PUBLICATION_BINDING_INVALID', 'callable binding');
|
|
83
|
-
const views = array(bindingSet.views, 'PUBLICATION_VIEW_INVALID').map((entry) => admitViewBinding(entry, origin));
|
|
85
|
+
const views = array(bindingSet.views, 'PUBLICATION_VIEW_INVALID').map((entry) => canonicalizeViews ? canonicalizeViewBinding(entry, origin) : admitViewBinding(entry, origin));
|
|
84
86
|
unique(views.map(({ view }) => view), 'PUBLICATION_VIEW_INVALID', 'View binding');
|
|
85
87
|
const routes = array(value.routes, 'PUBLICATION_ROUTE_INVALID').map((entry) => admitRoute(entry, origin));
|
|
86
88
|
unique(routes.map(({ name }) => name), 'PUBLICATION_ROUTE_INVALID', 'route name');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astrale-os/kernel-protocol",
|
|
3
|
-
"version": "0.5.0-beta.
|
|
3
|
+
"version": "0.5.0-beta.24",
|
|
4
4
|
"description": "Portable Astrale invocation, publication, installation, routing, and issuer protocols",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -133,8 +133,8 @@
|
|
|
133
133
|
"access": "public"
|
|
134
134
|
},
|
|
135
135
|
"dependencies": {
|
|
136
|
-
"@astrale-os/kernel-core": "0.9.0-beta.
|
|
137
|
-
"@astrale-os/kernel-dsl": "0.2.0-beta.
|
|
136
|
+
"@astrale-os/kernel-core": "0.9.0-beta.23",
|
|
137
|
+
"@astrale-os/kernel-dsl": "0.2.0-beta.17",
|
|
138
138
|
"@noble/hashes": "2.3.0"
|
|
139
139
|
},
|
|
140
140
|
"devDependencies": {
|