Refuse to freshen a signed manifest without --sign-key (closes #191) #203

Open
clawbot wants to merge 1 commits from issue-191-freshen-signed into next
Collaborator

mfer freshen given a signed manifest and neither --sign-key nor MFER_SIGN_KEY now stops after loading it, before scanning, with an error naming the signer's fingerprint and --sign-key, and leaves the manifest as it was. With --sign-key it rewrites and signs as before. The README's freshen entry says so.

Closes #191

What the diff does not show:

  • New exported method: Signer() on the existing loaded-manifest type in mfer/manifest.go. It returns the fingerprint of the key that signed the manifest, or nil when it is unsigned, as Checker.Signer does. Checker was not used: it would load the manifest a second time and needs a base path. Exporting the manifest type itself (#83, question 13) is not touched.
  • Judgement call: the refusal is in loadExistingEntries, which now takes cmd as freshenScan does, not in freshenManifestOperation. Adding it there put that function over the 80-line funlen limit.
  • Loading still verifies the signature and logs signature verified successfully before the refusal.
  • A --sign-key naming a different key from the one that signed the manifest is accepted, and the new manifest is signed with it; the issue does not ask otherwise.

Model: opus-5-5

`mfer freshen` given a signed manifest and neither `--sign-key` nor `MFER_SIGN_KEY` now stops after loading it, before scanning, with an error naming the signer's fingerprint and `--sign-key`, and leaves the manifest as it was. With `--sign-key` it rewrites and signs as before. The README's `freshen` entry says so. Closes https://git.eeqj.de/sneak/mfer/issues/191 What the diff does not show: - New exported method: `Signer()` on the existing loaded-manifest type in `mfer/manifest.go`. It returns the fingerprint of the key that signed the manifest, or nil when it is unsigned, as `Checker.Signer` does. `Checker` was not used: it would load the manifest a second time and needs a base path. Exporting the manifest type itself (https://git.eeqj.de/sneak/mfer/issues/83, question 13) is not touched. - Judgement call: the refusal is in `loadExistingEntries`, which now takes `cmd` as `freshenScan` does, not in `freshenManifestOperation`. Adding it there put that function over the 80-line `funlen` limit. - Loading still verifies the signature and logs `signature verified successfully` before the refusal. - A `--sign-key` naming a different key from the one that signed the manifest is accepted, and the new manifest is signed with it; the issue does not ask otherwise. Model: opus-5-5
clawbot self-assigned this 2026-10-13 17:25:04 +02:00
clawbot added 1 commit 2026-10-13 17:25:04 +02:00
freshen built the new manifest from its flags alone, so a signed
manifest freshened without --sign-key came out unsigned while the log
said its signature verified. freshen now stops after loading such a
manifest, before scanning, with an error naming the signer's
fingerprint and --sign-key, and leaves the manifest as it was. With
--sign-key it rewrites and signs as before.

The library gains Signer() on the loaded manifest: the signing key's
fingerprint, or nil when the manifest is unsigned, as Checker.Signer
gives it.

Model: opus-5-5
clawbot added the needs-review label 2026-10-13 17:25:10 +02:00
Author
Collaborator

Review passed.

  • Judgement call: a --sign-key naming a key other than the one that signed the manifest is accepted and the manifest is re-signed with it. The issue asks only for a refusal when no key is given, and the result stays signed.
  • Judgement call: the signature verified successfully line logged before the refusal stays. It is true, and nothing is written after it.

Model: opus-5-5

Review passed. - Judgement call: a `--sign-key` naming a key other than the one that signed the manifest is accepted and the manifest is re-signed with it. The issue asks only for a refusal when no key is given, and the result stays signed. - Judgement call: the `signature verified successfully` line logged before the refusal stays. It is true, and nothing is written after it. Model: opus-5-5
Some checks are pending
check / check (push) Waiting to run
You are not authorized to merge this pull request.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin issue-191-freshen-signed:issue-191-freshen-signed
git checkout issue-191-freshen-signed
Sign in to join this conversation.