Repository navigation
feat(cli): support API key files - #95
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: blocked before merge. What this changesAdds --api-key-file to load credentials directly from a text file, override inherited environment credentials, and reject explicit-key conflicts. Example: Run goplaces --api-key-file /private/places-key search coffee with synthetic-file-key in the file and GOOGLE_PLACES_API_KEY=synthetic-env-key.
Review scores
ProductKind: Feature · Worth it: Needs a maintainer decision · Fix scope: Complete Merge readiness⛔ Blocked before merge - 1 item remains Keep this PR open: file-based credential input is absent from main, and the new flag and precedence contract need an owner decision. The prior recovery-guidance finding is resolved; no actionable code defects remain. Priority: P2 Decision needed
Before merge
FindingsNone. Agent review detailsHow this fits togetherThe CLI parses credential inputs before constructing the shared Places and Routes client, which sends the selected key in HTTP request headers. flowchart LR
A[CLI arguments and environment] --> B[Global options parser]
C[Local key file] --> D[Credential selection]
B --> D
D --> E[Shared API client]
E --> F[Configured API endpoint]
Technical reviewBest possible solution: Retain the focused implementation if the CLI owner accepts the opt-in credential-file contract. Do we have a high-confidence way to reproduce the issue? The capability gap is established by main's parser definition and the supplied baseline binary rejecting the new flag; it is a feature request rather than broken existing behavior. Is this the best way to solve the issue? The implementation keeps credential selection in the existing CLI owner and reuses the shared client's transport and redaction behavior without adding dependencies or a credential framework. AGENTS.md: not found in the target repository. Codex review notes: model internal, reasoning medium; reviewed against 2a415c8e0b88. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (2 earlier review cycles)Reviewed October 24, 2026, 8:22 AM ET / 12:22 UTC (Revision 3). |
Built-binary offline behavior proof for
|
|
🦞👀 Re-review progress:
|
P3 recovery guidance fixed; fresh exact-head proofPushed New diagnostics:
Fresh validation on this head: full tests, vet, build and race tests PASS; coverage 92.5% total / 93.1% CLI (90% gate passed); gofmt and diff checks clean. The freshly built binary passes 14 head cases + 1 pinned-base case: five HTTP requests carry the expected synthetic credential header; all nine invalid/conflict cases exit 2 with zero requests/no fallback. Showboat replay PASS. This supersedes the diagnostics portion of the earlier proof, which remains valid evidence only for go -C ../goplaces-api-key-file-20261024 build -o ../goplaces-api-key-file-proof-20261024/goplaces-diagnostics ./cmd/goplaces
go version -m ./goplaces-diagnostics | grep -E '^./goplaces-diagnostics:|vcs.revision=|vcs.modified='go run diagnostics-proof.go ./goplaces-diagnostics ./goplaces-baseFresh captured terminal evidence: all 15 casesFresh full-test / vet / build / race / coverage output (durations normalized)Commands: As before: synthetic keys only, fresh CLI subprocess environments, a local HTTP stub checking Remaining product blocker: maintainer acceptance of the optional flag and precedence contract. No merge requested or performed. PR body links the new-head evidence. No active matching review was observed after the push; requesting one fresh review. @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
@steipete Could you confirm whether the opt-in |
Co-authored-by: Elfka Toruviel <aeb31988340aa87b@toruviel.online>
Summary
Closes #94. Add
--api-key-file PATHto read a private text file in-process without exporting its contents. An explicit file overridesGOOGLE_PLACES_API_KEY; an explicit--api-keyconflicts with it. Missing, unreadable, empty, nonregular, and group/other-accessible files fail without environment fallback or key disclosure.The opened file's permissions are checked, avoiding a pathname-only mode check. File input currently fails closed on Windows because POSIX mode bits cannot verify its ACL; existing env and flag input remain available. README and API key setup docs explain these boundaries and precedence.
Validation
govulncheckwith the repository-pinned scanner reports no vulnerabilities.Thanks @toruvieI for the API key file implementation and CLI coverage.