@integrity-labs/cloud-broker 0.7.4 → 0.7.5
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/index.js +30 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -20985,6 +20985,26 @@ var StdioServerTransport = class {
|
|
|
20985
20985
|
}
|
|
20986
20986
|
};
|
|
20987
20987
|
|
|
20988
|
+
// src/turn-initiator-marker.ts
|
|
20989
|
+
import { readFileSync } from "fs";
|
|
20990
|
+
var TURN_INITIATOR_MAX_AGE_MS = 5 * 60 * 1e3;
|
|
20991
|
+
function readTurnInitiator(maxAgeMs = TURN_INITIATOR_MAX_AGE_MS) {
|
|
20992
|
+
const file = process.env["AGT_TURN_INITIATOR_FILE"];
|
|
20993
|
+
if (!file) return null;
|
|
20994
|
+
try {
|
|
20995
|
+
const raw = readFileSync(file, "utf8");
|
|
20996
|
+
const m = JSON.parse(raw);
|
|
20997
|
+
if (typeof m.channel !== "string" || !m.channel) return null;
|
|
20998
|
+
if (typeof m.sender_id !== "string" || !m.sender_id) return null;
|
|
20999
|
+
if (typeof m.ts !== "number" || !Number.isFinite(m.ts)) return null;
|
|
21000
|
+
const age = Date.now() - m.ts;
|
|
21001
|
+
if (age < 0 || age > maxAgeMs) return null;
|
|
21002
|
+
return { channel: m.channel, sender_id: m.sender_id };
|
|
21003
|
+
} catch {
|
|
21004
|
+
return null;
|
|
21005
|
+
}
|
|
21006
|
+
}
|
|
21007
|
+
|
|
20988
21008
|
// src/broker-client.ts
|
|
20989
21009
|
function makeBrokerError(status, message, detail) {
|
|
20990
21010
|
const err = new Error(message);
|
|
@@ -21123,7 +21143,15 @@ var BrokerClient = class {
|
|
|
21123
21143
|
if (!runId) {
|
|
21124
21144
|
throw makeBrokerError(400, "BrokerClient.requestAccess requires run_id (pass it in args, or set runId on BrokerClientConfig)");
|
|
21125
21145
|
}
|
|
21126
|
-
const
|
|
21146
|
+
const turnInitiator = readTurnInitiator();
|
|
21147
|
+
const { turn_initiator: _ignoredForged, ...safeArgs } = args;
|
|
21148
|
+
void _ignoredForged;
|
|
21149
|
+
const body = {
|
|
21150
|
+
...safeArgs,
|
|
21151
|
+
agent_id: agentId,
|
|
21152
|
+
run_id: runId,
|
|
21153
|
+
...turnInitiator ? { turn_initiator: turnInitiator } : {}
|
|
21154
|
+
};
|
|
21127
21155
|
return this.request("POST", `${this.apiPathPrefix}/grants`, { body });
|
|
21128
21156
|
}
|
|
21129
21157
|
pollGrant(args) {
|
|
@@ -21574,7 +21602,7 @@ var supabaseListProjectsShape = supabaseListProjectsSchema.shape;
|
|
|
21574
21602
|
// package.json
|
|
21575
21603
|
var package_default = {
|
|
21576
21604
|
name: "@integrity-labs/cloud-broker",
|
|
21577
|
-
version: "0.7.
|
|
21605
|
+
version: "0.7.5",
|
|
21578
21606
|
description: "Cloud Access Broker \u2014 MCP server that mints scoped, TTL-bounded cloud credentials per agent task. Ships AWS support (aws_request_access, aws_poll_grant, aws_release_access, aws_describe_scope, aws_preview_request, aws_get_credentials \u2014 STS AssumeRole under the hood); GCP, Azure, and Cloudflare land alongside in the same package as the broker grows.",
|
|
21579
21607
|
type: "module",
|
|
21580
21608
|
bin: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@integrity-labs/cloud-broker",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.5",
|
|
4
4
|
"description": "Cloud Access Broker — MCP server that mints scoped, TTL-bounded cloud credentials per agent task. Ships AWS support (aws_request_access, aws_poll_grant, aws_release_access, aws_describe_scope, aws_preview_request, aws_get_credentials — STS AssumeRole under the hood); GCP, Azure, and Cloudflare land alongside in the same package as the broker grows.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|