@tangle-network/sandbox 0.60.31-develop.20261010050658.da61892 → 0.60.31-develop.20261010052048.51d0d3b
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/auth/index.js +23 -17
- package/package.json +3 -3
package/dist/auth/index.js
CHANGED
|
@@ -275,14 +275,17 @@ var ProductTokenIssuer = class {
|
|
|
275
275
|
issue(params) {
|
|
276
276
|
const tier = params.tier ?? "free";
|
|
277
277
|
const ttl = this.ttlMinutes[tier] ?? this.ttlMinutes.free;
|
|
278
|
+
const token = issueReadToken(this.signingSecret, {
|
|
279
|
+
sub: params.userId,
|
|
280
|
+
sid: params.sessionId,
|
|
281
|
+
pid: this.productId,
|
|
282
|
+
cid: params.sandboxId
|
|
283
|
+
}, ttl);
|
|
284
|
+
const payload = unsafeDecodeToken(token);
|
|
285
|
+
if (!payload) throw new Error("Failed to decode issued token");
|
|
278
286
|
return {
|
|
279
|
-
token
|
|
280
|
-
|
|
281
|
-
sid: params.sessionId,
|
|
282
|
-
pid: this.productId,
|
|
283
|
-
cid: params.sandboxId
|
|
284
|
-
}, ttl),
|
|
285
|
-
expiresAt: Math.floor(Date.now() / 1e3) + ttl * 60
|
|
287
|
+
token,
|
|
288
|
+
expiresAt: payload.exp
|
|
286
289
|
};
|
|
287
290
|
}
|
|
288
291
|
/**
|
|
@@ -291,17 +294,20 @@ var ProductTokenIssuer = class {
|
|
|
291
294
|
issueCollaboration(params) {
|
|
292
295
|
const tier = params.tier ?? "free";
|
|
293
296
|
const ttl = this.ttlMinutes[tier] ?? this.ttlMinutes.free;
|
|
297
|
+
const token = issueCollaborationToken(this.signingSecret, {
|
|
298
|
+
userId: params.userId,
|
|
299
|
+
sessionId: params.sessionId,
|
|
300
|
+
productId: this.productId,
|
|
301
|
+
projectId: params.projectId,
|
|
302
|
+
documentId: params.documentId,
|
|
303
|
+
access: params.access,
|
|
304
|
+
sandboxId: params.sandboxId
|
|
305
|
+
}, ttl);
|
|
306
|
+
const payload = unsafeDecodeToken(token);
|
|
307
|
+
if (!payload) throw new Error("Failed to decode issued token");
|
|
294
308
|
return {
|
|
295
|
-
token
|
|
296
|
-
|
|
297
|
-
sessionId: params.sessionId,
|
|
298
|
-
productId: this.productId,
|
|
299
|
-
projectId: params.projectId,
|
|
300
|
-
documentId: params.documentId,
|
|
301
|
-
access: params.access,
|
|
302
|
-
sandboxId: params.sandboxId
|
|
303
|
-
}, ttl),
|
|
304
|
-
expiresAt: Math.floor(Date.now() / 1e3) + ttl * 60
|
|
309
|
+
token,
|
|
310
|
+
expiresAt: payload.exp
|
|
305
311
|
};
|
|
306
312
|
}
|
|
307
313
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tangle-network/sandbox",
|
|
3
|
-
"version": "0.60.31-develop.
|
|
3
|
+
"version": "0.60.31-develop.20261010052048.51d0d3b",
|
|
4
4
|
"description": "Client SDK for the Tangle Sandbox platform - build AI agent applications with dev containers",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": [
|
|
@@ -151,10 +151,10 @@
|
|
|
151
151
|
"yjs": "13.6.30",
|
|
152
152
|
"@products/sandbox-test-utils": "0.0.0",
|
|
153
153
|
"@tangle-network/agent-profile-materialize": "0.22.2",
|
|
154
|
-
"@tangle-network/runtime-contracts": "0.16.0",
|
|
155
|
-
"@tangle-network/cli-agent-registry": "0.6.2",
|
|
156
154
|
"@repo/shared": "0.0.0",
|
|
155
|
+
"@tangle-network/runtime-contracts": "0.16.0",
|
|
157
156
|
"@tangle-network/sdk": "4.0.3",
|
|
157
|
+
"@tangle-network/cli-agent-registry": "0.6.2",
|
|
158
158
|
"@tangle-network/sse-core": "0.0.0"
|
|
159
159
|
},
|
|
160
160
|
"scripts": {
|