IF Commons GitHub

Trust and keys in merge and sync-medium

0005Active

0005-anyfs-cli-merge-signing · owner if · domain commons

Requirements

FR-001checkpassing

merge under --trust signed --roster FILE MUST refuse deltas that are not signed and say so by kind, and MUST take them when each is signed with the key of its origin (--sign-key FILE[,FILE]); --trust allowlist --replicas ID[,ID] and --trust open MUST do what they say.

Enforced (check): .github: cd commons/anyfs-cli && bun run verify — suite/signing.test.ts

Proved by: anyfs-cli/suite/signing.test.ts

Written in: anyfs-cli/src/physical/verbs/trust.ts

Tests: passed: suite/signing.test.ts merge under --trust signed refuses deltas that are not signed, says so by kind, and takes

FR-002checkpassing

A key and a roster MUST be named by a file or by env:NAME; an unset variable, text that is not a key and a roster that cannot be read MUST each be a usage error, and the private key MUST NOT appear in any answer.

Enforced (check): .github: cd commons/anyfs-cli && bun run verify — suite/signing.test.ts

Proved by: anyfs-cli/suite/signing.test.ts

Written in: anyfs-cli/src/physical/verbs/trust.ts

Tests: passed: suite/signing.test.ts a key and a roster are named by a file or by env:NAME; a variable that is not set, text th

FR-003checkpassing

sync-medium MUST sign what it publishes with the key of the replica of the store, MUST take only what the trust takes and say what it refused (refused (unknown-key), with the problem E-FILES-ASIDE), and a key that is of another replica than the store's MUST be a usage error.

Enforced (check): .github: cd commons/anyfs-cli && bun run verify — suite/signing.test.ts

Proved by: anyfs-cli/suite/signing.test.ts

Tests: passed: suite/signing.test.ts sync-medium signs what it publishes with the key of the store's replica and takes only wha

FR-004checkpassing

A mount MAY say trust: { mode, roster, replicas, signKeys }; the command line MUST override it, a mode with what it needs left out (signed with no roster, allowlist with no replicas, a roster with no mode) MUST be a usage error, and a mode that is not one of the three MUST be refused when the configuration is read.

Enforced (check): .github: cd commons/anyfs-cli && bun run verify — suite/signing.test.ts

Proved by: anyfs-cli/suite/signing.test.ts

Tests: passed: suite/signing.test.ts a mount may say the trust and the keys, a flag overrides it, and a command line that asks

FR-005checkpassing

A tool (tools/keygen.ts) MUST write a key for a replica to a file readable by its owner only, print the entry for the roster and never the private key, and never write over a file.

Enforced (check): .github: cd commons/anyfs-cli && bun run verify — suite/signing.test.ts

Proved by: anyfs-cli/suite/signing.test.ts

Written in: anyfs-cli/tools/keygen.ts

Tests: passed: suite/signing.test.ts the tool that makes a key writes the file for its owner only, prints the entry for the ros

Cited by: Keys and rosters of signed merges

Acceptance scenarios

  1. Given a roster and two stores whose deltas are unsigned, When merge --trust signed is applied, Then each is refused as unsigned and the command ends with E-MERGE-REFUSED, per FR-001.

Out of scope

  • Trust for the mount of a medium. A verb that makes keys, and the distribution of rosters and the rotation of keys, are 0007-anyfs-cli-keys.

Edge cases

  • The usage errors are found before a plan is shown with --dry-run, so that a bad key is never first found when applying, per FR-002.

Assumptions

  • A key is of a replica and the replica is the one the store is.

Open questions

  • None.

Key entities

  • Trust flags - --trust, --replicas, --roster, --sign-key.

Success criteria

SC-001success criterion

A person can require signatures between fleets from the command line without a secret on it.

Review & acceptance checklist

  • [x] Every requirement is testable (MUST / MUST NOT), not aspirational
  • [x] No implementation language beyond what the requirement needs
  • [x] Out of scope is stated

Cited by

Keys and rosters of signed merges

Titles, headings, exports, tables, columns and requirements. Esc closes.