@yeaft/webchat-agent 1.0.373 → 1.0.375
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/cli.js +8 -0
- package/connection/index.js +11 -1
- package/index.js +4 -0
- package/local-runtime/server/api.js +2 -0
- package/local-runtime/server/auth/login.js +1 -0
- package/local-runtime/server/auth/oauth-flow.js +2 -2
- package/local-runtime/server/auth/token.js +4 -0
- package/local-runtime/server/config.js +47 -1
- package/local-runtime/server/database.js +1 -0
- package/local-runtime/server/db/connection.js +346 -4
- package/local-runtime/server/db/sandbox-db.js +673 -0
- package/local-runtime/server/db/user-db.js +137 -7
- package/local-runtime/server/index.js +60 -2
- package/local-runtime/server/routes/sandbox-routes.js +124 -0
- package/local-runtime/server/routes/user-routes.js +30 -15
- package/local-runtime/server/sandbox-agent-auth.js +66 -0
- package/local-runtime/server/sandbox-attestation-listener.js +128 -0
- package/local-runtime/server/sandbox-config.js +42 -0
- package/local-runtime/server/sandbox-host-attestation.js +175 -0
- package/local-runtime/server/sandbox-reconciler.js +355 -0
- package/local-runtime/server/ws-agent.js +34 -11
- package/local-runtime/server/ws-client.js +18 -5
- package/local-runtime/version.json +1 -1
- package/local-runtime/web/app.bundle.js +153 -92
- package/local-runtime/web/app.bundle.js.gz +0 -0
- package/local-runtime/web/index.html +2 -2
- package/local-runtime/web/style.bundle.css +1 -1
- package/local-runtime/web/style.bundle.css.gz +0 -0
- package/managed-sandbox/agent-runtime.js +73 -0
- package/managed-sandbox/controller.js +118 -0
- package/managed-sandbox/helper.js +437 -0
- package/managed-sandbox/identity-store.js +9 -0
- package/managed-sandbox/runtime-executor.js +387 -0
- package/package.json +1 -1
|
@@ -43,14 +43,22 @@ export function handleWebConnection(ws, url, req = {}) {
|
|
|
43
43
|
role = result?.role === 'admin' ? 'admin' : (result ? 'pro' : null);
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
//
|
|
46
|
+
// Authenticated mode must never recreate a deleted or pending account from
|
|
47
|
+
// a surviving JWT. SKIP_AUTH retains its development bootstrap behavior.
|
|
47
48
|
if (authenticated && username) {
|
|
48
49
|
try {
|
|
49
|
-
const user =
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
const user = CONFIG.skipAuth
|
|
51
|
+
? userDb.getOrCreate(username)
|
|
52
|
+
: userDb.getByUsername(username);
|
|
53
|
+
if (!user || (!CONFIG.skipAuth && user.deletion_state !== 'active')) {
|
|
54
|
+
authenticated = false;
|
|
55
|
+
} else {
|
|
56
|
+
userId = user.id;
|
|
57
|
+
userDb.updateLogin(userId);
|
|
58
|
+
}
|
|
52
59
|
} catch (e) {
|
|
53
|
-
|
|
60
|
+
authenticated = false;
|
|
61
|
+
console.error('Failed to resolve user:', e.message);
|
|
54
62
|
}
|
|
55
63
|
}
|
|
56
64
|
|
|
@@ -175,6 +183,11 @@ const WORKBENCH_TYPES = new Set([
|
|
|
175
183
|
async function handleWebMessage(clientId, msg) {
|
|
176
184
|
const client = webClients.get(clientId);
|
|
177
185
|
if (!client || !client.authenticated) return;
|
|
186
|
+
if (!CONFIG.skipAuth && !userDb.isActive(client.userId)) {
|
|
187
|
+
client.authenticated = false;
|
|
188
|
+
client.ws.close(1008, 'Account disabled');
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
178
191
|
|
|
179
192
|
// feat-ws-plaintext-negotiation: early capability frame from new web
|
|
180
193
|
// clients. Tells the server "you may stop encrypting outbound to me".
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"1.0.
|
|
1
|
+
{"version":"1.0.375"}
|