@vaultys/mcp-agent 0.1.2 → 0.1.4
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/bin/audit.js +7 -2
- package/dist/src/audit.js +7 -2
- package/dist/src/policyMiddleware.js +8 -1
- package/package.json +1 -1
package/dist/bin/audit.js
CHANGED
|
@@ -96,8 +96,13 @@ async function main() {
|
|
|
96
96
|
const jobId = record.job_id;
|
|
97
97
|
const decision = record.decision;
|
|
98
98
|
const tool = record.tool;
|
|
99
|
-
if (receipt.broker_signature
|
|
100
|
-
|
|
99
|
+
if (receipt.broker_signature) {
|
|
100
|
+
if (typeof receipt.broker_signature === "string") {
|
|
101
|
+
receipt.broker_signature = Buffer.from(receipt.broker_signature, "base64");
|
|
102
|
+
}
|
|
103
|
+
else if (typeof receipt.broker_signature === "object" && receipt.broker_signature.data) {
|
|
104
|
+
receipt.broker_signature = Buffer.from(receipt.broker_signature.data);
|
|
105
|
+
}
|
|
101
106
|
}
|
|
102
107
|
let verified = false;
|
|
103
108
|
let sigStatus = "⏭ no key";
|
package/dist/src/audit.js
CHANGED
|
@@ -91,8 +91,13 @@ async function main() {
|
|
|
91
91
|
const decision = record.decision;
|
|
92
92
|
const tool = record.tool;
|
|
93
93
|
// Restore Buffer types for signature
|
|
94
|
-
if (receipt.broker_signature
|
|
95
|
-
|
|
94
|
+
if (receipt.broker_signature) {
|
|
95
|
+
if (typeof receipt.broker_signature === "string") {
|
|
96
|
+
receipt.broker_signature = Buffer.from(receipt.broker_signature, "base64");
|
|
97
|
+
}
|
|
98
|
+
else if (typeof receipt.broker_signature === "object" && receipt.broker_signature.data) {
|
|
99
|
+
receipt.broker_signature = Buffer.from(receipt.broker_signature.data);
|
|
100
|
+
}
|
|
96
101
|
}
|
|
97
102
|
let verified = false;
|
|
98
103
|
let sigStatus = "⏭ no key";
|
|
@@ -87,11 +87,18 @@ function ensureAuditDir() {
|
|
|
87
87
|
}
|
|
88
88
|
function persistReceipt(jobId, receipt, meta) {
|
|
89
89
|
ensureAuditDir();
|
|
90
|
+
// Serialize broker_signature as base64 string for JSON storage
|
|
91
|
+
const serializedReceipt = {
|
|
92
|
+
...receipt,
|
|
93
|
+
broker_signature: receipt.broker_signature
|
|
94
|
+
? Buffer.from(receipt.broker_signature).toString("base64")
|
|
95
|
+
: undefined,
|
|
96
|
+
};
|
|
90
97
|
const record = {
|
|
91
98
|
job_id: jobId,
|
|
92
99
|
timestamp: new Date().toISOString(),
|
|
93
100
|
...meta,
|
|
94
|
-
receipt,
|
|
101
|
+
receipt: serializedReceipt,
|
|
95
102
|
};
|
|
96
103
|
const filePath = path.join(AUDIT_DIR, `${jobId}.json`);
|
|
97
104
|
fs.writeFileSync(filePath, JSON.stringify(record, null, 2));
|
package/package.json
CHANGED