fix(publish): prompt for OTP on registry challenge#767
Conversation
Greptile SummaryThis PR adds OTP (one-time password) challenge handling to
Confidence Score: 5/5Safe to merge; the retry is bounded to a single attempt and only fires when the registry explicitly signals an OTP requirement with no --otp already supplied. The refactor is clean and well-tested with seven targeted unit tests covering both positive and negative OTP detection cases. The existing --otp flow is unchanged. No files require special attention. Important Files Changed
Reviews (4): Last reviewed commit: "fix(publish): prompt for OTP on registry..." | Re-trigger Greptile |
026f377 to
ee831fb
Compare
65b5b85 to
6ddf592
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 6ddf592. Configure here.
6ddf592 to
e90fab7
Compare
e90fab7 to
e327d22
Compare

Summary
--otpwas not provided--otp <CODE>hint in non-interactive runsAddresses https://github.com/endevco/aube/discussions/345#discussioncomment-17049217.
Validation
cargo fmt --checkgit diff --checkcargo test -p aube commands::publish::testscargo buildThis PR was generated by Codex.
Note
Medium Risk
Changes publish authentication flow and registry PUT retry behavior; mistakes in OTP detection could prompt incorrectly or skip needed 2FA, though scope is limited to the publish command.
Overview
Publish now treats registry 401/403 responses that look like an OTP/2FA challenge as recoverable when
--otpwas not passed: the PUT is retried once after collecting a code (masked interactive prompt viademand, or a clear--otp <CODE>error when stdin/stderr are not a TTY).The one-shot PUT path is factored into
send_publish_putreturning structuredPublishHttpFailure, withpublish_failure_needs_otpparsing common npm messages (EOTP, missingnpm-otp, “two-factor … required”, etc.) so plain bad-token failures are not mistaken for OTP prompts. Unit tests cover those detection cases.Reviewed by Cursor Bugbot for commit e327d22. Bugbot is set up for automated code reviews on this repo. Configure here.