@brud/kernel 0.0.1 → 0.0.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/LICENSE +0 -0
- package/README.md +0 -0
- package/dist/index.d.ts +0 -0
- package/dist/index.js +0 -0
- package/dist/serviceModules/events.d.ts +0 -0
- package/dist/serviceModules/events.js +0 -0
- package/dist/serviceModules/exposedApiRegistry.d.ts +0 -0
- package/dist/serviceModules/exposedApiRegistry.js +0 -0
- package/dist/serviceModules/identityRegistry.d.ts +0 -0
- package/dist/serviceModules/identityRegistry.js +0 -0
- package/dist/serviceModules/interception.d.ts +0 -0
- package/dist/serviceModules/interception.js +0 -0
- package/dist/serviceModules/parser.d.ts +0 -0
- package/dist/serviceModules/parser.js +0 -0
- package/dist/serviceModules/router.d.ts +0 -0
- package/dist/serviceModules/router.js +0 -0
- package/dist/serviceModules/wasmCage.d.ts +0 -0
- package/dist/serviceModules/wasmCage.js +0 -0
- package/dist/services/Events/contracts/IEventsService.d.ts +0 -0
- package/dist/services/Events/contracts/IEventsService.js +0 -0
- package/dist/services/Events/contracts/errors.d.ts +0 -0
- package/dist/services/Events/contracts/errors.js +0 -0
- package/dist/services/Events/contracts/index.d.ts +0 -0
- package/dist/services/Events/contracts/index.js +0 -0
- package/dist/services/Events/contracts/tokens.d.ts +0 -0
- package/dist/services/Events/contracts/tokens.js +0 -0
- package/dist/services/Events/descriptor/EventsDescriptor.d.ts +0 -0
- package/dist/services/Events/descriptor/EventsDescriptor.js +0 -0
- package/dist/services/Events/descriptor/tokens.d.ts +0 -0
- package/dist/services/Events/descriptor/tokens.js +0 -0
- package/dist/services/Events/index.d.ts +0 -0
- package/dist/services/Events/index.js +0 -0
- package/dist/services/Events/orchestrator/EventsService.d.ts +0 -0
- package/dist/services/Events/orchestrator/EventsService.js +0 -0
- package/dist/services/Events/orchestrator/index.d.ts +0 -0
- package/dist/services/Events/orchestrator/index.js +0 -0
- package/dist/services/Events/orchestrator/limits.d.ts +0 -0
- package/dist/services/Events/orchestrator/limits.js +0 -0
- package/dist/services/Events/serviceModule.d.ts +0 -0
- package/dist/services/Events/serviceModule.js +0 -0
- package/dist/services/ExposedApiRegistry/contracts/IExposedApiRegistry.d.ts +13 -1
- package/dist/services/ExposedApiRegistry/contracts/IExposedApiRegistry.js +0 -0
- package/dist/services/ExposedApiRegistry/contracts/errors.d.ts +0 -0
- package/dist/services/ExposedApiRegistry/contracts/errors.js +0 -0
- package/dist/services/ExposedApiRegistry/contracts/index.d.ts +1 -1
- package/dist/services/ExposedApiRegistry/contracts/index.js +0 -0
- package/dist/services/ExposedApiRegistry/contracts/policy.d.ts +0 -0
- package/dist/services/ExposedApiRegistry/contracts/policy.js +0 -0
- package/dist/services/ExposedApiRegistry/contracts/registrant.d.ts +0 -0
- package/dist/services/ExposedApiRegistry/contracts/registrant.js +0 -0
- package/dist/services/ExposedApiRegistry/contracts/types.d.ts +21 -0
- package/dist/services/ExposedApiRegistry/contracts/types.js +0 -0
- package/dist/services/ExposedApiRegistry/descriptor/ExposedApiRegistryDescriptor.d.ts +2 -2
- package/dist/services/ExposedApiRegistry/descriptor/ExposedApiRegistryDescriptor.js +2 -2
- package/dist/services/ExposedApiRegistry/descriptor/tokens.d.ts +0 -0
- package/dist/services/ExposedApiRegistry/descriptor/tokens.js +0 -0
- package/dist/services/ExposedApiRegistry/index.d.ts +0 -0
- package/dist/services/ExposedApiRegistry/index.js +0 -0
- package/dist/services/ExposedApiRegistry/orchestrator/ExposedApiRegistryService.d.ts +9 -2
- package/dist/services/ExposedApiRegistry/orchestrator/ExposedApiRegistryService.js +50 -5
- package/dist/services/ExposedApiRegistry/orchestrator/index.d.ts +0 -0
- package/dist/services/ExposedApiRegistry/orchestrator/index.js +0 -0
- package/dist/services/ExposedApiRegistry/serviceModule.d.ts +0 -0
- package/dist/services/ExposedApiRegistry/serviceModule.js +0 -0
- package/dist/services/ExposedApiRegistry/storage/protection.d.ts +0 -0
- package/dist/services/ExposedApiRegistry/storage/protection.js +0 -0
- package/dist/services/ExposedApiRegistry/storage/scopeRecord.d.ts +0 -0
- package/dist/services/ExposedApiRegistry/storage/scopeRecord.js +0 -0
- package/dist/services/IdentityRegistry/contracts/errors.d.ts +0 -0
- package/dist/services/IdentityRegistry/contracts/errors.js +0 -0
- package/dist/services/IdentityRegistry/contracts/index.d.ts +0 -0
- package/dist/services/IdentityRegistry/contracts/index.js +0 -0
- package/dist/services/IdentityRegistry/contracts/types.d.ts +0 -0
- package/dist/services/IdentityRegistry/contracts/types.js +0 -0
- package/dist/services/IdentityRegistry/descriptor/descriptor.d.ts +0 -0
- package/dist/services/IdentityRegistry/descriptor/descriptor.js +0 -0
- package/dist/services/IdentityRegistry/descriptor/tokens.d.ts +0 -0
- package/dist/services/IdentityRegistry/descriptor/tokens.js +0 -0
- package/dist/services/IdentityRegistry/index.d.ts +0 -0
- package/dist/services/IdentityRegistry/index.js +0 -0
- package/dist/services/IdentityRegistry/orchestrator/IdentityRegistryService.d.ts +0 -0
- package/dist/services/IdentityRegistry/orchestrator/IdentityRegistryService.js +0 -0
- package/dist/services/IdentityRegistry/serviceModule.d.ts +0 -0
- package/dist/services/IdentityRegistry/serviceModule.js +0 -0
- package/dist/services/IdentityRegistry/storage/registryDocument.d.ts +0 -0
- package/dist/services/IdentityRegistry/storage/registryDocument.js +0 -0
- package/dist/services/Interception/contracts/IInterceptionService.d.ts +91 -1
- package/dist/services/Interception/contracts/IInterceptionService.js +12 -1
- package/dist/services/Interception/contracts/errors.d.ts +0 -0
- package/dist/services/Interception/contracts/errors.js +0 -0
- package/dist/services/Interception/contracts/index.d.ts +0 -0
- package/dist/services/Interception/contracts/index.js +0 -0
- package/dist/services/Interception/contracts/tokens.d.ts +0 -0
- package/dist/services/Interception/contracts/tokens.js +0 -0
- package/dist/services/Interception/descriptor/InterceptionDescriptor.d.ts +1 -1
- package/dist/services/Interception/descriptor/InterceptionDescriptor.js +2 -1
- package/dist/services/Interception/descriptor/tokens.d.ts +0 -0
- package/dist/services/Interception/descriptor/tokens.js +0 -0
- package/dist/services/Interception/index.d.ts +0 -0
- package/dist/services/Interception/index.js +0 -0
- package/dist/services/Interception/orchestrator/InterceptionService.d.ts +9 -1
- package/dist/services/Interception/orchestrator/InterceptionService.js +167 -4
- package/dist/services/Interception/orchestrator/index.d.ts +0 -0
- package/dist/services/Interception/orchestrator/index.js +0 -0
- package/dist/services/Interception/serviceModule.d.ts +0 -0
- package/dist/services/Interception/serviceModule.js +0 -0
- package/dist/services/Parser/contracts/IParserService.d.ts +0 -0
- package/dist/services/Parser/contracts/IParserService.js +0 -0
- package/dist/services/Parser/contracts/errors.d.ts +0 -0
- package/dist/services/Parser/contracts/errors.js +0 -0
- package/dist/services/Parser/contracts/index.d.ts +0 -0
- package/dist/services/Parser/contracts/index.js +0 -0
- package/dist/services/Parser/contracts/types.d.ts +0 -0
- package/dist/services/Parser/contracts/types.js +0 -0
- package/dist/services/Parser/descriptor/ParserDescriptor.d.ts +0 -0
- package/dist/services/Parser/descriptor/ParserDescriptor.js +0 -0
- package/dist/services/Parser/descriptor/tokens.d.ts +0 -0
- package/dist/services/Parser/descriptor/tokens.js +0 -0
- package/dist/services/Parser/index.d.ts +0 -0
- package/dist/services/Parser/index.js +0 -0
- package/dist/services/Parser/orchestrator/ParserService.d.ts +0 -0
- package/dist/services/Parser/orchestrator/ParserService.js +0 -0
- package/dist/services/Parser/orchestrator/index.d.ts +0 -0
- package/dist/services/Parser/orchestrator/index.js +0 -0
- package/dist/services/Parser/parser/indexSynthesis.d.ts +0 -0
- package/dist/services/Parser/parser/indexSynthesis.js +0 -0
- package/dist/services/Parser/parser/parameters.d.ts +0 -0
- package/dist/services/Parser/parser/parameters.js +0 -0
- package/dist/services/Parser/parser/scanner.d.ts +0 -0
- package/dist/services/Parser/parser/scanner.js +0 -0
- package/dist/services/Parser/parser/syntax.d.ts +0 -0
- package/dist/services/Parser/parser/syntax.js +0 -0
- package/dist/services/Parser/serviceModule.d.ts +0 -0
- package/dist/services/Parser/serviceModule.js +0 -0
- package/dist/services/Router/bootOptions.d.ts +0 -0
- package/dist/services/Router/bootOptions.js +0 -0
- package/dist/services/Router/contracts/IRouterService.d.ts +1 -1
- package/dist/services/Router/contracts/IRouterService.js +0 -0
- package/dist/services/Router/contracts/caller.d.ts +0 -0
- package/dist/services/Router/contracts/caller.js +0 -0
- package/dist/services/Router/contracts/errors.d.ts +12 -1
- package/dist/services/Router/contracts/errors.js +15 -0
- package/dist/services/Router/contracts/index.d.ts +2 -2
- package/dist/services/Router/contracts/index.js +1 -1
- package/dist/services/Router/contracts/kind.d.ts +0 -0
- package/dist/services/Router/contracts/kind.js +0 -0
- package/dist/services/Router/contracts/registrant.d.ts +0 -0
- package/dist/services/Router/contracts/registrant.js +0 -0
- package/dist/services/Router/contracts/types.d.ts +28 -8
- package/dist/services/Router/contracts/types.js +0 -0
- package/dist/services/Router/descriptor/RouterDescriptor.d.ts +0 -0
- package/dist/services/Router/descriptor/RouterDescriptor.js +1 -1
- package/dist/services/Router/descriptor/tokens.d.ts +0 -0
- package/dist/services/Router/descriptor/tokens.js +0 -0
- package/dist/services/Router/index.d.ts +0 -0
- package/dist/services/Router/index.js +0 -0
- package/dist/services/Router/orchestrator/RouterService.d.ts +22 -3
- package/dist/services/Router/orchestrator/RouterService.js +131 -6
- package/dist/services/Router/orchestrator/index.d.ts +0 -0
- package/dist/services/Router/orchestrator/index.js +0 -0
- package/dist/services/Router/serviceModule.d.ts +0 -0
- package/dist/services/Router/serviceModule.js +0 -0
- package/dist/services/WasmCage/index.d.ts +0 -0
- package/dist/services/WasmCage/index.js +0 -0
- package/dist/services/WasmCage/scripts/prepin.d.ts +0 -0
- package/dist/services/WasmCage/scripts/prepin.js +0 -0
- package/dist/services/WasmCage/serviceModule.d.ts +0 -0
- package/dist/services/WasmCage/serviceModule.js +0 -0
- package/dist/services/WasmCage/src/caged.d.ts +19 -2
- package/dist/services/WasmCage/src/caged.js +85 -6
- package/dist/services/WasmCage/src/descriptor.d.ts +0 -0
- package/dist/services/WasmCage/src/descriptor.js +0 -0
- package/dist/services/WasmCage/src/native.d.ts +0 -0
- package/dist/services/WasmCage/src/native.js +0 -0
- package/dist/services/WasmCage/src/nativeDigests.d.ts +0 -0
- package/dist/services/WasmCage/src/nativeDigests.js +5 -5
- package/dist/services/WasmCage/src/package.d.ts +0 -0
- package/dist/services/WasmCage/src/package.js +0 -0
- package/dist/services/shared/canonicalJson.d.ts +0 -0
- package/dist/services/shared/canonicalJson.js +0 -0
- package/dist/services/shared/documentStore.d.ts +0 -0
- package/dist/services/shared/documentStore.js +0 -0
- package/dist/src/bootstrap/bootKernelInternal.d.ts +4 -3
- package/dist/src/bootstrap/bootKernelInternal.js +284 -71
- package/dist/src/bootstrap/bootTypes.d.ts +25 -1
- package/dist/src/bootstrap/bootTypes.js +0 -0
- package/dist/src/bootstrap/config/index.d.ts +0 -0
- package/dist/src/bootstrap/config/index.js +0 -0
- package/dist/src/bootstrap/config/integrity.d.ts +11 -0
- package/dist/src/bootstrap/config/integrity.js +13 -0
- package/dist/src/bootstrap/config/parse.d.ts +0 -0
- package/dist/src/bootstrap/config/parse.js +0 -0
- package/dist/src/bootstrap/config/pathWriteGuard.d.ts +0 -0
- package/dist/src/bootstrap/config/pathWriteGuard.js +0 -0
- package/dist/src/bootstrap/config/types.d.ts +1 -1
- package/dist/src/bootstrap/config/types.js +0 -0
- package/dist/src/bootstrap/hardcore.d.ts +0 -0
- package/dist/src/bootstrap/hardcore.js +0 -0
- package/dist/src/bootstrap/hardcoreServices.d.ts +0 -0
- package/dist/src/bootstrap/hardcoreServices.js +14 -14
- package/dist/src/bootstrap/index.d.ts +6 -1
- package/dist/src/bootstrap/index.js +2 -0
- package/dist/src/bootstrap/loaded.d.ts +30 -0
- package/dist/src/bootstrap/loaded.js +45 -0
- package/dist/src/bootstrap/packageRequirements.d.ts +0 -0
- package/dist/src/bootstrap/packageRequirements.js +0 -0
- package/dist/src/bootstrap/reload.d.ts +44 -0
- package/dist/src/bootstrap/reload.js +45 -0
- package/dist/src/bootstrap/seal.d.ts +32 -0
- package/dist/src/bootstrap/seal.js +101 -0
- package/dist/src/contracts/accessBroker.d.ts +0 -0
- package/dist/src/contracts/accessBroker.js +0 -0
- package/dist/src/contracts/brudOperation.d.ts +0 -0
- package/dist/src/contracts/brudOperation.js +0 -0
- package/dist/src/contracts/callChain.d.ts +0 -0
- package/dist/src/contracts/callChain.js +0 -0
- package/dist/src/contracts/capability.d.ts +0 -0
- package/dist/src/contracts/capability.js +0 -0
- package/dist/src/contracts/capabilitySet.d.ts +23 -0
- package/dist/src/contracts/capabilitySet.js +72 -0
- package/dist/src/contracts/container.d.ts +0 -0
- package/dist/src/contracts/container.js +0 -0
- package/dist/src/contracts/context.d.ts +0 -0
- package/dist/src/contracts/context.js +0 -0
- package/dist/src/contracts/contextContract.d.ts +11 -8
- package/dist/src/contracts/contextContract.js +21 -32
- package/dist/src/contracts/dispatchView.d.ts +3 -3
- package/dist/src/contracts/dispatchView.js +0 -0
- package/dist/src/contracts/handler.d.ts +0 -7
- package/dist/src/contracts/handler.js +0 -0
- package/dist/src/contracts/index.d.ts +2 -1
- package/dist/src/contracts/index.js +1 -0
- package/dist/src/contracts/kernel.d.ts +0 -0
- package/dist/src/contracts/kernel.js +0 -0
- package/dist/src/contracts/lifecycle.d.ts +0 -0
- package/dist/src/contracts/lifecycle.js +0 -0
- package/dist/src/contracts/manifest.d.ts +35 -0
- package/dist/src/contracts/manifest.js +62 -23
- package/dist/src/contracts/pipeline.d.ts +0 -0
- package/dist/src/contracts/pipeline.js +0 -0
- package/dist/src/contracts/policy.d.ts +0 -0
- package/dist/src/contracts/policy.js +0 -0
- package/dist/src/contracts/registry.d.ts +0 -0
- package/dist/src/contracts/registry.js +0 -0
- package/dist/src/contracts/serviceDescriptor.d.ts +0 -0
- package/dist/src/contracts/serviceDescriptor.js +0 -0
- package/dist/src/contracts/serviceToken.d.ts +0 -0
- package/dist/src/contracts/serviceToken.js +0 -0
- package/dist/src/engine/BrudKernel.d.ts +2 -0
- package/dist/src/engine/BrudKernel.js +35 -6
- package/dist/src/engine/ExecutionPipeline.d.ts +0 -0
- package/dist/src/engine/ExecutionPipeline.js +0 -0
- package/dist/src/engine/KernelAccessBroker.d.ts +0 -0
- package/dist/src/engine/KernelAccessBroker.js +0 -0
- package/dist/src/engine/KernelRegistry.d.ts +0 -0
- package/dist/src/engine/KernelRegistry.js +0 -0
- package/dist/src/engine/OperationRegistry.d.ts +0 -0
- package/dist/src/engine/OperationRegistry.js +0 -0
- package/dist/src/engine/ServiceContainer.d.ts +0 -0
- package/dist/src/engine/ServiceContainer.js +0 -0
- package/dist/src/engine/callChain.d.ts +0 -0
- package/dist/src/engine/callChain.js +5 -10
- package/dist/src/engine/dag.d.ts +0 -0
- package/dist/src/engine/dag.js +0 -0
- package/dist/src/engine/errors.d.ts +0 -0
- package/dist/src/engine/errors.js +0 -0
- package/dist/src/engine/index.d.ts +0 -0
- package/dist/src/engine/index.js +0 -0
- package/dist/src/engine/state.d.ts +0 -0
- package/dist/src/engine/state.js +0 -0
- package/dist/src/validation/jsonSchema/compile.d.ts +0 -0
- package/dist/src/validation/jsonSchema/compile.js +0 -0
- package/dist/src/validation/jsonSchema/index.d.ts +0 -0
- package/dist/src/validation/jsonSchema/index.js +0 -0
- package/dist/src/validation/jsonSchema/jsonValue.d.ts +0 -0
- package/dist/src/validation/jsonSchema/jsonValue.js +0 -0
- package/dist/src/validation/jsonSchema/pattern.d.ts +0 -0
- package/dist/src/validation/jsonSchema/pattern.js +0 -0
- package/dist/src/validation/jsonSchema/types.d.ts +0 -0
- package/dist/src/validation/jsonSchema/types.js +0 -0
- package/package.json +1 -1
- package/services/WasmCage/native/brud-wasm-cage.darwin-arm64.node +0 -0
- package/services/WasmCage/native/brud-wasm-cage.darwin-x64.node +0 -0
- package/services/WasmCage/native/brud-wasm-cage.linux-arm64-gnu.node +0 -0
- package/services/WasmCage/native/brud-wasm-cage.linux-x64-gnu.node +0 -0
- package/services/WasmCage/native/brud-wasm-cage.win32-x64-msvc.node +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AdmittedManifest, KernelCallAuthority } from '../../../src/contracts/index.js';
|
|
2
2
|
import type { ExposedApiCaller } from '../../ExposedApiRegistry/contracts/types.js';
|
|
3
|
-
import type
|
|
3
|
+
import { type IInterceptionService, type InterceptionEvaluateOptions, type InterceptionOutcome, type InterceptionResultOutcome } from '../contracts/IInterceptionService.js';
|
|
4
4
|
/** One participant of the composition, as the boot hook hands it over. */
|
|
5
5
|
export interface InterceptionParticipant {
|
|
6
6
|
readonly token: string;
|
|
@@ -29,4 +29,12 @@ export declare class InterceptionService implements IInterceptionService {
|
|
|
29
29
|
* (fail closed).
|
|
30
30
|
*/
|
|
31
31
|
evaluateAs(resolver: ExposedApiCaller | undefined, target: string, method: string, args: readonly unknown[], options?: InterceptionEvaluateOptions): InterceptionOutcome;
|
|
32
|
+
evaluateResult(target: string, method: string, args: readonly unknown[], result: unknown, options?: InterceptionEvaluateOptions): InterceptionResultOutcome;
|
|
33
|
+
/**
|
|
34
|
+
* Runs the output stage for `resolver`, which must be the point's owner. The
|
|
35
|
+
* interceptors that declared the stage run in the giver's admitted order,
|
|
36
|
+
* each as itself and each seeing only the original result; each may append
|
|
37
|
+
* one piece of content and nothing else. Any failure withholds the result.
|
|
38
|
+
*/
|
|
39
|
+
evaluateResultAs(resolver: ExposedApiCaller | undefined, target: string, method: string, args: readonly unknown[], result: unknown, options?: InterceptionEvaluateOptions): InterceptionResultOutcome;
|
|
32
40
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { createCapabilitySet } from '../../../src/contracts/capabilitySet.js';
|
|
1
2
|
import { compileJsonSchema } from '../../../src/validation/jsonSchema/index.js';
|
|
2
|
-
import { freezeJsonCopy } from '../../../src/validation/jsonSchema/jsonValue.js';
|
|
3
|
+
import { freezeJsonCopy, inspectJsonValue } from '../../../src/validation/jsonSchema/jsonValue.js';
|
|
3
4
|
import { InterceptionDeclarationError } from '../contracts/errors.js';
|
|
5
|
+
import { INTERCEPTION_OUTPUT_CEILINGS, } from '../contracts/IInterceptionService.js';
|
|
4
6
|
/** Source name the interception hardcore records observations under. */
|
|
5
7
|
const OBSERVATION_SOURCE = 'brud.core.interception';
|
|
6
8
|
/** Arguments must be a plain JSON array within the kernel validator's limits. */
|
|
@@ -23,6 +25,36 @@ function pointKey(name, version) {
|
|
|
23
25
|
function isInterceptor(value) {
|
|
24
26
|
return typeof value?.intercept === 'function';
|
|
25
27
|
}
|
|
28
|
+
function isResultInterceptor(value) {
|
|
29
|
+
return typeof value?.interceptResult === 'function';
|
|
30
|
+
}
|
|
31
|
+
/** Largest value shape the output stage will carry: plain JSON of ordinary size. */
|
|
32
|
+
const OUTPUT_JSON_LIMITS = Object.freeze({ maxDepth: 64, maxNodes: 100_000 });
|
|
33
|
+
function jsonBytes(value) {
|
|
34
|
+
return Buffer.byteLength(JSON.stringify(value), 'utf8');
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Reads a point's `outputLimits`: any of the three limits may be lowered,
|
|
38
|
+
* none may be raised above its kernel ceiling, and one addition may not be
|
|
39
|
+
* allowed to exceed all additions together.
|
|
40
|
+
*/
|
|
41
|
+
function parseOutputLimits(owner, key, declared) {
|
|
42
|
+
const limits = { ...INTERCEPTION_OUTPUT_CEILINGS };
|
|
43
|
+
for (const [name, value] of Object.entries(declared ?? {})) {
|
|
44
|
+
if (!(name in INTERCEPTION_OUTPUT_CEILINGS)) {
|
|
45
|
+
throw new InterceptionDeclarationError(owner, `outputLimits of "${key}" has an unknown limit "${name}"`);
|
|
46
|
+
}
|
|
47
|
+
const ceiling = INTERCEPTION_OUTPUT_CEILINGS[name];
|
|
48
|
+
if (typeof value !== 'number' || !Number.isInteger(value) || value < 1 || value > ceiling) {
|
|
49
|
+
throw new InterceptionDeclarationError(owner, `outputLimits.${name} of "${key}" must be a whole number from 1 to ${String(ceiling)}`);
|
|
50
|
+
}
|
|
51
|
+
limits[name] = value;
|
|
52
|
+
}
|
|
53
|
+
if (limits.maxAdditionBytes > limits.maxTotalBytes) {
|
|
54
|
+
throw new InterceptionDeclarationError(owner, `outputLimits of "${key}" allow one addition to exceed all additions together`);
|
|
55
|
+
}
|
|
56
|
+
return Object.freeze(limits);
|
|
57
|
+
}
|
|
26
58
|
function isValidArgs(value) {
|
|
27
59
|
return Array.isArray(value) && ARGS_SCHEMA.validate(value).valid;
|
|
28
60
|
}
|
|
@@ -82,9 +114,15 @@ export class InterceptionService {
|
|
|
82
114
|
if (interceptor.identity === undefined) {
|
|
83
115
|
throw new InterceptionDeclarationError(token, 'is admitted as an interceptor but has no kernel identity');
|
|
84
116
|
}
|
|
85
|
-
|
|
117
|
+
const declared = interceptor.manifest.interceptions.find((entry) => pointKey(entry.target, entry.version) === key);
|
|
118
|
+
return Object.freeze({ token, identity: interceptor.identity, stages: Object.freeze([...(declared?.stages ?? ['output'])]) });
|
|
86
119
|
});
|
|
87
|
-
this.#points.set(key, Object.freeze({
|
|
120
|
+
this.#points.set(key, Object.freeze({
|
|
121
|
+
key,
|
|
122
|
+
owner,
|
|
123
|
+
interceptors: Object.freeze(interceptors),
|
|
124
|
+
limits: parseOutputLimits(participant.token, key, point.outputLimits),
|
|
125
|
+
}));
|
|
88
126
|
}
|
|
89
127
|
}
|
|
90
128
|
for (const [key, tokens] of requests) {
|
|
@@ -134,12 +172,16 @@ export class InterceptionService {
|
|
|
134
172
|
identity: caller.identity,
|
|
135
173
|
callerClass: caller.callerClass,
|
|
136
174
|
official: caller.official,
|
|
137
|
-
|
|
175
|
+
// The giver names the caller it is intercepting for; whatever it passes, the interceptor sees the one read-only shape.
|
|
176
|
+
capabilities: createCapabilitySet(caller.capabilities ?? []),
|
|
138
177
|
origin: caller.origin,
|
|
139
178
|
}),
|
|
140
179
|
});
|
|
141
180
|
const modifiedBy = [];
|
|
142
181
|
for (const interceptor of point.interceptors) {
|
|
182
|
+
if (!interceptor.stages.includes('input')) {
|
|
183
|
+
continue;
|
|
184
|
+
}
|
|
143
185
|
let verdict;
|
|
144
186
|
try {
|
|
145
187
|
const instance = authority.instanceOf(interceptor.identity);
|
|
@@ -169,6 +211,127 @@ export class InterceptionService {
|
|
|
169
211
|
}
|
|
170
212
|
return Object.freeze({ allowed: true, args: call.args, modifiedBy: Object.freeze(modifiedBy) });
|
|
171
213
|
}
|
|
214
|
+
evaluateResult(target, method, args, result, options) {
|
|
215
|
+
const context = this.authority?.current();
|
|
216
|
+
const caller = context === undefined ? undefined : { ...context.caller, origin: context.origin };
|
|
217
|
+
return this.evaluateResultAs(caller, target, method, args, result, options);
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* Runs the output stage for `resolver`, which must be the point's owner. The
|
|
221
|
+
* interceptors that declared the stage run in the giver's admitted order,
|
|
222
|
+
* each as itself and each seeing only the original result; each may append
|
|
223
|
+
* one piece of content and nothing else. Any failure withholds the result.
|
|
224
|
+
*/
|
|
225
|
+
evaluateResultAs(resolver, target, method, args, result, options) {
|
|
226
|
+
const key = target.includes('@') ? target : `${target}@1`;
|
|
227
|
+
const point = this.#points.get(key);
|
|
228
|
+
const authority = this.authority;
|
|
229
|
+
if (authority === undefined) {
|
|
230
|
+
return this.#refuseResult(key, 'interception is not bound');
|
|
231
|
+
}
|
|
232
|
+
if (point === undefined) {
|
|
233
|
+
return this.#refuseResult(key, 'unknown interception point');
|
|
234
|
+
}
|
|
235
|
+
if (resolver?.identity === null || resolver?.identity === undefined || resolver.identity !== point.owner) {
|
|
236
|
+
return this.#refuseResult(key, 'only the interception point owner may evaluate it');
|
|
237
|
+
}
|
|
238
|
+
const taking = point.interceptors.filter((interceptor) => interceptor.stages.includes('output'));
|
|
239
|
+
if (taking.length === 0) {
|
|
240
|
+
return Object.freeze({ applied: false });
|
|
241
|
+
}
|
|
242
|
+
if (typeof method !== 'string' || method.length === 0 || !isValidArgs(args)) {
|
|
243
|
+
return this.#refuseResult(key, 'method must be a non-empty string and args a plain JSON array');
|
|
244
|
+
}
|
|
245
|
+
// A result the output stage cannot carry is the giver's own data, never an
|
|
246
|
+
// interceptor's doing. The stage is skipped and the giver ships its result.
|
|
247
|
+
if (inspectJsonValue(result, OUTPUT_JSON_LIMITS) !== null) {
|
|
248
|
+
return this.#skipStage(key, 'the result must be plain JSON to take part in the output stage');
|
|
249
|
+
}
|
|
250
|
+
const resultBytes = result === undefined ? 0 : jsonBytes(result);
|
|
251
|
+
if (resultBytes > point.limits.maxResultBytes) {
|
|
252
|
+
return this.#skipStage(key, `the result is ${String(resultBytes)} bytes; the limit is ${String(point.limits.maxResultBytes)}`);
|
|
253
|
+
}
|
|
254
|
+
const caller = options?.caller ?? resolver;
|
|
255
|
+
const frozenResult = freezeJsonCopy(result);
|
|
256
|
+
const call = Object.freeze({
|
|
257
|
+
target: key,
|
|
258
|
+
method,
|
|
259
|
+
args: freezeJsonCopy(args),
|
|
260
|
+
caller: Object.freeze({
|
|
261
|
+
identity: caller.identity,
|
|
262
|
+
callerClass: caller.callerClass,
|
|
263
|
+
official: caller.official,
|
|
264
|
+
capabilities: createCapabilitySet(caller.capabilities ?? []),
|
|
265
|
+
origin: caller.origin,
|
|
266
|
+
}),
|
|
267
|
+
result: frozenResult,
|
|
268
|
+
});
|
|
269
|
+
const additions = [];
|
|
270
|
+
const ran = [];
|
|
271
|
+
const skipped = [];
|
|
272
|
+
let total = 0;
|
|
273
|
+
// The output stage can only append, so an interceptor that misbehaves is
|
|
274
|
+
// skipped and the result is delivered without its contribution. It must
|
|
275
|
+
// never be able to withhold the giver's result by failing.
|
|
276
|
+
for (const interceptor of taking) {
|
|
277
|
+
const skip = (reason) => {
|
|
278
|
+
skipped.push(Object.freeze({ interceptor: interceptor.token, reason }));
|
|
279
|
+
authority.observe(OBSERVATION_SOURCE, 'interception.result.skipped', { target: key, method, interceptor: interceptor.token, reason });
|
|
280
|
+
};
|
|
281
|
+
let verdict;
|
|
282
|
+
try {
|
|
283
|
+
const instance = authority.instanceOf(interceptor.identity);
|
|
284
|
+
if (!isResultInterceptor(instance)) {
|
|
285
|
+
throw new Error('the interceptor does not implement interceptResult (an interceptor that means to see arguments must declare the input stage)');
|
|
286
|
+
}
|
|
287
|
+
verdict = authority.runAs(interceptor.identity, () => instance.interceptResult(call));
|
|
288
|
+
}
|
|
289
|
+
catch (error) {
|
|
290
|
+
skip(error instanceof Error ? error.message : 'interceptor threw');
|
|
291
|
+
continue;
|
|
292
|
+
}
|
|
293
|
+
if (verdict?.verdict === 'none') {
|
|
294
|
+
ran.push(interceptor.token);
|
|
295
|
+
authority.observe(OBSERVATION_SOURCE, 'interception.result.unchanged', { target: key, method, interceptor: interceptor.token });
|
|
296
|
+
continue;
|
|
297
|
+
}
|
|
298
|
+
if (verdict?.verdict !== 'append' || inspectJsonValue(verdict.content, OUTPUT_JSON_LIMITS) !== null || verdict.content === undefined) {
|
|
299
|
+
skip('invalid output verdict: the output stage can only append');
|
|
300
|
+
continue;
|
|
301
|
+
}
|
|
302
|
+
const bytes = jsonBytes(verdict.content);
|
|
303
|
+
if (bytes > point.limits.maxAdditionBytes) {
|
|
304
|
+
skip(`the addition is ${String(bytes)} bytes; the limit is ${String(point.limits.maxAdditionBytes)}`);
|
|
305
|
+
continue;
|
|
306
|
+
}
|
|
307
|
+
if (total + bytes > point.limits.maxTotalBytes) {
|
|
308
|
+
skip(`the additions together would exceed ${String(point.limits.maxTotalBytes)} bytes`);
|
|
309
|
+
continue;
|
|
310
|
+
}
|
|
311
|
+
total += bytes;
|
|
312
|
+
ran.push(interceptor.token);
|
|
313
|
+
additions.push(Object.freeze({ interceptor: interceptor.token, content: freezeJsonCopy(verdict.content) }));
|
|
314
|
+
authority.observe(OBSERVATION_SOURCE, 'interception.result.appended', { target: key, method, interceptor: interceptor.token, bytes });
|
|
315
|
+
}
|
|
316
|
+
return Object.freeze({
|
|
317
|
+
applied: true,
|
|
318
|
+
allowed: true,
|
|
319
|
+
envelope: Object.freeze({
|
|
320
|
+
result: frozenResult,
|
|
321
|
+
additions: Object.freeze(additions),
|
|
322
|
+
interceptedBy: Object.freeze(ran),
|
|
323
|
+
skipped: Object.freeze(skipped),
|
|
324
|
+
}),
|
|
325
|
+
});
|
|
326
|
+
}
|
|
327
|
+
#refuseResult(key, reason) {
|
|
328
|
+
this.authority?.observe(OBSERVATION_SOURCE, 'interception.result.refused', { target: key, reason });
|
|
329
|
+
return Object.freeze({ applied: true, allowed: false, reason });
|
|
330
|
+
}
|
|
331
|
+
#skipStage(key, reason) {
|
|
332
|
+
this.authority?.observe(OBSERVATION_SOURCE, 'interception.result.stage-skipped', { target: key, reason });
|
|
333
|
+
return Object.freeze({ applied: false });
|
|
334
|
+
}
|
|
172
335
|
#refuse(key, reason) {
|
|
173
336
|
this.authority?.observe(OBSERVATION_SOURCE, 'interception.refused', { target: key, reason });
|
|
174
337
|
return Object.freeze({ allowed: false, reason });
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -6,7 +6,7 @@ import type { BrudKindInfo, BrudDispatchCaller, BrudRouteOptions, BrudRouteRegis
|
|
|
6
6
|
*
|
|
7
7
|
* Accepts boot-time kind registrations from kernel services, resolves the
|
|
8
8
|
* owning service through the kernel access broker with its `ServiceToken`, and
|
|
9
|
-
* dispatches parsed operations. It
|
|
9
|
+
* dispatches parsed operations. It routes only to the service that owns a kind.
|
|
10
10
|
*/
|
|
11
11
|
export interface IRouterService {
|
|
12
12
|
/**
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** Stable, machine-readable codes for Router failures. */
|
|
2
|
-
export type RouterErrorCode = 'ROUTER_REGISTRATION_CLOSED' | 'ROUTER_KIND_COLLISION' | 'ROUTER_INVALID_KIND' | 'ROUTER_UNKNOWN_SERVICE' | 'ROUTER_DISPOSED';
|
|
2
|
+
export type RouterErrorCode = 'ROUTER_REGISTRATION_CLOSED' | 'ROUTER_KIND_COLLISION' | 'ROUTER_INVALID_KIND' | 'ROUTER_INVALID_DECLARATION' | 'ROUTER_UNKNOWN_SERVICE' | 'ROUTER_DISPOSED';
|
|
3
3
|
/** Base class for every Router domain failure. */
|
|
4
4
|
export declare abstract class RouterError extends Error {
|
|
5
5
|
/** Stable, machine-readable error code. */
|
|
@@ -16,6 +16,17 @@ export declare class RouterRegistrationClosedError extends RouterError {
|
|
|
16
16
|
*/
|
|
17
17
|
constructor(kind: string);
|
|
18
18
|
}
|
|
19
|
+
/** Raised when a kind's operations or permissions are missing or invalid. Refuses boot. */
|
|
20
|
+
export declare class RouterInvalidDeclarationError extends RouterError {
|
|
21
|
+
readonly code: "ROUTER_INVALID_DECLARATION";
|
|
22
|
+
/** Kind whose declaration was refused. */
|
|
23
|
+
readonly kind: string;
|
|
24
|
+
/**
|
|
25
|
+
* @param kind - Kind whose declaration was refused.
|
|
26
|
+
* @param reason - What is wrong with it.
|
|
27
|
+
*/
|
|
28
|
+
constructor(kind: string, reason: string);
|
|
29
|
+
}
|
|
19
30
|
/** Raised when two services claim the same kind. */
|
|
20
31
|
export declare class RouterKindCollisionError extends RouterError {
|
|
21
32
|
readonly code: "ROUTER_KIND_COLLISION";
|
|
@@ -19,6 +19,21 @@ export class RouterRegistrationClosedError extends RouterError {
|
|
|
19
19
|
this.kind = kind;
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
|
+
/** Raised when a kind's operations or permissions are missing or invalid. Refuses boot. */
|
|
23
|
+
export class RouterInvalidDeclarationError extends RouterError {
|
|
24
|
+
code = 'ROUTER_INVALID_DECLARATION';
|
|
25
|
+
/** Kind whose declaration was refused. */
|
|
26
|
+
kind;
|
|
27
|
+
/**
|
|
28
|
+
* @param kind - Kind whose declaration was refused.
|
|
29
|
+
* @param reason - What is wrong with it.
|
|
30
|
+
*/
|
|
31
|
+
constructor(kind, reason) {
|
|
32
|
+
super(`Kind "${kind}" declaration refused: ${reason}`);
|
|
33
|
+
this.name = 'RouterInvalidDeclarationError';
|
|
34
|
+
this.kind = kind;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
22
37
|
/** Raised when two services claim the same kind. */
|
|
23
38
|
export class RouterKindCollisionError extends RouterError {
|
|
24
39
|
code = 'ROUTER_KIND_COLLISION';
|
|
@@ -3,6 +3,6 @@ export { isValidRouterKind } from './kind.js';
|
|
|
3
3
|
export type { IRouterService } from './IRouterService.js';
|
|
4
4
|
export type { IRouterRegistrant } from './registrant.js';
|
|
5
5
|
export { isRouterRegistrant } from './registrant.js';
|
|
6
|
-
export type { BrudDispatchContext, BrudRouteOptions, BrudRouteRegistration, BrudRouteResult, RouteStatus, RoutedOperationOutcome, RoutedOperationStatus, } from './types.js';
|
|
6
|
+
export type { BrudDispatchContext, BrudKindOperation, BrudPublicKindOperation, BrudRouteOptions, BrudRouteRegistration, BrudRouteResult, RouteStatus, RoutedOperationOutcome, RoutedOperationStatus, } from './types.js';
|
|
7
7
|
export type { RouterErrorCode } from './errors.js';
|
|
8
|
-
export { RouterDisposedError, RouterError, RouterInvalidKindError, RouterKindCollisionError, RouterRegistrationClosedError, RouterUnknownServiceError, } from './errors.js';
|
|
8
|
+
export { RouterDisposedError, RouterError, RouterInvalidDeclarationError, RouterInvalidKindError, RouterKindCollisionError, RouterRegistrationClosedError, RouterUnknownServiceError, } from './errors.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { ROUTER_CALLER_ID } from './caller.js';
|
|
2
2
|
export { isValidRouterKind } from './kind.js';
|
|
3
3
|
export { isRouterRegistrant } from './registrant.js';
|
|
4
|
-
export { RouterDisposedError, RouterError, RouterInvalidKindError, RouterKindCollisionError, RouterRegistrationClosedError, RouterUnknownServiceError, } from './errors.js';
|
|
4
|
+
export { RouterDisposedError, RouterError, RouterInvalidDeclarationError, RouterInvalidKindError, RouterKindCollisionError, RouterRegistrationClosedError, RouterUnknownServiceError, } from './errors.js';
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -2,7 +2,7 @@ import type { BrudOperationKind } from '../../../src/contracts/brudOperation.js'
|
|
|
2
2
|
import type { OperationResult } from '../../../src/contracts/handler.js';
|
|
3
3
|
import type { BrudOperation, BrudParseFailure } from '../../Parser/contracts/index.js';
|
|
4
4
|
/** Terminal status of one routed operation. */
|
|
5
|
-
export type RoutedOperationStatus = 'success' | 'failed' | 'skipped' | 'aborted' | 'kind_not_registered';
|
|
5
|
+
export type RoutedOperationStatus = 'success' | 'failed' | 'skipped' | 'aborted' | 'kind_not_registered' | 'operation_not_declared' | 'permission_denied';
|
|
6
6
|
/**
|
|
7
7
|
* The real caller of a routed operation, captured by the Router from the
|
|
8
8
|
* kernel call chain (delegation by the owner). Never supplied by the caller.
|
|
@@ -11,7 +11,7 @@ export interface BrudDispatchCaller {
|
|
|
11
11
|
readonly identity: string | null;
|
|
12
12
|
readonly callerClass: string;
|
|
13
13
|
readonly official: boolean;
|
|
14
|
-
readonly capabilities:
|
|
14
|
+
readonly capabilities: ReadonlySet<string>;
|
|
15
15
|
readonly origin: string;
|
|
16
16
|
}
|
|
17
17
|
/** Context handed to a kind owner's dispatch exposure for one operation. */
|
|
@@ -72,17 +72,37 @@ export interface BrudRouteRegistration {
|
|
|
72
72
|
readonly version?: number;
|
|
73
73
|
/** Public description declared with the kind. */
|
|
74
74
|
readonly description?: string;
|
|
75
|
-
/**
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
75
|
+
/**
|
|
76
|
+
* Every operation the kind serves. Required: an operation not listed here is
|
|
77
|
+
* refused before the owner is reached.
|
|
78
|
+
*/
|
|
79
|
+
readonly operations: Readonly<Record<string, BrudKindOperation>> | 'open';
|
|
80
|
+
/**
|
|
81
|
+
* Default permission for operations that declare none (a Layer 1 policy
|
|
82
|
+
* object). Required when `operations` is `'open'`: the owner defines the
|
|
83
|
+
* names, and this permission is enforced on every call.
|
|
84
|
+
*/
|
|
85
|
+
readonly permission?: Readonly<Record<string, unknown>>;
|
|
86
|
+
}
|
|
87
|
+
/** One declared operation of a kind. */
|
|
88
|
+
export interface BrudKindOperation {
|
|
89
|
+
readonly description?: string;
|
|
90
|
+
readonly input?: Readonly<Record<string, unknown>>;
|
|
91
|
+
/** Who may call it (a Layer 1 policy object). Falls back to the kind's. */
|
|
92
|
+
readonly permission?: Readonly<Record<string, unknown>>;
|
|
93
|
+
}
|
|
94
|
+
/** One operation as remote clients see it. The permission is not public. */
|
|
95
|
+
export interface BrudPublicKindOperation {
|
|
96
|
+
readonly description?: string;
|
|
97
|
+
readonly input?: Readonly<Record<string, unknown>>;
|
|
80
98
|
}
|
|
81
99
|
/** One kind as remote clients see it: the public vocabulary of Brud syntax. */
|
|
82
100
|
export interface BrudKindInfo {
|
|
83
101
|
readonly kind: BrudOperationKind;
|
|
84
102
|
readonly description?: string;
|
|
85
|
-
readonly operations?:
|
|
103
|
+
readonly operations?: Readonly<Record<string, BrudPublicKindOperation>>;
|
|
104
|
+
/** True when the owner defines the operation names itself, so none are listed. */
|
|
105
|
+
readonly open?: true;
|
|
86
106
|
}
|
|
87
107
|
/** The surface a kind owner's dispatch exposure must provide. */
|
|
88
108
|
export interface BrudKindDispatcher {
|
|
File without changes
|
|
File without changes
|
|
@@ -75,7 +75,7 @@ export function createRouterDescriptor(options) {
|
|
|
75
75
|
identity: caller.identity,
|
|
76
76
|
callerClass: caller.callerClass,
|
|
77
77
|
official: caller.official,
|
|
78
|
-
capabilities:
|
|
78
|
+
capabilities: caller.capabilities,
|
|
79
79
|
origin: caller.origin,
|
|
80
80
|
});
|
|
81
81
|
return Object.freeze({
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -18,11 +18,15 @@ export interface RouterDependencies {
|
|
|
18
18
|
* guard for alternate compositions.
|
|
19
19
|
*
|
|
20
20
|
* Dispatch resolves every target through the access broker with the token the
|
|
21
|
-
* owning service supplied, so access policies still apply and
|
|
22
|
-
*
|
|
21
|
+
* owning service supplied, so access policies still apply and only the
|
|
22
|
+
* owning service can be a routing target.
|
|
23
23
|
*/
|
|
24
24
|
export declare class RouterService implements IRouterService, IServiceLifecycle {
|
|
25
25
|
private readonly registrations;
|
|
26
|
+
/** The parsed permission of every declared operation, by kind then operation. Frozen at registration. */
|
|
27
|
+
private readonly permissions;
|
|
28
|
+
/** The one permission of every kind whose owner defines its operation names. */
|
|
29
|
+
private readonly openKinds;
|
|
26
30
|
private authority;
|
|
27
31
|
private readonly dependencies;
|
|
28
32
|
private parser;
|
|
@@ -54,9 +58,16 @@ export declare class RouterService implements IRouterService, IServiceLifecycle
|
|
|
54
58
|
readonly exposure: string;
|
|
55
59
|
readonly version?: number | string;
|
|
56
60
|
readonly description?: string;
|
|
57
|
-
readonly operations
|
|
61
|
+
readonly operations: BrudRouteRegistration['operations'];
|
|
62
|
+
readonly permission?: BrudRouteRegistration['permission'];
|
|
58
63
|
}): void;
|
|
59
64
|
register(registration: BrudRouteRegistration, owner?: string): void;
|
|
65
|
+
/**
|
|
66
|
+
* Builds the operation registry for one kind: every operation must be
|
|
67
|
+
* declared and carry a valid permission, its own or the kind's. Refuses the
|
|
68
|
+
* declaration, and so the boot, otherwise.
|
|
69
|
+
*/
|
|
70
|
+
private compilePermissions;
|
|
60
71
|
closeRegistration(): void;
|
|
61
72
|
isRegistrationOpen(): boolean;
|
|
62
73
|
registeredKinds(): readonly string[];
|
|
@@ -68,6 +79,14 @@ export declare class RouterService implements IRouterService, IServiceLifecycle
|
|
|
68
79
|
kinds(): readonly BrudKindInfo[];
|
|
69
80
|
route(rawInput: string, options?: BrudRouteOptions, caller?: BrudDispatchCaller): Promise<BrudRouteResult>;
|
|
70
81
|
dispatch(operations: readonly BrudOperation[], options?: BrudRouteOptions, caller?: BrudDispatchCaller): Promise<BrudRouteResult>;
|
|
82
|
+
/**
|
|
83
|
+
* The operation registry check, run before the owner is resolved: the
|
|
84
|
+
* operation must be declared for its kind, and the caller must hold the
|
|
85
|
+
* operation's permission. The reason a permission is denied goes to the
|
|
86
|
+
* observation stream, never to the caller.
|
|
87
|
+
*/
|
|
88
|
+
private refuseBeforeOwner;
|
|
89
|
+
private observeRefusal;
|
|
71
90
|
private resolveParser;
|
|
72
91
|
private buildDispatchContext;
|
|
73
92
|
private failureResult;
|