gh-inari 0.15.0 → 0.17.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/.codex-plugin/plugin.json +1 -1
- package/README.md +8 -0
- package/dist/admission/authorization.d.ts +31 -0
- package/dist/admission/authorization.js +329 -0
- package/dist/admission/authorization.js.map +1 -0
- package/dist/admission/server.d.ts +45 -0
- package/dist/admission/server.js +415 -0
- package/dist/admission/server.js.map +1 -0
- package/dist/admission/setup.d.ts +27 -0
- package/dist/admission/setup.js +84 -0
- package/dist/admission/setup.js.map +1 -0
- package/dist/agent-authority/branch-advance.js +12 -4
- package/dist/agent-authority/branch-advance.js.map +1 -1
- package/dist/agent-authority/capability-admission.js +9 -3
- package/dist/agent-authority/capability-admission.js.map +1 -1
- package/dist/agent-authority/capability-provenance.js +12 -6
- package/dist/agent-authority/capability-provenance.js.map +1 -1
- package/dist/agent-authority/capability.d.ts +5 -3
- package/dist/agent-authority/capability.js +18 -15
- package/dist/agent-authority/capability.js.map +1 -1
- package/dist/agent-authority/runtime-authority-publication-http.d.ts +44 -0
- package/dist/agent-authority/runtime-authority-publication-http.js +181 -0
- package/dist/agent-authority/runtime-authority-publication-http.js.map +1 -0
- package/dist/application/setup/actions.d.ts +38 -0
- package/dist/application/setup/actions.js +283 -0
- package/dist/application/setup/actions.js.map +1 -0
- package/dist/application/setup/index.d.ts +7 -0
- package/dist/application/setup/index.js +8 -0
- package/dist/application/setup/index.js.map +1 -0
- package/dist/application/setup/state.d.ts +139 -0
- package/dist/application/setup/state.js +451 -0
- package/dist/application/setup/state.js.map +1 -0
- package/dist/authority/index.d.ts +2 -0
- package/dist/authority/index.js +3 -0
- package/dist/authority/index.js.map +1 -0
- package/dist/authority/local-migration.d.ts +134 -0
- package/dist/authority/local-migration.js +599 -0
- package/dist/authority/local-migration.js.map +1 -0
- package/dist/authority/local-runtime-authority.d.ts +28 -0
- package/dist/authority/local-runtime-authority.js +64 -0
- package/dist/authority/local-runtime-authority.js.map +1 -0
- package/dist/authority/setup-trust.d.ts +22 -0
- package/dist/authority/setup-trust.js +51 -0
- package/dist/authority/setup-trust.js.map +1 -0
- package/dist/branch-naming.d.ts +85 -4
- package/dist/branch-naming.js +231 -10
- package/dist/branch-naming.js.map +1 -1
- package/dist/change/machine/trusted-execution-adapter.js +8 -3
- package/dist/change/machine/trusted-execution-adapter.js.map +1 -1
- package/dist/change.d.ts +15 -0
- package/dist/change.js +128 -6
- package/dist/change.js.map +1 -1
- package/dist/cli/runtime/admission-client.d.ts +38 -0
- package/dist/cli/runtime/admission-client.js +250 -0
- package/dist/cli/runtime/admission-client.js.map +1 -0
- package/dist/cli/runtime/branch-observation.d.ts +26 -0
- package/dist/cli/runtime/branch-observation.js +108 -0
- package/dist/cli/runtime/branch-observation.js.map +1 -0
- package/dist/cli/runtime/role-status.d.ts +11 -0
- package/dist/cli/runtime/role-status.js +59 -0
- package/dist/cli/runtime/role-status.js.map +1 -0
- package/dist/cli/runtime/session-launcher.d.ts +40 -0
- package/dist/cli/runtime/session-launcher.js +352 -0
- package/dist/cli/runtime/session-launcher.js.map +1 -0
- package/dist/cli/setup/index.d.ts +47 -0
- package/dist/cli/setup/index.js +156 -0
- package/dist/cli/setup/index.js.map +1 -0
- package/dist/cli-core.d.ts +9 -0
- package/dist/cli-core.js +306 -34
- package/dist/cli-core.js.map +1 -1
- package/dist/command-contract.d.ts +11 -6
- package/dist/command-contract.js +18 -8
- package/dist/command-contract.js.map +1 -1
- package/dist/composition/local-runtime-roles.d.ts +13 -0
- package/dist/composition/local-runtime-roles.js +18 -0
- package/dist/composition/local-runtime-roles.js.map +1 -0
- package/dist/composition/setup-adapters.d.ts +39 -0
- package/dist/composition/setup-adapters.js +548 -0
- package/dist/composition/setup-adapters.js.map +1 -0
- package/dist/composition/setup-config-store.d.ts +67 -0
- package/dist/composition/setup-config-store.js +251 -0
- package/dist/composition/setup-config-store.js.map +1 -0
- package/dist/composition/setup-host.d.ts +80 -0
- package/dist/composition/setup-host.js +521 -0
- package/dist/composition/setup-host.js.map +1 -0
- package/dist/composition/setup-journal-store.d.ts +19 -0
- package/dist/composition/setup-journal-store.js +161 -0
- package/dist/composition/setup-journal-store.js.map +1 -0
- package/dist/composition/setup-observation.d.ts +129 -0
- package/dist/composition/setup-observation.js +544 -0
- package/dist/composition/setup-observation.js.map +1 -0
- package/dist/console/api.d.ts +16 -0
- package/dist/console/api.js +134 -0
- package/dist/console/api.js.map +1 -0
- package/dist/console/enrollment-forwarder.d.ts +4 -0
- package/dist/console/enrollment-forwarder.js +26 -0
- package/dist/console/enrollment-forwarder.js.map +1 -0
- package/dist/console/operator-session.d.ts +26 -0
- package/dist/console/operator-session.js +64 -0
- package/dist/console/operator-session.js.map +1 -0
- package/dist/console/public-assets.d.ts +19 -0
- package/dist/console/public-assets.js +72 -0
- package/dist/console/public-assets.js.map +1 -0
- package/dist/contract/ir.d.ts +4 -0
- package/dist/contract/ir.js +5 -1
- package/dist/contract/ir.js.map +1 -1
- package/dist/executor/credential-store.d.ts +26 -0
- package/dist/executor/credential-store.js +238 -0
- package/dist/executor/credential-store.js.map +1 -0
- package/dist/executor/enrollment/issuer-reference.d.ts +2 -0
- package/dist/executor/enrollment/issuer-reference.js +23 -0
- package/dist/executor/enrollment/issuer-reference.js.map +1 -0
- package/dist/executor/enrollment/owner.d.ts +43 -0
- package/dist/executor/enrollment/owner.js +244 -0
- package/dist/executor/enrollment/owner.js.map +1 -0
- package/dist/executor/enrollment/server.d.ts +11 -0
- package/dist/executor/enrollment/server.js +46 -0
- package/dist/executor/enrollment/server.js.map +1 -0
- package/dist/executor/errors.d.ts +5 -0
- package/dist/executor/errors.js +10 -0
- package/dist/executor/errors.js.map +1 -0
- package/dist/executor/execution.d.ts +12 -0
- package/dist/executor/execution.js +312 -0
- package/dist/executor/execution.js.map +1 -0
- package/dist/executor/issuer-input.d.ts +22 -0
- package/dist/executor/issuer-input.js +57 -0
- package/dist/executor/issuer-input.js.map +1 -0
- package/dist/executor/server.d.ts +17 -0
- package/dist/executor/server.js +194 -0
- package/dist/executor/server.js.map +1 -0
- package/dist/executor/setup.d.ts +19 -0
- package/dist/executor/setup.js +69 -0
- package/dist/executor/setup.js.map +1 -0
- package/dist/github/adapter-core.d.ts +219 -0
- package/dist/github/adapter-core.js +2180 -0
- package/dist/github/adapter-core.js.map +1 -0
- package/dist/github/adapter.d.ts +4 -200
- package/dist/github/adapter.js +33 -2139
- package/dist/github/adapter.js.map +1 -1
- package/dist/github/app-installation-credential-broker.d.ts +16 -1
- package/dist/github/app-installation-credential-broker.js +69 -1
- package/dist/github/app-installation-credential-broker.js.map +1 -1
- package/dist/github/app-provider-credential-broker.d.ts +9 -0
- package/dist/github/app-user-credential-broker.d.ts +19 -0
- package/dist/github/app-user-credential-broker.js +51 -1
- package/dist/github/app-user-credential-broker.js.map +1 -1
- package/dist/github/change-state-projector.d.ts +9 -0
- package/dist/github/change-state-projector.js +77 -20
- package/dist/github/change-state-projector.js.map +1 -1
- package/dist/github/direct-app-execution.d.ts +59 -12
- package/dist/github/direct-app-execution.js +101 -119
- package/dist/github/direct-app-execution.js.map +1 -1
- package/dist/github/git-data-capability.js +14 -2
- package/dist/github/git-data-capability.js.map +1 -1
- package/dist/github/index.d.ts +1 -0
- package/dist/github/index.js +1 -0
- package/dist/github/index.js.map +1 -1
- package/dist/github/pr-publication-provider.d.ts +13 -0
- package/dist/github/pr-publication-provider.js +123 -0
- package/dist/github/pr-publication-provider.js.map +1 -0
- package/dist/github/repository-evidence-reader.js +2 -2
- package/dist/github/repository-evidence-reader.js.map +1 -1
- package/dist/github/runtime-authority-publication-capability.d.ts +80 -0
- package/dist/github/runtime-authority-publication-capability.js +203 -0
- package/dist/github/runtime-authority-publication-capability.js.map +1 -0
- package/dist/github/standalone-adapter.d.ts +2 -0
- package/dist/github/standalone-adapter.js +3 -0
- package/dist/github/standalone-adapter.js.map +1 -0
- package/dist/governance.d.ts +15 -1
- package/dist/governance.js +59 -0
- package/dist/governance.js.map +1 -1
- package/dist/hosted-worker.js +3 -48
- package/dist/hosted-worker.js.map +1 -1
- package/dist/implementation-change-identity.js +16 -6
- package/dist/implementation-change-identity.js.map +1 -1
- package/dist/implementation-frontier-composition.d.ts +2 -1
- package/dist/implementation-frontier-composition.js +2 -1
- package/dist/implementation-frontier-composition.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/integration-routing.js +44 -6
- package/dist/integration-routing.js.map +1 -1
- package/dist/local-application-state-terminal.d.ts +12 -0
- package/dist/local-application-state-terminal.js +33 -0
- package/dist/local-application-state-terminal.js.map +1 -0
- package/dist/local-application-state.d.ts +77 -0
- package/dist/local-application-state.js +414 -0
- package/dist/local-application-state.js.map +1 -0
- package/dist/local-control/admission-client.d.ts +2 -38
- package/dist/local-control/admission-client.js +2 -237
- package/dist/local-control/admission-client.js.map +1 -1
- package/dist/local-control/admission-server.d.ts +8 -40
- package/dist/local-control/admission-server.js +8 -625
- package/dist/local-control/admission-server.js.map +1 -1
- package/dist/local-control/config.d.ts +35 -5
- package/dist/local-control/config.js +235 -25
- package/dist/local-control/config.js.map +1 -1
- package/dist/local-control/console-server.d.ts +32 -0
- package/dist/local-control/console-server.js +232 -0
- package/dist/local-control/console-server.js.map +1 -0
- package/dist/local-control/executor-client.d.ts +10 -1
- package/dist/local-control/executor-client.js +68 -3
- package/dist/local-control/executor-client.js.map +1 -1
- package/dist/local-control/executor-server.d.ts +3 -25
- package/dist/local-control/executor-server.js +8 -391
- package/dist/local-control/executor-server.js.map +1 -1
- package/dist/local-control/identity.d.ts +14 -0
- package/dist/local-control/identity.js +53 -1
- package/dist/local-control/identity.js.map +1 -1
- package/dist/local-control/runtime-discovery.d.ts +23 -0
- package/dist/local-control/runtime-discovery.js +118 -0
- package/dist/local-control/runtime-discovery.js.map +1 -0
- package/dist/local-control/session-binding.d.ts +4 -0
- package/dist/local-control/session-binding.js +22 -0
- package/dist/local-control/session-binding.js.map +1 -1
- package/dist/local-control/session-launcher.d.ts +2 -38
- package/dist/local-control/session-launcher.js +2 -304
- package/dist/local-control/session-launcher.js.map +1 -1
- package/dist/local-control/status-page.d.ts +15 -0
- package/dist/local-control/status-page.js +61 -0
- package/dist/local-control/status-page.js.map +1 -0
- package/dist/local-control/supervisor.d.ts +51 -0
- package/dist/local-control/supervisor.js +410 -0
- package/dist/local-control/supervisor.js.map +1 -0
- package/dist/local-control/transport-security.d.ts +19 -0
- package/dist/local-control/transport-security.js +78 -0
- package/dist/local-control/transport-security.js.map +1 -0
- package/dist/local-runtime-profile.d.ts +8 -0
- package/dist/local-runtime-profile.js +23 -0
- package/dist/local-runtime-profile.js.map +1 -1
- package/dist/mcp/tools.d.ts +3 -3
- package/dist/pr-policy.d.ts +8 -0
- package/dist/pr-policy.js +13 -2
- package/dist/pr-policy.js.map +1 -1
- package/dist/relay/local-runtime-config-credentials.d.ts +13 -0
- package/dist/relay/local-runtime-config-credentials.js +52 -0
- package/dist/relay/local-runtime-config-credentials.js.map +1 -0
- package/dist/relay/local-runtime-config.d.ts +3 -10
- package/dist/relay/local-runtime-config.js +2 -44
- package/dist/relay/local-runtime-config.js.map +1 -1
- package/dist/repository-branch-policy.d.ts +156 -0
- package/dist/repository-branch-policy.js +277 -0
- package/dist/repository-branch-policy.js.map +1 -0
- package/dist/repository-setup.d.ts +45 -1
- package/dist/repository-setup.js +130 -12
- package/dist/repository-setup.js.map +1 -1
- package/dist/runtime-authority-publication.d.ts +41 -0
- package/dist/runtime-authority-publication.js +228 -0
- package/dist/runtime-authority-publication.js.map +1 -0
- package/dist/runtime-contracts/command.d.ts +9 -0
- package/dist/runtime-contracts/command.js +37 -0
- package/dist/runtime-contracts/command.js.map +1 -0
- package/dist/runtime-contracts/components.d.ts +26 -0
- package/dist/runtime-contracts/components.js +112 -0
- package/dist/runtime-contracts/components.js.map +1 -0
- package/dist/runtime-contracts/enrollment.d.ts +62 -0
- package/dist/runtime-contracts/enrollment.js +95 -0
- package/dist/runtime-contracts/enrollment.js.map +1 -0
- package/dist/runtime-contracts/errors.d.ts +13 -0
- package/dist/runtime-contracts/errors.js +14 -0
- package/dist/runtime-contracts/errors.js.map +1 -0
- package/dist/runtime-contracts/index.d.ts +12 -0
- package/dist/runtime-contracts/index.js +13 -0
- package/dist/runtime-contracts/index.js.map +1 -0
- package/dist/runtime-contracts/ports.d.ts +86 -0
- package/dist/runtime-contracts/ports.js +2 -0
- package/dist/runtime-contracts/ports.js.map +1 -0
- package/dist/runtime-contracts/secret-material.d.ts +19 -0
- package/dist/runtime-contracts/secret-material.js +133 -0
- package/dist/runtime-contracts/secret-material.js.map +1 -0
- package/dist/runtime-contracts/setup-primitives.d.ts +34 -0
- package/dist/runtime-contracts/setup-primitives.js +80 -0
- package/dist/runtime-contracts/setup-primitives.js.map +1 -0
- package/dist/runtime-contracts/setup.d.ts +128 -0
- package/dist/runtime-contracts/setup.js +263 -0
- package/dist/runtime-contracts/setup.js.map +1 -0
- package/dist/setup-console/index.html +23 -0
- package/dist/setup-console/setup-console.js +1640 -0
- package/dist/setup-console/styles.css +218 -0
- package/dist/worker.js +25 -2
- package/dist/worker.js.map +1 -1
- package/package.json +28 -14
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "inari",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.0",
|
|
4
4
|
"description": "Governed GitHub Issue/PR/template workflows via the inari CLI. Prefer inari over raw gh for operations it owns; use inari skill for operational playbooks.",
|
|
5
5
|
"skills": "skills/inari"
|
|
6
6
|
}
|
package/README.md
CHANGED
|
@@ -52,6 +52,14 @@ Setup stores only a repository-scoped, secret-free Runtime profile. It never
|
|
|
52
52
|
commits, pushes, approves, or merges Runtime Authority trust; `ready` is
|
|
53
53
|
reported only after canonical protected-ref readiness succeeds.
|
|
54
54
|
|
|
55
|
+
The local setup state is shared by the CLI and a loopback browser console:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
inari setup status # canonical state and the one next action
|
|
59
|
+
inari setup next # perform exactly that action through its owner
|
|
60
|
+
inari setup console # owned loopback setup host; works before any key or trust
|
|
61
|
+
```
|
|
62
|
+
|
|
55
63
|
## The governed path
|
|
56
64
|
|
|
57
65
|
```text
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { LocalSessionBinding } from "../local-control/session-binding.js";
|
|
2
|
+
import type { LocalExecutorEvidenceRequest } from "../local-control/executor-http.js";
|
|
3
|
+
import { type ExecutionIntent } from "../local-control/execution-intent.js";
|
|
4
|
+
import { type Delegator } from "../agent-authority/delegator.js";
|
|
5
|
+
import { type AuthorizedExecution } from "../authorized-execution.js";
|
|
6
|
+
import { type ObserveLocalBranchInput } from "../cli/runtime/branch-observation.js";
|
|
7
|
+
/** Reads current Executor evidence through the neutral Executor client protocol. */
|
|
8
|
+
export type AdmissionEvidenceReader = (request: LocalExecutorEvidenceRequest) => Promise<unknown>;
|
|
9
|
+
export interface AdmissionAuthorizationOptions {
|
|
10
|
+
readonly runtimeAuthority: Delegator;
|
|
11
|
+
readonly readEvidence: AdmissionEvidenceReader;
|
|
12
|
+
readonly environment?: NodeJS.ProcessEnv;
|
|
13
|
+
readonly now?: () => Date;
|
|
14
|
+
/** Public owner-port observation supplied by the caller, without provider credentials. */
|
|
15
|
+
readonly branchObservation?: ObserveLocalBranchInput;
|
|
16
|
+
}
|
|
17
|
+
export interface AdmittedSession {
|
|
18
|
+
readonly id: string;
|
|
19
|
+
readonly status: string;
|
|
20
|
+
readonly exp: number;
|
|
21
|
+
}
|
|
22
|
+
/** Admits a validated Session binding against current Executor trust evidence. */
|
|
23
|
+
export declare function admitSession(binding: LocalSessionBinding, options: AdmissionAuthorizationOptions): Promise<AdmittedSession>;
|
|
24
|
+
/** Closes a validated Session binding against current Executor trust evidence. */
|
|
25
|
+
export declare function closeSession(binding: LocalSessionBinding, options: AdmissionAuthorizationOptions): Promise<Omit<AdmittedSession, "exp">>;
|
|
26
|
+
/**
|
|
27
|
+
* Produces an `AuthorizedExecution` for a validated ExecutionIntent on an
|
|
28
|
+
* active Session, after every current-evidence, Implementation and capability
|
|
29
|
+
* check. It never dispatches the execution.
|
|
30
|
+
*/
|
|
31
|
+
export declare function authorizeExecutionIntent(intent: ExecutionIntent, sessionId: string, options: AdmissionAuthorizationOptions): Promise<AuthorizedExecution>;
|
|
@@ -0,0 +1,329 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Admission authorization (#1107). Private Admission module: it admits and
|
|
3
|
+
* closes Sessions against current Executor trust evidence and produces an
|
|
4
|
+
* `AuthorizedExecution` only after the existing Session, repository, task,
|
|
5
|
+
* Implementation, capability, expiry and replay checks. It reuses the pure
|
|
6
|
+
* Session, Delegator and capability validators, reaches the Executor only
|
|
7
|
+
* through the evidence reader it is given, and holds no provider credential or
|
|
8
|
+
* private signing key. Every failure throws; the server maps it to a bounded
|
|
9
|
+
* denial.
|
|
10
|
+
*/
|
|
11
|
+
import { closeAdmissionSession, createAdmissionSession, readAdmissionSession } from "../local-control/session-store.js";
|
|
12
|
+
import { executionIntentIssue } from "../local-control/execution-intent.js";
|
|
13
|
+
import { validateDelegator } from "../agent-authority/delegator.js";
|
|
14
|
+
import { delegatorPublicKeyFingerprint } from "../agent-authority/delegator-key.js";
|
|
15
|
+
import { admitAuthenticatedSessionCapability, } from "../agent-authority/capability-admission.js";
|
|
16
|
+
import { authorizeBranchAdvance } from "../agent-authority/branch-advance.js";
|
|
17
|
+
import { createCapabilityExecutionProvenance, } from "../agent-authority/capability-provenance.js";
|
|
18
|
+
import { canonicalJsonString } from "../agent-authority/codec.js";
|
|
19
|
+
import { createAuthorizedExecution } from "../authorized-execution.js";
|
|
20
|
+
import { changeReadRequest } from "../change-execution-port.js";
|
|
21
|
+
import { validateChangeProjectionResult } from "../change.js";
|
|
22
|
+
import { tryAuthorizeImplementation } from "../implementation-authorization.js";
|
|
23
|
+
import { projectImplementationSessionAuthorizationBinding } from "../implementation-session-binding.js";
|
|
24
|
+
import { tryProjectImplementationScope } from "../implementation-scope-projection.js";
|
|
25
|
+
import { assertTrustedExecution, validateIssuerRepositoryIdentity, } from "../github/effect-authorizer.js";
|
|
26
|
+
import { observeLocalBranch } from "../cli/runtime/branch-observation.js";
|
|
27
|
+
function requireCurrentBranchObservation(binding, options) {
|
|
28
|
+
if (binding.branchObservation === undefined)
|
|
29
|
+
return;
|
|
30
|
+
if (options.branchObservation === undefined)
|
|
31
|
+
throw new Error("Current repository branch observation is missing.");
|
|
32
|
+
let current;
|
|
33
|
+
try {
|
|
34
|
+
current = observeLocalBranch(options.branchObservation);
|
|
35
|
+
}
|
|
36
|
+
catch {
|
|
37
|
+
throw new Error("Current repository branch observation is invalid or stale.");
|
|
38
|
+
}
|
|
39
|
+
if (canonicalJsonString(current) !==
|
|
40
|
+
canonicalJsonString(binding.branchObservation))
|
|
41
|
+
throw new Error("Current repository branch observation contradicts Session binding.");
|
|
42
|
+
}
|
|
43
|
+
function isRecord(value) {
|
|
44
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
45
|
+
}
|
|
46
|
+
function exactKeys(value, allowed) {
|
|
47
|
+
return Object.keys(value).every((key) => allowed.includes(key));
|
|
48
|
+
}
|
|
49
|
+
function pinnedRuntimeAuthority(value) {
|
|
50
|
+
const result = validateDelegator(value);
|
|
51
|
+
if (!result.valid || result.value === undefined)
|
|
52
|
+
throw new Error("Public Runtime Authority trust is invalid.");
|
|
53
|
+
return result.value;
|
|
54
|
+
}
|
|
55
|
+
function sameRepository(left, right) {
|
|
56
|
+
if (!isRecord(left))
|
|
57
|
+
return false;
|
|
58
|
+
return (left.repositoryHost === "github.com" &&
|
|
59
|
+
left.repositoryId === right.id &&
|
|
60
|
+
(left.nameWithOwner === undefined ||
|
|
61
|
+
(typeof left.nameWithOwner === "string" && left.nameWithOwner.toLowerCase() === right.name.toLowerCase())));
|
|
62
|
+
}
|
|
63
|
+
function evidenceRepository(repository) {
|
|
64
|
+
return { id: repository.id, name: repository.name };
|
|
65
|
+
}
|
|
66
|
+
function intentRepositoryMatchesBinding(intent, binding) {
|
|
67
|
+
return (intent.repositoryHost === "github.com" &&
|
|
68
|
+
intent.repositoryId === binding.id &&
|
|
69
|
+
(intent.repositoryNameWithOwner === undefined ||
|
|
70
|
+
intent.repositoryNameWithOwner.toLocaleLowerCase("en-US") === binding.name.toLocaleLowerCase("en-US")));
|
|
71
|
+
}
|
|
72
|
+
function makeContext(binding, repository, authority, intent, operation, nowSeconds) {
|
|
73
|
+
const request = Object.freeze({
|
|
74
|
+
requestId: intent.requestId,
|
|
75
|
+
operation,
|
|
76
|
+
issuedAt: nowSeconds,
|
|
77
|
+
expiresAt: nowSeconds + 60,
|
|
78
|
+
});
|
|
79
|
+
return Object.freeze({
|
|
80
|
+
repository,
|
|
81
|
+
runtimeAuthority: Object.freeze({ id: binding.authority.id, kid: binding.authority.id }),
|
|
82
|
+
session: Object.freeze({ id: binding.sessionId, certificateJti: binding.signature }),
|
|
83
|
+
task: binding.task,
|
|
84
|
+
capabilities: binding.capabilities,
|
|
85
|
+
authority,
|
|
86
|
+
request,
|
|
87
|
+
semanticRequest: intent.request,
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
function capabilityOperation(intent) {
|
|
91
|
+
return intent.operation === "pullRequest.publish" ? "pullRequest.create" : intent.operation;
|
|
92
|
+
}
|
|
93
|
+
function intentSubject(intent) {
|
|
94
|
+
const issue = executionIntentIssue(intent);
|
|
95
|
+
if (issue === undefined)
|
|
96
|
+
throw new Error("ExecutionIntent has no task Issue.");
|
|
97
|
+
if (intent.operation === "branch.advance") {
|
|
98
|
+
const request = intent.request;
|
|
99
|
+
return { kind: "branch", issue, branch: request.branch };
|
|
100
|
+
}
|
|
101
|
+
if (intent.operation === "pullRequest.publish") {
|
|
102
|
+
const request = intent.request;
|
|
103
|
+
if (typeof request.expectedHead !== "string" || typeof request.expectedBase !== "string")
|
|
104
|
+
throw new Error("Pull request publication route is unavailable.");
|
|
105
|
+
return { kind: "pullRequest", issue, head: request.expectedHead, base: request.expectedBase };
|
|
106
|
+
}
|
|
107
|
+
return { kind: "change", issue };
|
|
108
|
+
}
|
|
109
|
+
function readTreeDelta(intent) {
|
|
110
|
+
if (intent.operation !== "branch.advance")
|
|
111
|
+
return undefined;
|
|
112
|
+
const request = intent.request;
|
|
113
|
+
return {
|
|
114
|
+
changes: request.changes.map((change) => ({ operation: "modify", path: change.path })),
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
function validateEvidence(value, binding, pinnedAuthority) {
|
|
118
|
+
if (!isRecord(value) ||
|
|
119
|
+
!exactKeys(value, ["repository", "authority", "runtimeAuthority", "change", "implementation", "reviewEvidence"]))
|
|
120
|
+
throw new Error("Executor evidence response is malformed.");
|
|
121
|
+
const repositoryResult = validateIssuerRepositoryIdentity(value.repository);
|
|
122
|
+
if (!repositoryResult.valid ||
|
|
123
|
+
repositoryResult.value === undefined ||
|
|
124
|
+
!sameRepository(repositoryResult.value, binding.repository))
|
|
125
|
+
throw new Error("Executor repository evidence does not match Session.");
|
|
126
|
+
const authority = value.authority;
|
|
127
|
+
if (!isRecord(authority) ||
|
|
128
|
+
!exactKeys(authority, ["ref", "sha"]) ||
|
|
129
|
+
typeof authority.ref !== "string" ||
|
|
130
|
+
!/^refs\/heads\/[A-Za-z0-9._/-]+$/u.test(authority.ref) ||
|
|
131
|
+
typeof authority.sha !== "string" ||
|
|
132
|
+
!/^[a-f0-9]{40}$/u.test(authority.sha))
|
|
133
|
+
throw new Error("Executor Authority evidence is malformed.");
|
|
134
|
+
const runtime = pinnedRuntimeAuthority(value.runtimeAuthority);
|
|
135
|
+
if (runtime.id !== binding.authority.id ||
|
|
136
|
+
delegatorPublicKeyFingerprint(runtime.key) !== binding.authority.publicKeyFingerprint ||
|
|
137
|
+
canonicalJsonString(runtime) !==
|
|
138
|
+
canonicalJsonString(pinnedAuthority))
|
|
139
|
+
throw new Error("Current Runtime Authority trust does not match Admission configuration.");
|
|
140
|
+
const projection = validateChangeProjectionResult(value.change);
|
|
141
|
+
if (!projection.valid || projection.projection === undefined)
|
|
142
|
+
throw new Error("Current Change evidence is malformed.");
|
|
143
|
+
if (!isRecord(value.implementation) ||
|
|
144
|
+
!exactKeys(value.implementation, [
|
|
145
|
+
"implementation",
|
|
146
|
+
"issue",
|
|
147
|
+
"repository",
|
|
148
|
+
"base",
|
|
149
|
+
"readiness",
|
|
150
|
+
"change",
|
|
151
|
+
"pullRequest",
|
|
152
|
+
]))
|
|
153
|
+
throw new Error("Current Implementation evidence is malformed.");
|
|
154
|
+
return {
|
|
155
|
+
repository: repositoryResult.value,
|
|
156
|
+
authority: { ref: authority.ref, sha: authority.sha },
|
|
157
|
+
change: projection.projection,
|
|
158
|
+
implementation: value.implementation,
|
|
159
|
+
...(value.reviewEvidence === undefined ? {} : { reviewEvidence: value.reviewEvidence }),
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
function validateTrustEvidence(value, binding, pinnedAuthority) {
|
|
163
|
+
if (!isRecord(value) || !exactKeys(value, ["repository", "authority", "runtimeAuthority"]))
|
|
164
|
+
throw new Error("Executor Runtime Authority evidence is malformed.");
|
|
165
|
+
if (!sameRepository(value.repository, binding.repository))
|
|
166
|
+
throw new Error("Executor repository evidence does not match Session.");
|
|
167
|
+
const authority = value.authority;
|
|
168
|
+
if (!isRecord(authority) ||
|
|
169
|
+
!exactKeys(authority, ["ref", "sha"]) ||
|
|
170
|
+
typeof authority.ref !== "string" ||
|
|
171
|
+
!/^refs\/heads\/[A-Za-z0-9._/-]+$/u.test(authority.ref) ||
|
|
172
|
+
typeof authority.sha !== "string" ||
|
|
173
|
+
!/^[a-f0-9]{40}$/u.test(authority.sha))
|
|
174
|
+
throw new Error("Executor Authority evidence is malformed.");
|
|
175
|
+
const current = pinnedRuntimeAuthority(value.runtimeAuthority);
|
|
176
|
+
if (current.id !== binding.authority.id ||
|
|
177
|
+
delegatorPublicKeyFingerprint(current.key) !== binding.authority.publicKeyFingerprint ||
|
|
178
|
+
canonicalJsonString(current) !==
|
|
179
|
+
canonicalJsonString(pinnedAuthority))
|
|
180
|
+
throw new Error("Current Runtime Authority trust does not match Admission configuration.");
|
|
181
|
+
return current;
|
|
182
|
+
}
|
|
183
|
+
function currentImplementationAuthorization(evidence, binding) {
|
|
184
|
+
const implementationEvidence = evidence.implementation;
|
|
185
|
+
const authorizationInput = {
|
|
186
|
+
implementation: implementationEvidence.implementation,
|
|
187
|
+
issue: implementationEvidence.issue,
|
|
188
|
+
repository: implementationEvidence.repository,
|
|
189
|
+
base: implementationEvidence.base,
|
|
190
|
+
readiness: implementationEvidence.readiness,
|
|
191
|
+
};
|
|
192
|
+
const authorization = tryAuthorizeImplementation(authorizationInput);
|
|
193
|
+
if (!authorization.valid || authorization.status !== "authorized" || authorization.authorization === undefined)
|
|
194
|
+
throw new Error("Current Implementation is not authorized.");
|
|
195
|
+
const currentInput = { ...authorizationInput, authorization: authorization.authorization };
|
|
196
|
+
const bindingProjection = projectImplementationSessionAuthorizationBinding({
|
|
197
|
+
...currentInput,
|
|
198
|
+
task: binding.task,
|
|
199
|
+
});
|
|
200
|
+
const scope = tryProjectImplementationScope(currentInput);
|
|
201
|
+
if (!scope.valid || scope.projection === undefined)
|
|
202
|
+
throw new Error("Current Implementation scope is unavailable.");
|
|
203
|
+
return { binding: bindingProjection, scope: scope.projection };
|
|
204
|
+
}
|
|
205
|
+
async function currentTrust(binding, options) {
|
|
206
|
+
const evidence = await options.readEvidence({
|
|
207
|
+
version: 1,
|
|
208
|
+
repository: evidenceRepository(binding.repository),
|
|
209
|
+
authorityId: binding.authority.id,
|
|
210
|
+
});
|
|
211
|
+
return validateTrustEvidence(evidence, binding, options.runtimeAuthority);
|
|
212
|
+
}
|
|
213
|
+
/** Admits a validated Session binding against current Executor trust evidence. */
|
|
214
|
+
export async function admitSession(binding, options) {
|
|
215
|
+
requireCurrentBranchObservation(binding, options);
|
|
216
|
+
const current = await currentTrust(binding, options);
|
|
217
|
+
const snapshot = createAdmissionSession(binding, current, {
|
|
218
|
+
environment: options.environment,
|
|
219
|
+
now: options.now?.(),
|
|
220
|
+
});
|
|
221
|
+
return { id: snapshot.record.binding.sessionId, status: snapshot.status, exp: snapshot.record.binding.exp };
|
|
222
|
+
}
|
|
223
|
+
/** Closes a validated Session binding against current Executor trust evidence. */
|
|
224
|
+
export async function closeSession(binding, options) {
|
|
225
|
+
const current = await currentTrust(binding, options);
|
|
226
|
+
const snapshot = closeAdmissionSession(binding, current, {
|
|
227
|
+
environment: options.environment,
|
|
228
|
+
now: options.now?.(),
|
|
229
|
+
});
|
|
230
|
+
return { id: snapshot.record.binding.sessionId, status: snapshot.status };
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* Produces an `AuthorizedExecution` for a validated ExecutionIntent on an
|
|
234
|
+
* active Session, after every current-evidence, Implementation and capability
|
|
235
|
+
* check. It never dispatches the execution.
|
|
236
|
+
*/
|
|
237
|
+
export async function authorizeExecutionIntent(intent, sessionId, options) {
|
|
238
|
+
const stored = readAdmissionSession(sessionId, options.runtimeAuthority, {
|
|
239
|
+
environment: options.environment,
|
|
240
|
+
now: options.now?.(),
|
|
241
|
+
});
|
|
242
|
+
if (stored === undefined || stored.status !== "active")
|
|
243
|
+
throw new Error("Session is unavailable.");
|
|
244
|
+
const binding = stored.record.binding;
|
|
245
|
+
requireCurrentBranchObservation(binding, options);
|
|
246
|
+
if (binding.branchObservation !== undefined &&
|
|
247
|
+
intent.operation === "branch.advance" &&
|
|
248
|
+
intent.request.branch !== binding.branchObservation.expectedBranch)
|
|
249
|
+
throw new Error("Branch advance does not match the Session policy branch.");
|
|
250
|
+
if (!intentRepositoryMatchesBinding(intent.repository, binding.repository))
|
|
251
|
+
throw new Error("Execution repository does not match Session.");
|
|
252
|
+
const issue = executionIntentIssue(intent);
|
|
253
|
+
if (issue === undefined || binding.task.kind !== "issue" || binding.task.number !== issue)
|
|
254
|
+
throw new Error("Execution task does not match Session.");
|
|
255
|
+
const evidenceValue = await options.readEvidence({
|
|
256
|
+
version: 1,
|
|
257
|
+
repository: evidenceRepository(binding.repository),
|
|
258
|
+
authorityId: binding.authority.id,
|
|
259
|
+
issue,
|
|
260
|
+
implementationIssue: binding.task.number,
|
|
261
|
+
});
|
|
262
|
+
const evidence = validateEvidence(evidenceValue, binding, options.runtimeAuthority);
|
|
263
|
+
const current = currentImplementationAuthorization(evidence, binding);
|
|
264
|
+
const operation = capabilityOperation(intent);
|
|
265
|
+
const nowSeconds = Math.floor((options.now?.() ?? new Date()).getTime() / 1000);
|
|
266
|
+
const context = {
|
|
267
|
+
...makeContext(binding, evidence.repository, evidence.authority, intent, operation, nowSeconds),
|
|
268
|
+
implementationBinding: current.binding,
|
|
269
|
+
implementationScope: current.scope,
|
|
270
|
+
};
|
|
271
|
+
const admission = admitAuthenticatedSessionCapability({
|
|
272
|
+
context,
|
|
273
|
+
operation,
|
|
274
|
+
subject: intentSubject(intent),
|
|
275
|
+
projection: evidence.change,
|
|
276
|
+
...(readTreeDelta(intent) === undefined ? {} : { treeDelta: readTreeDelta(intent) }),
|
|
277
|
+
...(evidence.reviewEvidence === undefined ? {} : { reviewEvidence: evidence.reviewEvidence }),
|
|
278
|
+
});
|
|
279
|
+
let branchAuthorization;
|
|
280
|
+
if (intent.operation === "branch.advance") {
|
|
281
|
+
const authorized = authorizeBranchAdvance({ context, admission, request: intent.request });
|
|
282
|
+
if (!authorized.valid)
|
|
283
|
+
throw new Error("Branch advance is outside the current authorized scope.");
|
|
284
|
+
branchAuthorization = authorized.authorization;
|
|
285
|
+
}
|
|
286
|
+
const provenanceRequest = {
|
|
287
|
+
...context.request,
|
|
288
|
+
operation: intent.operation,
|
|
289
|
+
};
|
|
290
|
+
const provenance = createCapabilityExecutionProvenance({
|
|
291
|
+
version: 1,
|
|
292
|
+
stage: "authorized",
|
|
293
|
+
repository: evidence.repository,
|
|
294
|
+
runtimeAuthority: context.runtimeAuthority,
|
|
295
|
+
session: context.session,
|
|
296
|
+
authority: context.authority,
|
|
297
|
+
request: provenanceRequest,
|
|
298
|
+
subject: admission.subject,
|
|
299
|
+
capability: admission.capability,
|
|
300
|
+
});
|
|
301
|
+
const localAdmissionExecution = assertTrustedExecution({
|
|
302
|
+
version: 1,
|
|
303
|
+
runtime: "inari-local-admission",
|
|
304
|
+
event: "authorized-session-execution",
|
|
305
|
+
repository: evidence.repository,
|
|
306
|
+
requestId: intent.requestId,
|
|
307
|
+
sessionId: binding.sessionId,
|
|
308
|
+
sessionBindingSignature: binding.signature,
|
|
309
|
+
requester: `session:${binding.sessionId}`,
|
|
310
|
+
});
|
|
311
|
+
const executionInput = {
|
|
312
|
+
version: 1,
|
|
313
|
+
operation: intent.operation,
|
|
314
|
+
repository: evidence.repository,
|
|
315
|
+
task: binding.task,
|
|
316
|
+
subject: admission.subject,
|
|
317
|
+
capability: admission.capability,
|
|
318
|
+
provenance,
|
|
319
|
+
request: intent.operation === "change.show" ? changeReadRequest(issue) : intent.request,
|
|
320
|
+
};
|
|
321
|
+
if (intent.operation === "change.show")
|
|
322
|
+
executionInput.initialProjection = evidence.change;
|
|
323
|
+
else if (intent.operation === "branch.advance")
|
|
324
|
+
executionInput.branchAuthorization = branchAuthorization;
|
|
325
|
+
else
|
|
326
|
+
executionInput.execution = localAdmissionExecution;
|
|
327
|
+
return createAuthorizedExecution(executionInput);
|
|
328
|
+
}
|
|
329
|
+
//# sourceMappingURL=authorization.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authorization.js","sourceRoot":"","sources":["../../src/admission/authorization.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AAGxH,OAAO,EAAE,oBAAoB,EAAwB,MAAM,sCAAsC,CAAC;AAClG,OAAO,EAAE,iBAAiB,EAAkB,MAAM,iCAAiC,CAAC;AACpF,OAAO,EAAE,6BAA6B,EAAE,MAAM,qCAAqC,CAAC;AACpF,O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AAc,CAAC,CAAC;AACnD,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Admission server (#1107). Public Admission role entry for serving: the
|
|
3
|
+
* bounded local Admission HTTP wire, mTLS enforcement and process startup.
|
|
4
|
+
* Session admission and execution authorization are delegated to the private
|
|
5
|
+
* authorization module; the Executor is reached only through the neutral
|
|
6
|
+
* `LocalExecutorClient` protocol client. The server holds no provider
|
|
7
|
+
* credential and no private signing key.
|
|
8
|
+
*/
|
|
9
|
+
import { type Server } from "node:http";
|
|
10
|
+
import type { Delegator } from "../agent-authority/delegator.js";
|
|
11
|
+
import type { AuthorizedExecution } from "../authorized-execution.js";
|
|
12
|
+
import { type RepositoryIdentity } from "../github/effect-authorizer.js";
|
|
13
|
+
import type { LocalAdmissionConfig } from "../local-control/config.js";
|
|
14
|
+
import type { LocalExecutorEvidenceRequest } from "../local-control/executor-http.js";
|
|
15
|
+
import { type LocalRuntimeEndpoint } from "../local-control/runtime-discovery.js";
|
|
16
|
+
import { type LocalMtlsIdentity } from "../local-control/transport-security.js";
|
|
17
|
+
export declare const LOCAL_ADMISSION_STATUS_PATH: "/status";
|
|
18
|
+
export declare const LOCAL_ADMISSION_PROTOCOL_VERSION: 1;
|
|
19
|
+
export declare const LOCAL_ADMISSION_HEALTH_PATH: "/health";
|
|
20
|
+
export declare const LOCAL_ADMISSION_SESSIONS_PATH: "/v1/sessions";
|
|
21
|
+
export declare const LOCAL_ADMISSION_REPOSITORY_PATH: "/v1/repository";
|
|
22
|
+
export declare const LOCAL_ADMISSION_EXECUTIONS_PATH: "/v1/executions";
|
|
23
|
+
export declare const LOCAL_ADMISSION_SESSION_ID_HEADER: "x-inari-session-id";
|
|
24
|
+
export declare const MAX_LOCAL_ADMISSION_BODY_BYTES = 1048576;
|
|
25
|
+
/**
|
|
26
|
+
* Executor surface Admission consumes. `LocalExecutorClient` (the neutral
|
|
27
|
+
* client of the Executor wire protocol) implements it; Admission never loads
|
|
28
|
+
* Executor internals.
|
|
29
|
+
*/
|
|
30
|
+
export interface AdmissionExecutorClient {
|
|
31
|
+
verifyReady(): Promise<unknown>;
|
|
32
|
+
resolveRepository?(repositoryNameWithOwner: string): Promise<RepositoryIdentity>;
|
|
33
|
+
readEvidence(request: LocalExecutorEvidenceRequest): Promise<unknown>;
|
|
34
|
+
execute(execution: AuthorizedExecution): Promise<unknown>;
|
|
35
|
+
}
|
|
36
|
+
export declare function createLocalAdmissionHttpServer(config: LocalAdmissionConfig, version: string, runtimeAuthority: Delegator, executor: AdmissionExecutorClient, options?: {
|
|
37
|
+
readonly environment?: NodeJS.ProcessEnv;
|
|
38
|
+
readonly now?: () => Date;
|
|
39
|
+
readonly transport?: LocalMtlsIdentity;
|
|
40
|
+
}): Server;
|
|
41
|
+
export declare function startConfiguredLocalAdmission(version: string, environment?: NodeJS.ProcessEnv): Promise<{
|
|
42
|
+
readonly server: Server;
|
|
43
|
+
readonly config: LocalAdmissionConfig;
|
|
44
|
+
readonly announcement: LocalRuntimeEndpoint;
|
|
45
|
+
}>;
|