mirror of
https://github.com/profullstack/logicsrc.git
synced 2026-12-01 01:14:47 +00:00
Register PRD 0004, and stop the fixtures looking like real secrets
Two CI failures, both mine. `prd/README.md` is generated by `logicsrc prd index --write` and the scaffold test asserts it is current, so adding a PRD without regenerating it leaves the repo's own conformance check failing. Regenerated. The MCP test asserts the next free PRD id against the live prd/ directory — its comment says it advances with every PRD added — so it moves to 0005. ThreatCrush flagged three of the example strings: a PEM header in the item-model docs and in the conformance fixture, and an `sk_live_` prefixed token. All placeholders, none real, but the finding is the scanner working. A fixture only has to exercise the field, and a real-looking private key header or live-key prefix sitting in the tree trains both the scanner and the people reading its output to shrug at exactly the shape that matters. Replaced with obvious placeholders rather than suppressing the rule. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QRQrfuwuYKKV5UB9kLHuX5
This commit is contained in:
parent
872d09bc6a
commit
53008e561b
5 changed files with 15 additions and 9 deletions
|
|
@ -152,7 +152,7 @@ An SSH deploy key:
|
|||
"key": {
|
||||
"keyType": "ssh", "algorithm": "ed25519",
|
||||
"publicKey": "ssh-ed25519 AAAAC3Nza… deploy@railway",
|
||||
"privateKey": "-----BEGIN OPENSSH PRIVATE KEY-----\n…\n-----END OPENSSH PRIVATE KEY-----\n",
|
||||
"privateKey": "<the armoured private key body>",
|
||||
"passphrase": "", "fingerprint": "SHA256:9Vt…",
|
||||
"path": "~/.ssh/id_ed25519_railway", "mode": "0600", "expiresAt": ""
|
||||
},
|
||||
|
|
@ -170,7 +170,7 @@ A connected account:
|
|||
"account": {
|
||||
"provider": "stripe", "accountId": "acct_1P…", "handle": "profullstack",
|
||||
"email": "billing@profullstack.com",
|
||||
"accessToken": "sk_live_…", "refreshToken": "", "tokenType": "bearer",
|
||||
"accessToken": "<access token>", "refreshToken": "", "tokenType": "bearer",
|
||||
"scopes": ["charges:write", "customers:read"],
|
||||
"expiresAt": "", "environment": "production"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -203,7 +203,7 @@ describe("MCP: OpenPRD", () => {
|
|||
it("reports the next free id and the allowed lifecycle moves", async () => {
|
||||
const client = await connect();
|
||||
// Asserted against the live prd/ directory, so this advances with every PRD added.
|
||||
expect(toolText(await client.callTool({ name: "prd_next_id", arguments: {} }))).toBe("0004");
|
||||
expect(toolText(await client.callTool({ name: "prd_next_id", arguments: {} }))).toBe("0005");
|
||||
|
||||
const moves = await client.callTool({ name: "prd_next_statuses", arguments: { ref: "0001" } });
|
||||
const payload = JSON.parse(toolText(moves)) as { status: string; allowedNext: string[] };
|
||||
|
|
|
|||
|
|
@ -94,8 +94,8 @@ describe("items", () => {
|
|||
await authed(["add", "card", "--name", "Visa", "--number", "4242424242424242", "--code", "123"]),
|
||||
await authed(["add", "identity", "--name", "Me", "--first-name", "Anthony", "--ssn", "000-00-0000"]),
|
||||
await authed(["add", "note", "--name", "WiFi", "--notes", "on the router"]),
|
||||
await authed(["add", "key", "--name", "deploy", "--key-type", "ssh", "--private-key", "-----BEGIN-----", "--mode", "0600"]),
|
||||
await authed(["add", "account", "--name", "Stripe", "--provider", "stripe", "--access-token", "sk_live_x", "--scope", "charges:write"]),
|
||||
await authed(["add", "key", "--name", "deploy", "--key-type", "ssh", "--private-key", "<private key body>", "--mode", "0600"]),
|
||||
await authed(["add", "account", "--name", "Stripe", "--provider", "stripe", "--access-token", "<access token>", "--scope", "charges:write"]),
|
||||
];
|
||||
for (const result of added) expect(result.code, result.stderr).toBe(0);
|
||||
|
||||
|
|
@ -113,7 +113,7 @@ describe("items", () => {
|
|||
const json = await authed(["list", "--json"]);
|
||||
expect(json.stdout).not.toContain("hunter2");
|
||||
expect(json.stdout).not.toContain("4242424242424242");
|
||||
expect(json.stdout).not.toContain("sk_live_x");
|
||||
expect(json.stdout).not.toContain("<access token>");
|
||||
expect(json.stdout).not.toContain("000-00-0000");
|
||||
// Non-secret fields are still there, or the output would be useless.
|
||||
expect(json.stdout).toContain("anthony");
|
||||
|
|
@ -227,7 +227,7 @@ describe("export and import", () => {
|
|||
csv,
|
||||
[
|
||||
"folder,favorite,type,name,notes,login_uri,login_username,login_password,login_totp",
|
||||
"Imported,1,login,GitLab,,https://gitlab.com,anthony,glpat-xxx,",
|
||||
"Imported,1,login,GitLab,,https://gitlab.com,anthony,<gitlab token>,",
|
||||
",,,,,,,,",
|
||||
"",
|
||||
].join("\n"),
|
||||
|
|
|
|||
|
|
@ -119,13 +119,18 @@ export function fixturePayload(): DatabasePayload {
|
|||
identity: { firstName: "Anthony", lastName: "Ettinger", ssn: "000-00-0000" },
|
||||
} as Partial<Item>),
|
||||
createItem("note", { name: "WiFi", notes: "the password is on the router" }),
|
||||
// The secret-shaped fields hold obvious placeholders rather than
|
||||
// realistic-looking values. A fixture only has to exercise the field, and
|
||||
// a real-looking PEM header or `sk_live_` prefix in the tree trains both
|
||||
// credential scanners and the people reading their output to shrug at the
|
||||
// shape that matters.
|
||||
createItem("key", {
|
||||
name: "deploy@railway",
|
||||
key: { keyType: "ssh", algorithm: "ed25519", privateKey: "-----BEGIN OPENSSH PRIVATE KEY-----", path: "~/.ssh/id_ed25519", mode: "0600" },
|
||||
key: { keyType: "ssh", algorithm: "ed25519", privateKey: "<private key body>", path: "~/.ssh/id_ed25519", mode: "0600" },
|
||||
} as Partial<Item>),
|
||||
createItem("account", {
|
||||
name: "Stripe",
|
||||
account: { provider: "stripe", accessToken: "sk_live_x", scopes: ["charges:write", "customers:read"], environment: "production" },
|
||||
account: { provider: "stripe", accessToken: "<access token>", scopes: ["charges:write", "customers:read"], environment: "production" },
|
||||
} as Partial<Item>),
|
||||
],
|
||||
};
|
||||
|
|
|
|||
|
|
@ -14,3 +14,4 @@ Status lives in each file's front-matter and is the source of truth:
|
|||
| [0001](./0001-add-logicsrc-openontology-spec.md) | Add the LogicSRC OpenOntology specification | Draft | openontology, ontology, knowledge-graph, agents, mcp, schemas |
|
||||
| [0002](./0002-hourly-hire-us-rate.md) | Move Hire Us pricing from a weekly retainer to an hourly rate | Accepted | pricing, site, billing |
|
||||
| [0003](./0003-add-logicsrc-opencontext-spec.md) | Add the LogicSRC OpenContext specification | Draft | opencontext, context, agents, permissions, provenance, schemas |
|
||||
| [0004](./0004-add-logicsrc-opencreds-spec.md) | Add the LogicSRC OpenCreds specification | Draft | opencreds, credentials, vault, encryption, portability, schemas |
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue