dsh-mobile 0.6.6 → 0.6.8

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/lib/index.d.mts CHANGED
@@ -14,17 +14,21 @@ interface StoredDevice {
14
14
  readonly createdAt: number;
15
15
  readonly expiresAt: number;
16
16
  readonly lastSeenAt: number;
17
+ /** Native pairing identity bound to this credential; older records omit it. */
18
+ readonly nativeInstanceId?: string;
17
19
  /** Legacy tombstone accepted on load; AccessController removes it during initialization. */
18
20
  readonly revokedAt?: number;
19
21
  }
20
22
  /** Versioned device state. Raw device and Session credentials are never members. */
21
23
  interface DeviceSnapshot {
22
- readonly version: 1;
24
+ readonly version: 1 | 2;
23
25
  readonly devices: readonly StoredDevice[];
24
26
  }
25
27
  /** Persistence seam for device-token digests and revocation metadata. */
26
28
  interface DeviceStore {
29
+ /** Read either supported version without assigning identities to legacy rows. */
27
30
  load(): Promise<DeviceSnapshot>;
31
+ /** Validate and persist version 2, retaining any credential identity bindings. */
28
32
  save(snapshot: DeviceSnapshot): Promise<void>;
29
33
  }
30
34
  /** Validate durable data before it can authorize a device. */
@@ -64,10 +68,15 @@ interface AccessControllerOptions {
64
68
  readonly rateLimitWindowMs: number;
65
69
  readonly maxPairingAttempts: number;
66
70
  readonly maxRateLimitKeys: number;
71
+ /** Native identity stored with newly paired device credentials. */
72
+ readonly pairingInstanceId?: string;
73
+ /** Native response identity for older credentials without a stored binding. */
74
+ readonly legacyInstanceId?: string;
67
75
  readonly now?: () => number;
68
76
  }
69
77
  /** Values issued once after pairing; only digests survive the response. */
70
78
  interface PairingResult {
79
+ readonly nativeInstanceId?: string;
71
80
  readonly deviceId: string;
72
81
  readonly deviceToken: string;
73
82
  readonly deviceExpiresAt: number;
@@ -77,6 +86,7 @@ interface PairingResult {
77
86
  }
78
87
  /** Values issued after renewal with the persistent HttpOnly device Cookie. */
79
88
  interface RenewalResult {
89
+ readonly nativeInstanceId?: string;
80
90
  readonly deviceId: string;
81
91
  readonly sessionToken: string;
82
92
  readonly csrfToken: string;
@@ -90,6 +100,7 @@ interface SessionAuthorization {
90
100
  }
91
101
  /** Result of a persistent-device reachability check without opening a Session. */
92
102
  interface DeviceProbeResult {
103
+ readonly nativeInstanceId?: string;
93
104
  readonly deviceId: string;
94
105
  readonly deviceExpiresAt: number;
95
106
  }
@@ -136,6 +147,7 @@ export declare class AccessController {
136
147
  private requireInitialized;
137
148
  private exclusive;
138
149
  private snapshot;
150
+ private nativeIdentity;
139
151
  private emitSessionEnded;
140
152
  private removeSession;
141
153
  private pruneSessions;
@@ -333,6 +345,15 @@ interface PluginConfig {
333
345
  keyFile?: string;
334
346
  caFile?: string;
335
347
  };
348
+ /**
349
+ * Reserved cpolar subdomain passed through as `cpolar http -subdomain`.
350
+ *
351
+ * A compatible account reservation and region are required. Unset or blank values
352
+ * keep provider-selected allocation; credentials may still expire or be revoked.
353
+ */
354
+ cpolarSubdomain?: string;
355
+ /** cpolar region for `-region`; use the region chosen when reserving the subdomain. */
356
+ cpolarRegion?: string;
336
357
  pairingTtlMs?: number;
337
358
  deviceTtlMs?: number;
338
359
  sessionTtlMs?: number;
@@ -368,6 +389,8 @@ interface ResolvedGatewayConfig {
368
389
  readonly excludedClientModules: readonly string[];
369
390
  readonly websocketCompression: ResolvedWebSocketCompressionConfig;
370
391
  readonly instanceId: string;
392
+ /** Identity returned only for authenticated legacy native credentials without a stored binding. */
393
+ readonly legacyInstanceId?: string;
371
394
  readonly pairingCaFile?: string;
372
395
  readonly tls: TlsConfig;
373
396
  /** Whether the public hop is HTTPS, even when a trusted loopback proxy terminates TLS. */
@@ -664,8 +687,8 @@ declare class ExtensionWorkerHost {
664
687
  private cancelStream;
665
688
  }
666
689
  //#endregion
667
- //#region src/extensions.d.ts
668
- /** Maximum sizes enforced at the local-extension filesystem boundary. */
690
+ //#region src/extension-limits.d.ts
691
+ /** Maximum sizes enforced when reading local extension files. */
669
692
  export declare const EXTENSION_LIMITS: Readonly<{
670
693
  manifest: number;
671
694
  script: number;
@@ -675,6 +698,8 @@ export declare const EXTENSION_LIMITS: Readonly<{
675
698
  assetBytes: number;
676
699
  assetDepth: 8;
677
700
  }>;
701
+ //#endregion
702
+ //#region src/extensions.d.ts
678
703
  /** A controlled business failure returned by an extension action or route. */
679
704
  export declare class MobileExtensionError extends Error {
680
705
  readonly code: string;
@@ -989,6 +1014,8 @@ export declare class MobileAccessGateway {
989
1014
  private setBrowserDeviceBinding;
990
1015
  private handlePair;
991
1016
  private handleRenew;
1017
+ /** CA-backed entries retain their pin; public entries project the authenticated credential's identity. */
1018
+ private nativeResponseInstanceId;
992
1019
  private handleNativePair;
993
1020
  private handleNativeRenew;
994
1021
  private handleNativeProbe;
@@ -2281,7 +2308,7 @@ export declare const name = "dsh-mobile";
2281
2308
  /** The stock WebServer serves the control card; Connection authenticates the loopback DSH origin. */
2282
2309
  export declare const inject: string[];
2283
2310
  /** Reuse remote HTTPS policy while binding a separately validated private HTTP origin. */
2284
- export declare function originGatewayConfig(template: ResolvedGatewayConfig, settings: OriginSettings, stateFile: string, instanceId: string, listenPort?: number): ResolvedGatewayConfig;
2311
+ export declare function originGatewayConfig(template: ResolvedGatewayConfig, settings: OriginSettings, stateFile: string, instanceId: string, listenPort?: number, legacyInstanceId?: string): ResolvedGatewayConfig;
2285
2312
  /** Mount the resident control route and its optional authenticated LAN gateway. */
2286
2313
  export declare function apply(ctx: Context, config: PluginConfig): Promise<void>;
2287
2314
  //#endregion