dsh-mobile 0.6.7 → 0.6.9
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/CHANGELOG.md +24 -2
- package/CONTRIBUTORS.md +4 -2
- package/README.en.md +28 -16
- package/README.md +28 -16
- package/SECURITY.md +9 -0
- package/THIRD_PARTY_NOTICES.md +1 -1
- package/apps/mobile/README.md +11 -7
- package/apps/mobile/release.json +3 -3
- package/docs/CADDY_MANAGED.en.md +21 -17
- package/docs/CADDY_MANAGED.md +21 -17
- package/docs/README.md +3 -3
- package/docs/SELF_HOSTED_FRP.en.md +1 -1
- package/docs/SELF_HOSTED_FRP.md +1 -1
- package/docs/SELF_HOSTED_ORIGIN.en.md +3 -1
- package/docs/SELF_HOSTED_ORIGIN.md +4 -2
- package/lib/client.js +9 -9
- package/lib/client.js.map +1 -1
- package/lib/index.d.mts +18 -2
- package/lib/index.mjs +314 -81
- package/lib/index.mjs.map +1 -1
- package/package.json +1 -1
- package/packages/question-fixes/package.json +1 -1
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;
|
|
@@ -377,6 +389,8 @@ interface ResolvedGatewayConfig {
|
|
|
377
389
|
readonly excludedClientModules: readonly string[];
|
|
378
390
|
readonly websocketCompression: ResolvedWebSocketCompressionConfig;
|
|
379
391
|
readonly instanceId: string;
|
|
392
|
+
/** Identity returned only for authenticated legacy native credentials without a stored binding. */
|
|
393
|
+
readonly legacyInstanceId?: string;
|
|
380
394
|
readonly pairingCaFile?: string;
|
|
381
395
|
readonly tls: TlsConfig;
|
|
382
396
|
/** Whether the public hop is HTTPS, even when a trusted loopback proxy terminates TLS. */
|
|
@@ -1000,6 +1014,8 @@ export declare class MobileAccessGateway {
|
|
|
1000
1014
|
private setBrowserDeviceBinding;
|
|
1001
1015
|
private handlePair;
|
|
1002
1016
|
private handleRenew;
|
|
1017
|
+
/** CA-backed entries retain their pin; public entries project the authenticated credential's identity. */
|
|
1018
|
+
private nativeResponseInstanceId;
|
|
1003
1019
|
private handleNativePair;
|
|
1004
1020
|
private handleNativeRenew;
|
|
1005
1021
|
private handleNativeProbe;
|
|
@@ -2292,7 +2308,7 @@ export declare const name = "dsh-mobile";
|
|
|
2292
2308
|
/** The stock WebServer serves the control card; Connection authenticates the loopback DSH origin. */
|
|
2293
2309
|
export declare const inject: string[];
|
|
2294
2310
|
/** Reuse remote HTTPS policy while binding a separately validated private HTTP origin. */
|
|
2295
|
-
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;
|
|
2296
2312
|
/** Mount the resident control route and its optional authenticated LAN gateway. */
|
|
2297
2313
|
export declare function apply(ctx: Context, config: PluginConfig): Promise<void>;
|
|
2298
2314
|
//#endregion
|