Written by seatgen at c62650e4 (GEN3) with mesh-sdk b19fc7fa (reader release): the seat mesh-grants new, every TypeScript contract as index.js with index.d.ts, events with subject and stream. mesh-watchdogs gains its family, which a definition with events needs. Written with the reader as it is: the field needs-approval (node-login-shell) and the section bodies (mesh-conditions) are unknown to it, so they were laid aside for the run; nothing generated carries either. Builds: design 47 G §339, §341, §261, §389 Claude-Session: https://claude.ai/code/session_01JG73KEq4zoDfM9WtYpcQgZ
183 lines
5.9 KiB
TypeScript
183 lines
5.9 KiB
TypeScript
// Code generated by seatgen from the seat definitions; DO NOT EDIT.
|
|
|
|
// The contract of the seat "mesh-node-enroller", defined whole (seats/mesh-node-enroller/seat.json): The seat that enrols a new machine on the operator's Approve and a one-time token (ADR 0587). Renamed from mesh-enrolment (ADR 0634 §9).
|
|
|
|
export declare const seat: "mesh-node-enroller";
|
|
|
|
export declare const verbs: {
|
|
readonly issue: "issue";
|
|
readonly redeem: "redeem";
|
|
readonly confirm: "confirm";
|
|
readonly revoke: "revoke";
|
|
readonly tokens: "tokens";
|
|
readonly again: "again";
|
|
};
|
|
|
|
export declare const events: {
|
|
readonly enrolmentIssued: "enrolment-issued";
|
|
readonly nodeEnrolled: "node-enrolled";
|
|
readonly enrolmentRefused: "enrolment-refused";
|
|
readonly enrolmentRevoked: "enrolment-revoked";
|
|
readonly enrolmentExpired: "enrolment-expired";
|
|
};
|
|
|
|
export declare const family: { readonly name: "mesh-node-enroller.events"; readonly maxAgeDays: 7 };
|
|
|
|
export declare const enrolmentIssuedSubject: "mesh.seat.mesh-node-enroller.event.enrolment-issued";
|
|
|
|
export declare const nodeEnrolledSubject: "mesh.seat.mesh-node-enroller.event.node-enrolled";
|
|
|
|
export declare const enrolmentRefusedSubject: "mesh.seat.mesh-node-enroller.event.enrolment-refused";
|
|
|
|
export declare const enrolmentRevokedSubject: "mesh.seat.mesh-node-enroller.event.enrolment-revoked";
|
|
|
|
export declare const enrolmentExpiredSubject: "mesh.seat.mesh-node-enroller.event.enrolment-expired";
|
|
|
|
export declare const states: {
|
|
readonly enrolments: "enrolments";
|
|
};
|
|
|
|
/** The key of one value of the state enrolments under the form "node.<node>". */
|
|
export declare function enrolmentsByNodeNodeKey(node: string): string;
|
|
|
|
/** The parts of a key of the form "node.<node>", or undefined for a key of another form. */
|
|
export declare function parseEnrolmentsByNodeNodeKey(_key: string): { node: string } | undefined;
|
|
|
|
/** The key of one value of the state enrolments under the form "address.<address>". */
|
|
export declare function enrolmentsByAddressAddressKey(address: string): string;
|
|
|
|
/** The parts of a key of the form "address.<address>", or undefined for a key of another form. */
|
|
export declare function parseEnrolmentsByAddressAddressKey(_key: string): { address: string } | undefined;
|
|
|
|
/** one open enrolment */
|
|
export interface Enrolment {
|
|
"address": string;
|
|
"ask"?: string;
|
|
"caller"?: string;
|
|
"expires"?: string;
|
|
"issued"?: string;
|
|
"keys-digest"?: string;
|
|
"node": string;
|
|
"overlay-key"?: string;
|
|
/** asked, live or redeeming */
|
|
"stage": string;
|
|
"v"?: number;
|
|
"why"?: string;
|
|
}
|
|
|
|
/** is what issue takes. */
|
|
export interface IssueInput {
|
|
/** how long the token lasts, a duration such as 1h or 24h: one hour when not given, at most 24 hours */
|
|
"expires"?: string;
|
|
/** the new machine's name in the mesh */
|
|
"node": string;
|
|
/** the new machine's private network (tunnel) public key, as `nox-mesh-host key` prints it */
|
|
"overlay_key": string;
|
|
/** why it joins, shown to the operator with the ask */
|
|
"why": string;
|
|
}
|
|
|
|
/** is what issue answers. */
|
|
export type IssueAnswer = Record<string, unknown>;
|
|
|
|
/** is what redeem takes. */
|
|
export interface RedeemInput {
|
|
/** the node the token was issued for */
|
|
"node": string;
|
|
/** the private network key's public half */
|
|
"overlay_key"?: string;
|
|
/** what the machine is, as its record says it */
|
|
"profile"?: Record<string, unknown>;
|
|
/** the identity key's signature over the redeem's proof bytes (delivery.RedeemProof), base64 */
|
|
"proof": string;
|
|
/** the identity key's public half, base64 */
|
|
"public_key": string;
|
|
/** the sealing key's public half, which the account is sealed to */
|
|
"sealing_key": string;
|
|
/** the serving key's public half, which the certificate binds */
|
|
"serving_key"?: string;
|
|
/** a tunnel found on the machine: everything but its private key */
|
|
"tunnel"?: Record<string, unknown>;
|
|
}
|
|
|
|
/** is what redeem answers. */
|
|
export interface RedeemAnswer {
|
|
/** its account sealed to the sealing key it presented, base64 */
|
|
"account": string;
|
|
/** its certificate, PEM */
|
|
"certificate": string;
|
|
/** the login it dials as next */
|
|
"login": string;
|
|
/** the node */
|
|
"node": string;
|
|
/** the vault's signature over the answer without it, under the context of the enrolment kind, base64 */
|
|
"signature"?: string;
|
|
/** the vault's public signing half, base64 */
|
|
"signer": string;
|
|
}
|
|
|
|
/** is what confirm takes. */
|
|
export interface ConfirmInput {
|
|
}
|
|
|
|
/** is what confirm answers. */
|
|
export type ConfirmAnswer = Record<string, unknown>;
|
|
|
|
/** is what revoke takes. */
|
|
export interface RevokeInput {
|
|
/** the node */
|
|
"node": string;
|
|
/** why, recorded with the hand act */
|
|
"why": string;
|
|
}
|
|
|
|
/** is what revoke answers. */
|
|
export type RevokeAnswer = Record<string, unknown>;
|
|
|
|
/** is what tokens takes. */
|
|
export interface TokensInput {
|
|
/** "true": the ended enrolments too */
|
|
"history"?: "true" | "false";
|
|
/** one node */
|
|
"node"?: string;
|
|
}
|
|
|
|
/** is what tokens answers. */
|
|
export type TokensAnswer = Record<string, unknown>;
|
|
|
|
/** is what again takes. */
|
|
export interface AgainInput {
|
|
/** the node whose ask is raised again */
|
|
"node": string;
|
|
}
|
|
|
|
/** is what again answers. */
|
|
export type AgainAnswer = Record<string, unknown>;
|
|
|
|
/** is the body of the event enrolment-issued. */
|
|
export type EnrolmentIssuedEvent = Enrolment;
|
|
|
|
/** is the body of the event node-enrolled. */
|
|
export type NodeEnrolledEvent = Enrolment;
|
|
|
|
/** is the body of the event enrolment-refused. */
|
|
export type EnrolmentRefusedEvent = Enrolment;
|
|
|
|
/** is the body of the event enrolment-revoked. */
|
|
export type EnrolmentRevokedEvent = Enrolment;
|
|
|
|
/** is the body of the event enrolment-expired. */
|
|
export type EnrolmentExpiredEvent = Enrolment;
|
|
|
|
/** is one value of the state enrolments under the key node.<node>. */
|
|
export type EnrolmentsByNodeNodeValue = Enrolment;
|
|
|
|
/** is one value of the state enrolments under the key address.<address>. */
|
|
export interface EnrolmentsByAddressAddressValue {
|
|
"ask"?: string;
|
|
"issued"?: string;
|
|
"node": string;
|
|
"v"?: number;
|
|
}
|
|
|