@cotal-ai/core 0.171.1 → 0.171.3

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.
@@ -0,0 +1,306 @@
1
+ import type { NatsConnection } from "@nats-io/transport-node";
2
+ import { type TransportState } from "./endpoint-options.js";
3
+ import type { AgentCard } from "./types.js";
4
+ /** What the credentials component reads from its endpoint. State is read when it is used, never
5
+ * copied, a field it reassigns is written back through its setter, and every method is looked up on
6
+ * the endpoint at call time. */
7
+ export interface EndpointCredentialsDeps {
8
+ nc: () => NatsConnection | undefined;
9
+ bearerSource: () => (() => Promise<string>) | undefined;
10
+ owner: () => string;
11
+ actor: () => string;
12
+ space: () => string;
13
+ currentBearer: () => string | undefined;
14
+ setCurrentBearer: (value: string | undefined) => void;
15
+ bearerAdoptedAtMs: () => number;
16
+ setBearerAdoptedAtMs: (value: number) => void;
17
+ bearerRenewalFailures: () => number;
18
+ setBearerRenewalFailures: (value: number) => void;
19
+ cancelBearerRenewal: () => (() => void) | undefined;
20
+ setCancelBearerRenewal: (value: (() => void) | undefined) => void;
21
+ stopped: () => boolean;
22
+ presentedExp: () => number | undefined;
23
+ setPresentedExp: (value: number | undefined) => void;
24
+ currentCreds: () => string | undefined;
25
+ setCurrentCreds: (value: string | undefined) => void;
26
+ credsSource: () => (() => Promise<string>) | undefined;
27
+ connId: () => string;
28
+ overlapOnConnectionRenewal: () => boolean;
29
+ onConnection: () => ((nc: NatsConnection) => void) | undefined;
30
+ servers: () => string;
31
+ card: () => AgentCard;
32
+ token: () => string | undefined;
33
+ user: () => string | undefined;
34
+ pass: () => string | undefined;
35
+ userMode: () => boolean;
36
+ sentinelCreds: () => string | undefined;
37
+ tls: () => boolean;
38
+ ownedConnections: () => Set<NatsConnection>;
39
+ authExpiryReconnectTimer: () => NodeJS.Timeout | undefined;
40
+ setAuthExpiryReconnectTimer: (value: NodeJS.Timeout | undefined) => void;
41
+ credsTxnsRunning: () => number;
42
+ setCredsTxnsRunning: (value: number) => void;
43
+ credsTxn: () => Promise<unknown>;
44
+ setCredsTxn: (value: Promise<unknown>) => void;
45
+ reconnecting: () => boolean;
46
+ reestablishing: () => boolean;
47
+ requestsAwaitingReply: () => Map<NatsConnection, Set<(error: Error) => void>>;
48
+ residentSwap: () => Promise<void> | undefined;
49
+ setResidentSwap: (value: Promise<void> | undefined) => void;
50
+ emitRecoverable: (err: Error) => void;
51
+ kickBackoff: () => void;
52
+ armCredsRefresh: (delayMs: number) => void;
53
+ reconnect: () => Promise<void>;
54
+ emit: (event: string, ...args: unknown[]) => boolean;
55
+ on: (event: "transport", listener: (state: TransportState) => void) => void;
56
+ off: (event: "transport", listener: (state: TransportState) => void) => void;
57
+ }
58
+ /** One endpoint's bearer and credential renewal: the checked getters every connect attempt presents,
59
+ * the timed and explicit prove-then-adopt transactions, and the controlled reconnect onto adopted
60
+ * material. Internal: `CotalEndpoint` keeps the fields and the public methods and forwards to it. */
61
+ export declare class EndpointCredentials {
62
+ private readonly deps;
63
+ constructor(deps: EndpointCredentialsDeps);
64
+ private get nc();
65
+ private get bearerSource();
66
+ private get owner();
67
+ private get actor();
68
+ private get space();
69
+ private get currentBearer();
70
+ private set currentBearer(value);
71
+ private get bearerAdoptedAtMs();
72
+ private set bearerAdoptedAtMs(value);
73
+ private get bearerRenewalFailures();
74
+ private set bearerRenewalFailures(value);
75
+ private get cancelBearerRenewal();
76
+ private set cancelBearerRenewal(value);
77
+ private get stopped();
78
+ private get presentedExp();
79
+ private set presentedExp(value);
80
+ private get currentCreds();
81
+ private set currentCreds(value);
82
+ private get credsSource();
83
+ private get connId();
84
+ private get overlapOnConnectionRenewal();
85
+ private get onConnection();
86
+ private get servers();
87
+ private get card();
88
+ private get token();
89
+ private get user();
90
+ private get pass();
91
+ private get userMode();
92
+ private get sentinelCreds();
93
+ private get tls();
94
+ private get ownedConnections();
95
+ private get authExpiryReconnectTimer();
96
+ private set authExpiryReconnectTimer(value);
97
+ private get credsTxnsRunning();
98
+ private set credsTxnsRunning(value);
99
+ private get credsTxn();
100
+ private set credsTxn(value);
101
+ private get reconnecting();
102
+ private get reestablishing();
103
+ private get requestsAwaitingReply();
104
+ private get residentSwap();
105
+ private set residentSwap(value);
106
+ private emitRecoverable;
107
+ private kickBackoff;
108
+ private armCredsRefresh;
109
+ private reconnect;
110
+ private emit;
111
+ private on;
112
+ private off;
113
+ /** The floor on a bearer renewal's delay. A token whose whole lifetime sits under it is renewed at
114
+ * this cadence (`expiry-renewal` mints 5s bearers). */
115
+ private static readonly BEARER_MIN_RENEWAL_MS;
116
+ /** A failed bearer renewal retries after about this long, doubling per failure up to the cap. */
117
+ private static readonly BEARER_RETRY_MS;
118
+ private static readonly BEARER_RETRY_CAP_MS;
119
+ /** Fetch a fresh bearer from the source, pin its principal to ours, arm the next renewal. On a
120
+ * fetch/principal failure: THROWS when `initial` (start() must fail loud before first connect);
121
+ * otherwise retries on a jittered, capped backoff, and warns once for the whole run of failures —
122
+ * the live connection keeps working until its current JWT expiry, so a dead auth service is
123
+ * loud without instantly dropping the mesh, and without a line per attempt. */
124
+ refreshBearer(initial?: boolean): Promise<void>;
125
+ private armBearerTimer;
126
+ /** The timed renewal. A new token moves the live connection onto itself at once, through the
127
+ * same controlled reconnect the creds path uses, so the broker never has to expire a connection
128
+ * this endpoint could renew. With no live connection, it ends the rebuild loop's wait instead:
129
+ * that loop refuses to dial an expired token and leaves the retries to this timer. */
130
+ private renewBearerOnTimer;
131
+ /** The cached bearer, checked: every (re)connect attempt reads it, the reconnects nats.js runs
132
+ * on its own included, so none presents an expired token, which the callout could only deny
133
+ * after a full round trip. The bearer counterpart of {@link credsForWire}. */
134
+ bearerForWire(): string;
135
+ /** How soon a FAILED creds refresh retries. Successful refreshes schedule by lifetime fraction
136
+ * (75% of iat→exp), not a fixed margin — standing creds span hours to days, bearers minutes. */
137
+ private static readonly CREDS_RETRY_MS;
138
+ /** THE ONE PLACE a credential is cleared for presentation to a broker.
139
+ *
140
+ * The property is unconditional — this endpoint never presents a credential it has already
141
+ * decoded as expired — so it is a property of the SUPPLY, not of any one dial site. It used to
142
+ * live inside {@link bindConnection}, which only `start()` and `doRebuild` reach; the
143
+ * authenticator nats.js re-evaluates on ITS OWN reconnects read the cache directly and so
144
+ * presented whatever was last fetched, expired included. Two such reconnects exist and neither
145
+ * passes through bindConnection: the one the broker forces at JWT `exp`, and an ALREADY RUNNING
146
+ * dial loop from an earlier drop that crosses `exp` while it retries (the pre-expiry
147
+ * reconnect fence flips a policy flag nats-core only reads when it observes a NEW drop, so it
148
+ * cannot stop a loop already in flight).
149
+ *
150
+ * Putting the refusal here instead means a future caller cannot miss it: the only way to reach a
151
+ * dial is through {@link credsForWire}, and the one presentation that does not read the cache
152
+ * (the adoption preflight, which presents a fresh CANDIDATE) calls this same function on it.
153
+ *
154
+ * An unbounded credential (no numeric `exp`) is presentable: bounded lifetimes are the renewal
155
+ * seam's concern, and a cred with no expiry has none to be past. */
156
+ private static presentableCreds;
157
+ /** The connect attempt's credential getters: what {@link credsForWire} and {@link bearerForWire}
158
+ * return, with its expiry recorded as {@link presentedExp}. */
159
+ presentCreds(): string;
160
+ presentBearer(): string;
161
+ /** The cached credential, checked. Handed to nats.js as the authenticator's source on EVERY auth
162
+ * mode (renewed or static), so each (re)connect attempt — ours or the library's — re-reads a
163
+ * CHECKED value. A refusal throws out of the authenticator, which nats-core turns into a closed
164
+ * connection rather than a CONNECT carrying dead material; the endpoint's own supervisor then
165
+ * rebuilds on capped backoff, and {@link bindConnection} re-fetches from the source on each of
166
+ * those attempts, so a renewal that starts working recovers the endpoint without presenting
167
+ * anything expired in the meantime. Deliberately side-effect free: kicking the renewal timer
168
+ * from here would retry the source once per dial attempt, which is the flat load on a dead
169
+ * broker that {@link RETRY_BACKOFF_CAP_MS} exists to prevent. */
170
+ private credsForWire;
171
+ /** The credential this endpoint presents on its next connect, checked as {@link credsForWire}
172
+ * checks it. A second connection under the same identity reads it on every attempt, so it
173
+ * presents each credential this endpoint adopts and never an expired one. */
174
+ wireCreds(): string;
175
+ /** Refuses a fetched generation there is nothing to renew FROM, so the caller's failure posture
176
+ * ({@link CREDS_RETRY_MS}) applies instead of the renewal schedule (issue #1523).
177
+ *
178
+ * A source that hands back the SAME generation past its own renewal point has not re-signed yet:
179
+ * that is a missed remint, not a candidate. Adopting it re-arms from a non-positive delay, which
180
+ * {@link armCredsRefresh} floors to 1s, which fetches again, which is the same generation — a 1s
181
+ * read loop against a store that is already having a bad day, for the JWT's remaining 25% of life,
182
+ * with the 60s backoff that exists for exactly this bypassed because the fetch did not FAIL.
183
+ *
184
+ * The membership feed's rw-cred renewal already refuses it this way (`membership-feed.ts`,
185
+ * `adoptRwCreds`: "the rw source still holds the previous generation past its renewal point");
186
+ * this is the same rule on the endpoint's `delivery.creds` seam, so the two renewal paths answer
187
+ * a dead source identically.
188
+ *
189
+ * An ALREADY-EXPIRED generation is refused whatever it is: the delay is non-positive for it too,
190
+ * but it is dead rather than merely due, so it is named separately and refused even when the
191
+ * source keeps returning a different one. */
192
+ private static assertRenewableGeneration;
193
+ /** The disposable-preflight connect bound for the EXPLICIT reload proof (D5 class-2 adoption). A
194
+ * rogue or unreachable candidate must resolve well UNDER the manager's delivery-admin request
195
+ * bound, so this stays a few seconds and never blocks the responder. */
196
+ private static readonly PREFLIGHT_MS;
197
+ /** How long the resident wire swap is deferred past the reply on the EXPLICIT reload path. The
198
+ * delivery-admin responder rides THIS connection, so `nc.reconnect()` must not run until the
199
+ * reply has flushed on the still-live old cred; the old cred stays valid until its exp, so a short
200
+ * deferral is safe. */
201
+ private static readonly RESIDENT_SWAP_DEFER_MS;
202
+ /** How long a delivery-admin request read after a reload waits for the resident swap's reconnect.
203
+ * nats.js drops a publish made while the connection is down when it redials, so a reply sent
204
+ * during the swap is lost and its caller waits out its whole request timeout. Past this bound the
205
+ * request is answered anyway, as it was before the gate. */
206
+ private static readonly RESIDENT_SWAP_GATE_MS;
207
+ /** The daemon-side deadline for the WHOLE prove-then-adopt transaction (source fetch + preflight +
208
+ * commit), kept strictly BELOW the manager's delivery-admin request bound so a slow or hung hosted
209
+ * store returns a structured component failure rather than an ambiguous client timeout, and a late
210
+ * fetch can never commit after the caller gave up. */
211
+ private static readonly RELOAD_DEADLINE_MS;
212
+ /** Fetch fresh creds from the source, pin their identity to ours, cache them, and arm the next
213
+ * refresh at 75% of the new JWT's lifetime. THROWS on fetch/pin failure — the callers decide the
214
+ * failure posture (loud-and-retry for the timer, a structured error reply for an explicit
215
+ * {@link reloadCreds}). This is the PASSIVE-BACKSTOP fetch; the explicit auditable path
216
+ * ({@link reloadCreds}) does its own fetch so it can preflight the candidate on a disposable
217
+ * connection BEFORE mutating this live cache. */
218
+ private fetchFreshCreds;
219
+ /** Swap the live connection onto the freshest cached cred or bearer with a controlled
220
+ * `nc.reconnect()` (nats.js re-evaluates the authenticator per attempt). Swapping now, instead of
221
+ * waiting for the broker to close the connection at `exp`, means the wire never carries a
222
+ * near-dead JWT and the operator never sees a spurious "authentication expired". After the
223
+ * reconnect succeeds, re-arm the expiry fence for the credential now authenticated on the wire. */
224
+ private swapConnectionOntoFreshCreds;
225
+ /** A second connection whose `onConnection` subscriptions are flushed before the resident
226
+ * reconnect. Its inbox is not the resident connection's inbox. A flush that does not finish
227
+ * closes it and leaves the caller to reconnect in place. */
228
+ private openRenewalOverlap;
229
+ /** nats-core keeps its reconnect switch on the protocol handler. This pinned internal shape is the
230
+ * same last-resort surface used by {@link closeFailedBind}; there is no public API for changing the
231
+ * reconnect policy of an existing connection. Disabling it does not disable Cotal self-heal: the
232
+ * `nc.closed()` supervisor below rebuilds the endpoint with freshly checked auth material. */
233
+ disableLibraryReconnect(nc: NatsConnection): void;
234
+ /** Close a connection whose library reconnect has already been disabled. `drain()` flushes with a
235
+ * PING and waits for the matching PONG; nats-core only rejects that waiter inside reconnect
236
+ * `prepare()`, so a half-open socket with reconnect=false leaves drain pending until the 2-minute
237
+ * ping interval times out. `close()` tears the transport down without that round-trip, which is
238
+ * the same public path {@link closeFailedBind} already uses when there is no graceful delivery
239
+ * contract left. */
240
+ closeWithoutLibraryReconnect(nc: NatsConnection | undefined): Promise<void>;
241
+ /** Disable nats-core reconnect shortly before the JWT authenticated on this wire expires. The small
242
+ * lead makes the policy change precede the broker's expiry close even when both timers wake in the
243
+ * same event-loop turn. A credential adoption does not move this fence until the resident reconnect
244
+ * is requested, so the old wire remains protected during the prove-then-adopt window. */
245
+ armAuthExpiryReconnectFence(nc: NatsConnection): void;
246
+ /** The connectAndBind PRE-CONNECT fetch: pull the freshest source cred and pin it into
247
+ * {@link currentCreds} so the connect() that immediately follows presents it — that connect IS the
248
+ * proof, so NO preflight and NO live swap here. THROWS when `initial` (no cred to start from), else
249
+ * emits and retries. The LIVE-SWAP paths — the 75% timer {@link renewCredsOnTimer} and the explicit
250
+ * {@link reloadCreds} — preflight the candidate on a disposable connection instead, so they never
251
+ * reconnect the live connection onto an unproven cred. */
252
+ refreshCreds(initial?: boolean): Promise<void>;
253
+ private runCredsTxn;
254
+ /** The one PROVE-then-adopt transaction shared by the 75% timer and the explicit reload (run under
255
+ * {@link runCredsTxn}). Fetch (deadline-bounded) → identity-pin → optional `expected` fingerprint →
256
+ * PREFLIGHT the candidate on a disposable connection → fence a late commit against the deadline →
257
+ * commit {@link currentCreds} → arm the next 75% timer. Because currentCreds is written ONLY after
258
+ * the preflight proves broker acceptance, the resident authenticator getter can never present an
259
+ * unproven cred (not even on an incidental reconnect), and a rejected candidate leaves the resident
260
+ * connection untouched on BOTH the timer and explicit paths. THROWS (structured) on any failure. */
261
+ private adoptFreshCreds;
262
+ /** The 75%-of-lifetime renewal timer tick: prove + adopt + swap the LIVE connection. Preflights (it
263
+ * reconnects a live connection, so the candidate must be broker-proven first) and is serialized
264
+ * with the explicit reload. Never throws — a failed renewal logs and retries while the old cred
265
+ * stays live until its expiry. */
266
+ renewCredsOnTimer(): Promise<void>;
267
+ /** Fetch, broker-prove and adopt the source credential, then refresh the same connection
268
+ * once outgoing mux and named-reply requests are quiet. A busy timeout retains the connection
269
+ * and adopted credential. Call again to retry. This does not tear down endpoint bindings.
270
+ * A dropped connection that is being re-established carries no request, so it redials now
271
+ * instead of after its backoff; the rebuild re-fetches a stale credential from the source. */
272
+ refreshCredsRequestSafe(): Promise<void>;
273
+ /** EXPLICIT credential reload — the auditable adoption step of D5 class-2 standing renewal (served
274
+ * to the renewal owner via the delivery-admin rail). The PROOF-OF-RECORD is a DISPOSABLE PREFLIGHT
275
+ * connection that presents exactly the candidate: it succeeds only when the BROKER accepts this
276
+ * re-signed generation, and it runs BEFORE the live cache is touched. So a cred the broker refuses
277
+ * throws HERE (structured), the resident connection — and the delivery-admin rail this very reply
278
+ * rides — is never disturbed, and "file re-signed" can never masquerade as "daemon adopted".
279
+ * `expected` is the renewal owner's generation token (SHA-256 of the JWT it re-signed): a re-read
280
+ * that does not match is rejected before the preflight even runs. On success the candidate becomes
281
+ * the resident connection's next-presented cred; the wire swap is NOT forced here — the caller
282
+ * ({@link handleDeliveryAdmin}) schedules it AFTER the aggregate reply, because the responder rides
283
+ * this connection and reconnecting before the reply flushes would strand it (see
284
+ * adoption-false-green.smoke.ts). Returns the BROKER-ACCEPTED generation's window (identity/iat/exp):
285
+ * the resident wire swap is best-effort and self-healing (the 75% timer + the broker's expiry-close),
286
+ * NOT witnessed, so the caller must claim broker acceptance, not verified resident reauth. NEVER a
287
+ * fingerprint. */
288
+ reloadCreds(expected?: string): Promise<{
289
+ identity: string;
290
+ iat?: number;
291
+ exp?: number;
292
+ }>;
293
+ /** Arm the resident wire swap for the delivery-admin `reloadCreds` path. Called by
294
+ * {@link handleDeliveryAdmin} ONLY after BOTH component proofs have settled and immediately before
295
+ * the reply is returned+responded — never from inside {@link reloadCreds} while the aggregate is
296
+ * still open, or a slow co-component proof would let `nc.reconnect()` reconnect the admin rail
297
+ * before the reply flushes and silently strand it. The short deferral lets the reply flush on the
298
+ * still-live old cred first. Best-effort — the proof was the preflight; a transient swap failure is
299
+ * retried by the 75% timer and the broker's own expiry-close, both presenting the adopted candidate.
300
+ * Until the swapped connection is back, {@link residentSwap} holds the delivery-admin requests that
301
+ * arrive after this reply. */
302
+ scheduleResidentSwap(): void;
303
+ /** Resolve when this endpoint reports its transport connected again, or after `ms`. */
304
+ private transportBack;
305
+ }
306
+ //# sourceMappingURL=endpoint-credentials.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"endpoint-credentials.d.ts","sourceRoot":"","sources":["../src/endpoint-credentials.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAE9D,OAAO,EAAgB,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAK1E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C;;iCAEiC;AACjC,MAAM,WAAW,uBAAuB;IACtC,EAAE,EAAE,MAAM,cAAc,GAAG,SAAS,CAAC;IACrC,YAAY,EAAE,MAAM,CAAC,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,SAAS,CAAC;IACxD,KAAK,EAAE,MAAM,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,MAAM,GAAG,SAAS,CAAC;IACxC,gBAAgB,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,KAAK,IAAI,CAAC;IACtD,iBAAiB,EAAE,MAAM,MAAM,CAAC;IAChC,oBAAoB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9C,qBAAqB,EAAE,MAAM,MAAM,CAAC;IACpC,wBAAwB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClD,mBAAmB,EAAE,MAAM,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CAAC;IACpD,sBAAsB,EAAE,CAAC,KAAK,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,KAAK,IA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