Skip to content

passwordmask=, safe CSV handling, settings checks, README that matches the code - #5

Merged
edwest19 merged 1 commit into
mainfrom
feature/passwordmask-validation-readme
Nov 5, 2026
Merged

edwest19 merged 1 commit into
mainfrom
feature/passwordmask-validation-readme

Conversation

@edwest19

@edwest19 edwest19 commented Nov 5, 2026

Copy link
Copy Markdown
Owner

What this does

Makes the README true. Every gap listed in CLAUDE.md is fixed, and tests now check the README's facts against the code.

New and fixed behavior

Before Now
passwordmask= in Notes Documented, but ignored Works. That account gets its own mask. An invalid one stops the run, naming the line and account.
Columns First three read by position Found by name, in any order and letter case. Title, Url, Username are required.
Multi-line notes Split apart, and the input file was corrupted Read and kept correctly
Old passwords in the input Whole file rewritten every run Cleared only if present. Every other value is kept, and it's written via a temporary file.
Bad settings Blank mask gave empty passwords; Password1! gave the same password everywhere; 2613 accepted Rejected with a clear message before anything is written
Errors Missing input file silently did nothing Every problem gets a message; the CLI exits with code 1
config.json in git Not ignored Ignored, since it holds your root key

Rules (also in the README):

  • Masks: at most 64 characters, at least 4 of X/x/N/S. Other visible symbols like - or _ are copied as-is.
  • Date code: 4 digits, YYMM, month 01–12.
  • Root key: exactly 64 hex characters.

Shared code for both apps

The desktop app and the command-line app now use the same config.json loading, the same checks and the same run code (Processor.Run).

  • Desktop app: shows "Done: N passwords written…". I also removed a leftover check for a secretkey.exe it never used, and its reference to the command-line project.
  • Command-line app: has usage help and never prints any part of the root key. It used to show the first two characters.

Documentation

  • README rewritten to match the code, including an honest Security section: the date code is just a month, so config.json is the real secret.
  • ReadmeClaimsTests fails if the README's facts drift from the code: symbol set, limits, column names, settings, default mask, and the spec's character table.
  • CLAUDE.md maps each README section to its code and tests. Known gaps: none.

Passwords

All existing passwords are unchanged. The one intended change is the sample's Solterra row, which now honors its passwordmask=xxxxxxxxNNNN note: ydnvoivn3947, cross-checked with the separate implementation.

How it was checked

  • 103 tests pass with a local stand-in runner. The test check below is the real MSTest run.
  • Seven deliberate breaks were each caught by the tests: ignoring passwordmask=, allowing 3-character masks, trimming CSV fields, rewriting the input needlessly, case-sensitive headers, accepting month 13, and writing output before checks finish. Changing a fact in the README was caught too.
  • The command-line app was run end to end on the sample: 4 passwords, 1 with its own mask, multi-line notes kept.
  • The desktop app can't be built where this was written, so the build check below is its first compile. After merging, please run the desktop app once:
    1. Pick a folder.
    2. Generate a key.
    3. Save.
    4. Run with the sample file.

Generated by Claude Code

…s the code

Engine (SecretKey.Core):
- Csv.cs: RFC 4180 reader/writer; quoted and multi-line fields, line
  numbers in errors.
- Processor: columns found by header name (any order or case); Title,
  Url, Username required; Notes and Password optional.
- passwordmask= in Notes sets a per-account mask; an invalid one stops
  the run naming the line and account.
- Every check runs before anything is written.
- Old passwords are cleared from the input only if present, keeping
  all other values; written via a temp file and swap.
- Validation.cs: root key (64 hex), date code (YYMM, month 01-12),
  masks (<= 64 chars, >= 4 of X/x/N/S, visible ASCII only).
- SecretKeyConfig.cs + Processor.Run: one config/run path shared by
  both apps; relative paths resolve against the config folder;
  OutputPath must differ from InputPath.

Apps:
- CLI: usage text, exit codes, summary; never prints any part of the
  root key.
- UI: uses the shared checks and Processor.Run, shows a summary, and
  drops the unused secretkey.exe lookup and console-app reference.

Docs and repo:
- README rewritten to match the code; ReadmeClaimsTests checks its
  facts against the code; CLAUDE.md maps each README section to code
  and tests (no known gaps).
- .gitignore now excludes config.json (it holds the root key).

Passwords for existing accounts are unchanged, except that sample
Solterra now uses its passwordmask= note as the README describes.
103 tests; each new behavior was shown to fail its tests when broken.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QSQZn3X5gDJdRjbqMfKRpd
@edwest19
edwest19 merged commit 45aea04 into main Nov 5, 2026
2 checks passed
@edwest19
edwest19 deleted the feature/passwordmask-validation-readme branch November 6, 2026 03:16
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.

2 participants