@kraki/head 0.20.0 → 0.20.1

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/dist/server.d.ts CHANGED
@@ -52,7 +52,7 @@ export declare class HeadServer {
52
52
  private options;
53
53
  private static readonly PING_INTERVAL;
54
54
  private connections;
55
- private pairingTokens;
55
+ private authBackend;
56
56
  private userByDevice;
57
57
  private clients;
58
58
  private pingTimer;
@@ -76,9 +76,6 @@ export declare class HeadServer {
76
76
  private linkProgressing;
77
77
  /** Test hook: force a liveness sweep without waiting for the timer. */
78
78
  forceLivenessSweep(): void;
79
- private getAuthProvider;
80
- private getAuthProviderForMode;
81
- private getGitHubClientId;
82
79
  private getVapidPublicKey;
83
80
  /**
84
81
  * Build the voice capability advertisement for `auth_ok` from this head's
@@ -91,7 +88,6 @@ export declare class HeadServer {
91
88
  * single helper.
92
89
  */
93
90
  private getVoiceCapability;
94
- private findGitHubProvider;
95
91
  attach(server: Server): void;
96
92
  acceptConnection(ws: WebSocket): void;
97
93
  /** (Re)start the deadline for this socket to authenticate (G1). */
@@ -150,7 +146,10 @@ export declare class HeadServer {
150
146
  private removeConnection;
151
147
  private sendAuthError;
152
148
  private handleAuth;
153
- private handlePairingAuth;
149
+ /** After an awaited auth step: is this socket still open, still ours and
150
+ * still unauthenticated? The auth deadline may have closed it meanwhile;
151
+ * registering a dead socket would evict the device's live connection. */
152
+ private socketStillAuthenticating;
154
153
  private handleChallengeResponse;
155
154
  /**
156
155
  * Handle a result from AuthBackend — registers connection state and sends response.
@@ -188,10 +187,18 @@ export declare class HeadServer {
188
187
  * Must be called BEFORE `connections.set(deviceId, ws)`.
189
188
  */
190
189
  private evictPreviousConnection;
191
- private completeAuth;
192
190
  private handleCreatePairingToken;
193
191
  private handleRequestPairingToken;
194
192
  private handleRemoveDevice;
193
+ /** Users whose deletion is in flight (a double tap must not run it twice). */
194
+ private deletingAccounts;
195
+ /**
196
+ * Delete the requesting user's account: at the account store (the account
197
+ * service in edge mode) and in this relay's own storage and pulse state.
198
+ * Then tell every connected device and close it. Devices that were offline
199
+ * get `auth_error` code `account_deleted` when they next connect.
200
+ */
201
+ private handleDeleteAccount;
195
202
  private handleRegisterPushToken;
196
203
  private handleUnregisterPushToken;
197
204
  private broadcastDeviceRemoved;