Skip to main content
Glama
verify-audit-log.js694 B
import fs from "fs"; import crypto from "crypto"; function sha256(input) { return crypto.createHash("sha256").update(input).digest("hex"); } const lines = fs.readFileSync("audit-log.jsonl", "utf8").trim().split("\n"); let expectedPrev = "GENESIS"; for (const [i, line] of lines.entries()) { const entry = JSON.parse(line); const { hash, prevHash, ...rest } = entry; if (prevHash !== expectedPrev) { throw new Error(`AUDIT_TAMPERED at line ${i + 1}`); } const recomputed = sha256(JSON.stringify({ ...rest, prevHash })); if (recomputed !== hash) { throw new Error(`AUDIT_HASH_MISMATCH at line ${i + 1}`); } expectedPrev = hash; } console.log("AUDIT LOG VALID");

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/dylanmarriner/MCP-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server