@serve.zone/interfaces 20.2.0 → 21.1.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.
@@ -12,6 +12,7 @@ export type TCoreMailSha256 = `sha256:${string}`;
12
12
  export type TCoreMailCapability = 'outbound' | 'inbound';
13
13
  export type TCoreMailBindingState = 'active' | 'disabled';
14
14
  export type TCoreMailCredentialState = 'current' | 'retiring';
15
+ export type TCoreMailCredentialVerifierFormat = 'argon2id-v1';
15
16
  export type TCoreMailPartKind = 'text' | 'html' | 'attachment';
16
17
  export type TCoreMailTransferMethod = 'PUT' | 'GET';
17
18
  export type TCoreMailSubmissionState =
@@ -163,6 +164,8 @@ export interface ICoreMailBindingCredentialVerifier {
163
164
  credentialId: string;
164
165
  version: number;
165
166
  state: TCoreMailCredentialState;
167
+ /** Versioned verifier contract. CoreMail currently accepts only argon2id-v1. */
168
+ format: TCoreMailCredentialVerifierFormat;
166
169
  /** Password-verifier string only. Plaintext credential material is never part of desired state. */
167
170
  verificationHash: string;
168
171
  acceptUntil?: number;
@@ -195,6 +198,28 @@ export interface ICoreMailGatewayDesiredState {
195
198
  credentialSecretKey: string;
196
199
  }
197
200
 
201
+ /**
202
+ * Bootstrap authority installed in CoreMail before Coreflow can reconcile
203
+ * ordinary desired state. The verifier payload is safe to deliver as runtime
204
+ * configuration; the matching plaintext is delivered only to Coreflow.
205
+ */
206
+ export interface ICoreMailControlBootstrap {
207
+ schemaVersion: 1;
208
+ coreMailServiceId: string;
209
+ credentials: ICoreMailBindingCredentialVerifier[];
210
+ }
211
+
212
+ /**
213
+ * dcrouter-owned desired state for one authenticated CoreMail gateway peer.
214
+ * transferOrigin is authoritative control-plane data, never peer supplied.
215
+ */
216
+ export interface ICoreMailGatewayPeerDesiredState {
217
+ schemaVersion: 1;
218
+ coreMailServiceId: string;
219
+ transferOrigin: string;
220
+ credentials: ICoreMailBindingCredentialVerifier[];
221
+ }
222
+
198
223
  export interface ICoreMailDesiredState {
199
224
  schemaVersion: 1;
200
225
  configEpoch: number;
@@ -275,3 +300,19 @@ export const coreMailLimits = Object.freeze({
275
300
  transferIdleTimeoutMs: 15 * 1000,
276
301
  transferOverallTimeoutMs: 2 * 60 * 1000,
277
302
  } as const);
303
+
304
+ export const coreMailCredentialVerifierPolicy = Object.freeze({
305
+ format: 'argon2id-v1' as const,
306
+ version: 19,
307
+ memoryCost: 65_536,
308
+ timeCost: 3,
309
+ parallelism: 1,
310
+ saltLengthBytes: 16,
311
+ hashLengthBytes: 32,
312
+ } as const);
313
+
314
+ export const coreMailRuntimeKeys = Object.freeze({
315
+ controlBootstrap: 'COREMAIL_CONTROL_BOOTSTRAP',
316
+ controlCredentialSecret: 'COREMAIL_CONTROL_CREDENTIAL_SECRET',
317
+ gatewayCredentialSecret: 'COREMAIL_GATEWAY_CREDENTIAL',
318
+ } as const);
package/ts/data/index.ts CHANGED
@@ -2,6 +2,7 @@ export * from './cloudlyconfig.js';
2
2
  export * from './cluster.js';
3
3
  export * from './config.js';
4
4
  export * from './coremail.js';
5
+ export * from './coremail.runtime.js';
5
6
  export * from './deployment.js';
6
7
  export * from './deploymentadoption.js';
7
8
  export * from './deploymentoperation.js';
@@ -242,6 +242,8 @@ export interface IReq_CoreMailGatewayAuthenticate extends plugins.typedrequestIn
242
242
  response: {
243
243
  authenticated: true;
244
244
  credentialVersion: number;
245
+ /** dcrouter's authoritative, control-plane-bound origin for CoreMail transfer paths. */
246
+ coreMailTransferOrigin: string;
245
247
  };
246
248
  }
247
249
 
@@ -2,6 +2,16 @@ import * as plugins from '../plugins.js';
2
2
  import * as serviceInterfaces from '../data/service.js';
3
3
  import * as userInterfaces from '../data/user.js';
4
4
 
5
+ type TReportReconciliationRolloutIdentity =
6
+ | {
7
+ rolloutId: string;
8
+ rolloutGeneration: number;
9
+ }
10
+ | {
11
+ rolloutId?: never;
12
+ rolloutGeneration?: never;
13
+ };
14
+
5
15
  /**
6
16
  * a status update dashboard
7
17
  */
@@ -23,17 +33,19 @@ export interface IRequest_Coreflow_Cloudly_ReportReconciliationStatus
23
33
  IRequest_Coreflow_Cloudly_ReportReconciliationStatus
24
34
  > {
25
35
  method: 'reportReconciliationStatus';
26
- request: {
27
- identity: userInterfaces.IIdentity;
28
- serviceId: string;
29
- serviceName?: string;
30
- stage: string;
31
- stageKey?: string;
32
- status: serviceInterfaces.TServiceReconciliationStatus;
33
- domainName?: string;
34
- message?: string;
35
- errorText?: string;
36
- reportedAt?: number;
37
- };
36
+ request:
37
+ & {
38
+ identity: userInterfaces.IIdentity;
39
+ serviceId: string;
40
+ serviceName?: string;
41
+ stage: string;
42
+ stageKey?: string;
43
+ status: serviceInterfaces.TServiceReconciliationStatus;
44
+ domainName?: string;
45
+ message?: string;
46
+ errorText?: string;
47
+ reportedAt?: number;
48
+ }
49
+ & TReportReconciliationRolloutIdentity;
38
50
  response: {};
39
51
  }