Add --apikey-file for trash and update all dependencies - #15
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@## develop #15 +/- ##
===========================================
+ Coverage 44.39% 44.96% +0.56%
===========================================
Files 25 25 Lines 3347 3398 +51 Branches 253 259 +6 ===========================================
+ Hits 1486 1528 +42 - Misses 1819 1824 +5 - Partials 42 46 +4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR updates PhotoCleaner’s dependencies (including pinning the native SQLite bundle to address NU1903/GHSA-2m69-gcr7-jv3q warnings) and adds a safer alternative for supplying the Immich API key to the trash command via --apikey-file.
Changes:
- Add
trash --apikey-filesupport (mutually exclusive with--apikey) plus CLI validation and tests. - Update NuGet dependencies across app/tests/benchmarks, and pin
SQLitePCLRaw.bundle_e_sqlite3to a non-vulnerable version. - Update documentation/examples (
README.md,.github/copilot-instructions.md, VS Code launch config) and ignore localsecrets/.
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| README.md | Documents --apikey-file usage and updates trash help/examples. |
| PhotoCleaner/CommandLine.cs | Adds --apikey-file option, validators, and API key resolution helpers. |
| PhotoCleaner/TrashCommand.cs | Updates runtime error message to include --apikey-file. |
| PhotoCleaner/PhotoCleaner.csproj | Updates package versions and pins SQLitePCLRaw.bundle_e_sqlite3. |
| PhotoCleanerBenchmarks/PhotoCleanerBenchmarks.csproj | Updates CliWrap version used by benchmarks. |
| PhotoCleanerTests/PhotoCleanerTests.csproj | Updates test dependencies and pins SQLitePCLRaw.bundle_e_sqlite3. |
| PhotoCleanerTests/CommandLineTests.cs | Adds parsing/validation and key-resolution tests for --apikey-file. |
| .github/copilot-instructions.md | Updates repo instructions/docs for the new API-key input mode. |
| .vscode/launch.json | Switches example config to use --apikey-file. |
| .gitignore | Adds secrets/ and reorganizes ignore entries. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
* Add --apikey-file for trash and update all dependencies Dependencies: - Update all NuGet packages to current versions (Microsoft.Data.Sqlite 10.0.10, System.CommandLine 2.0.10, ptr727.Utilities 4.0.28, Serilog 4.4.0, CliWrap 3.10.2, and test tooling). - Pin SQLitePCLRaw.bundle_e_sqlite3 to 3.0.4 in the app and test projects to override the vulnerable transitive 2.1.11 (GHSA-2m69-gcr7-jv3q). Feature (--apikey-file): - The trash command now accepts the Immich API key via either --apikey (inline) or --apikey-file (path); the two are mutually exclusive and exactly one is required. - --apikey-file must reference an existing, non-empty file; its trimmed contents become the key, resolved at parse time by ResolveApiKey / ReadApiKeyFile. - Add secrets/ to .gitignore and a launch.json example. - Add 8 tests and update README and copilot-instructions docs. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * Handle unreadable API key file as validation error, fix docs - ReadApiKeyFile now catches IOException/UnauthorizedAccessException and returns null, so an unreadable key file produces a validation error instead of an unhandled exception during parsing. - Fix copilot-instructions.md to match the implementation (option validator, not AcceptExistingOnly). - Add ReadApiKeyFile_UnreadableFile_ReturnsNull test (Unix, non-root). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Summary
Microsoft.Data.Sqlite9.0.4 -> 10.0.10,System.CommandLine2.0.5 -> 2.0.10,ptr727.Utilities4.0.7 -> 4.0.28,Serilog4.3.1 -> 4.4.0,CliWrap-> 3.10.2,Microsoft.Extensions.Logging.Abstractions-> 10.0.10, plus test tooling (AwesomeAssertions9.5.0,Microsoft.NET.Test.Sdk18.8.1,coverlet.collector10.0.1).Microsoft.Data.Sqlite10.0.10 still resolves the vulnerable transitiveSQLitePCLRaw.lib.e_sqlite32.1.11. PinnedSQLitePCLRaw.bundle_e_sqlite3to 3.0.4 in the app and test projects, which clears all NU1903 warnings.--apikey-file: thetrashcommand now accepts the Immich API key via either--apikey(inline) or--apikey-file(path). The two options are mutually exclusive and exactly one is required;--apikey-filemust reference an existing, non-empty file, whose trimmed contents become the key (resolved at parse time byResolveApiKey/ReadApiKeyFile). This keeps the secret out of shell history and process arguments, following the commonFOOvsFOO_FILEconvention.Details
secrets/added to.gitignore;.vscode/launch.jsonupdated with an--apikey-fileexample.README.mdand.github/copilot-instructions.md.Testing
CommandLineTests.cs(file variant parses, non-existent file, both-specified, empty file, and key-resolution unit tests).dotnet format style --verify-no-changes, build (0 errors; only 2 pre-existing benchmark warnings),dotnet test(323/323 pass), anddotnet husky run.🤖 Generated with Claude Code