Skip to content

Close #11, #38: merge history + remove plaintext CredentialService#41

Merged
matt-edmondson merged 2 commits into
mainfrom
claude/followup-issues-batch-2
May 11, 2026
Merged

Close #11, #38: merge history + remove plaintext CredentialService#41
matt-edmondson merged 2 commits into
mainfrom
claude/followup-issues-batch-2

Conversation

@matt-edmondson
Copy link
Copy Markdown
Contributor

Two issues + two audit comments posted on existing issues.

Summary

Caveats

  • ktsu.CredentialCache's default persistence provider still writes JSON to AppData — encryption is the provider author's responsibility. When a feature first needs credentials, the call site should plug in a DPAPI/Keychain/libsecret-backed IPersistenceProvider<string> via CredentialCache.ConfigurePersistenceProvider. I did not write that provider in this PR.
  • Local Linux env can't restore packages (pre-existing ktsu.AppDataStoragektsu.Semantics.Paths version pin plus missing host-runtime package on this distro). Relying on the windows-latest CI build to verify.

Test plan

  • CI green
  • MergeHistoryServiceTests — 4 tests (round trip, MaxEntries cap, idempotent clear, failed-run inclusion)
  • ktools merge ./repos *.yml followed by ktools merge-history shows the run with Exit = 0
  • ktools merge --batch nonexistent followed by ktools merge-history does not show the failed batch
  • ktools merge-history --clear then ktools merge-history shows "No merge runs recorded yet."

Closes #38, #11.


Generated by Claude Code

claude added 2 commits May 11, 2026 09:30
Closes #38. Adds MergeHistoryService persisting up to 50 recent merge
runs in AppData (timestamp, directory, filename, diff style, batch name
if any, exit code). The bound evicts the oldest on overflow. Direct
`ktsu merge` invocations record every run (success and failure both, as
the issue defaults to); batch-dispatched runs only record on success
since a failed batch usually signals a stale config rather than a useful
"what path did I try" entry. `ktsu merge-history` renders most-recent
first; `ktsu merge-history --clear` truncates idempotently.
…alCache

Closes #11 (acceptance bullet 2: "removed in favor of using
ktsu.CredentialCache directly from feature services").

The previous CredentialService persisted secrets as a
Dictionary<string,string> through AppDataStorage — readable by anyone
with FS access. No feature service consumed ICredentialService, so the
abstraction was unused dead weight covering a security footgun.

This commit:
- Deletes ICredentialService, CredentialService, and CredentialStore.
- Removes the DI registration.
- Adds ktsu.CredentialCache 1.2.3 to Directory.Packages.props and pulls
  it into KtsuTools.Core so feature code can use CredentialCache.Instance
  directly when needed.

Migration path for users with an existing plaintext store: delete and
re-prompt. The old %AppData%\ktsu\KtsuTools\Core\CredentialStore.json
file (if present) is no longer read; users will have to re-enter PATs
when the first feature that needs them lands.

Note: the package's default IPersistenceProvider<string> still writes
JSON to AppData (encryption is the persistence-provider author's
responsibility). When a feature actually needs credentials, the call
site can plug in a DPAPI/Keychain/libsecret-backed provider via
CredentialCache.ConfigurePersistenceProvider before first use.
@sonarqubecloud
Copy link
Copy Markdown

@matt-edmondson matt-edmondson merged commit 4573b7c into main May 11, 2026
5 checks passed
@matt-edmondson matt-edmondson deleted the claude/followup-issues-batch-2 branch May 11, 2026 09:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ktsu merge: persist command history

2 participants