Remove secret vault import #174

Merged
clawbot merged 1 commits from fix/139-remove-vault-import into next 2026-10-15 03:14:56 +02:00
Collaborator

Removes secret vault import, as planned on #139.

The command took only a vault without a long-term key and refused one that does not exist. secret init and secret vault create give every vault a long-term key, so no sequence of commands made it succeed. A mnemonic enters through those two commands. The command, the code only it used, its README entry and its tests are gone. The help and the note of secret generate mnemonic named secret import, which imports a file as a secret; they now name secret init and secret vault create <name>.

TestNoVaultImportCommand makes a vault with secret vault create, runs secret vault import on it, and expects the output of secret vault alone. Before this change it failed with "already has a long-term key configured".

The diff does not show that secret vault import now prints the help of secret vault and exits 0. Cobra does that for any subcommand it cannot find under a command that does nothing itself, so secret vault foo already behaved this way. A non-zero exit would need new code in secret vault and is not part of this change.

  • Judgement call: TestWorkflowMismatch in internal/vault/metadata_test.go is deleted. It replayed the import's steps with the vault package's functions and tested nothing else.
  • Judgement call: the vault "other" in the setup of the lock test keeps its pub.age now; only the import case needed it removed.

Model: opus-5-5

Removes `secret vault import`, as planned on https://git.eeqj.de/sneak/secret/issues/139. The command took only a vault without a long-term key and refused one that does not exist. `secret init` and `secret vault create` give every vault a long-term key, so no sequence of commands made it succeed. A mnemonic enters through those two commands. The command, the code only it used, its README entry and its tests are gone. The help and the note of `secret generate mnemonic` named `secret import`, which imports a file as a secret; they now name `secret init` and `secret vault create <name>`. `TestNoVaultImportCommand` makes a vault with `secret vault create`, runs `secret vault import` on it, and expects the output of `secret vault` alone. Before this change it failed with "already has a long-term key configured". The diff does not show that `secret vault import` now prints the help of `secret vault` and exits 0. Cobra does that for any subcommand it cannot find under a command that does nothing itself, so `secret vault foo` already behaved this way. A non-zero exit would need new code in `secret vault` and is not part of this change. - Judgement call: `TestWorkflowMismatch` in `internal/vault/metadata_test.go` is deleted. It replayed the import's steps with the vault package's functions and tested nothing else. - Judgement call: the vault "other" in the setup of the lock test keeps its `pub.age` now; only the import case needed it removed. Model: opus-5-5
clawbot added the needs-review label 2026-10-14 23:38:44 +02:00
clawbot self-assigned this 2026-10-14 23:38:44 +02:00
clawbot force-pushed fix/139-remove-vault-import from 933bc8fb23 to 0e6de549ff 2026-10-14 23:49:53 +02:00 Compare
Author
Collaborator

internal/vault/management.go line 218: the doc comment of CreateVault still says that a vault made without a mnemonic "has no long-term key until one is imported". This change removes the only command that gave such a vault a long-term key, so the sentence promises something nothing does any more. Acceptable: end it at "the vault has no long-term key".

Model: opus-5-5

`internal/vault/management.go` line 218: the doc comment of `CreateVault` still says that a vault made without a mnemonic "has no long-term key until one is imported". This change removes the only command that gave such a vault a long-term key, so the sentence promises something nothing does any more. Acceptable: end it at "the vault has no long-term key". Model: opus-5-5
clawbot added needs-rework and removed needs-review labels 2026-10-15 00:17:15 +02:00
clawbot force-pushed fix/139-remove-vault-import from 0e6de549ff to 0d18c3d4b8 2026-10-15 00:55:03 +02:00 Compare
Author
Collaborator

Rework:

  • CreateVault doc comment in internal/vault/management.go: the sentence now ends at "the vault has no long-term key".

Model: opus-5-5

Rework: - `CreateVault` doc comment in `internal/vault/management.go`: the sentence now ends at "the vault has no long-term key". Model: opus-5-5
clawbot added needs-review and removed needs-rework labels 2026-10-15 00:55:08 +02:00
Author
Collaborator

Conflicts with the current next in internal/vault/management.go: the CreateVault doc comment, which next has since rewritten.

Model: opus-5-5

Conflicts with the current `next` in `internal/vault/management.go`: the `CreateVault` doc comment, which `next` has since rewritten. Model: opus-5-5
clawbot added needs-rebase and removed needs-review labels 2026-10-15 01:40:48 +02:00
clawbot force-pushed fix/139-remove-vault-import from 0d18c3d4b8 to 8beedb7407 2026-10-15 02:21:09 +02:00 Compare
Author
Collaborator

Rework:

  • Conflict with next in internal/vault/management.go: rebased onto the current next. The CreateVault doc comment takes the wording next now has and still ends the sentence about a vault made without a mnemonic at "the vault has no long-term key".

Model: opus-5-5

Rework: - Conflict with `next` in `internal/vault/management.go`: rebased onto the current `next`. The `CreateVault` doc comment takes the wording `next` now has and still ends the sentence about a vault made without a mnemonic at "the vault has no long-term key". Model: opus-5-5
clawbot added needs-review and removed needs-rebase labels 2026-10-15 02:21:15 +02:00
clawbot added 1 commit 2026-10-15 02:32:38 +02:00
Remove secret vault import (closes #139)
check / check (push) Waiting to run
406c4a327b
`secret vault import` took only a vault without a long-term key, and
`secret init` and `secret vault create` give every vault one, so it
always failed. A mnemonic enters through those two commands, so the
command goes, with its tests and its README entry. The help and the
note of `secret generate mnemonic` named `secret import`, which imports
a file as a secret; they now name `secret init` and
`secret vault create`.

`secret vault import` now prints the help of `secret vault` and exits
0, as cobra does for any subcommand of `secret vault` it does not know.

Judgement call: TestWorkflowMismatch in internal/vault, which replayed
the import step by step, is deleted.

Model: opus-5-5
clawbot force-pushed fix/139-remove-vault-import from 8beedb7407 to 406c4a327b 2026-10-15 02:32:38 +02:00 Compare
Author
Collaborator

Review passed.

Model: opus-5-5

Review passed. Model: opus-5-5
clawbot merged commit bfb13af302 into next 2026-10-15 03:14:56 +02:00
clawbot deleted branch fix/139-remove-vault-import 2026-10-15 03:14:56 +02:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/secret#174