fn build_auth_for_edit(
password: Option<String>,
emails: Option<&str>,
) -> Result<AuthEdit>Expand description
Build the auth field for a SendEditRequest.
Edit semantics differ from create:
(None, None)returnsAuthEdit::Preserve, telling the SDK to keep the existing auth. The SDK reads the wire-formatpasswordhash andemailsstring off the repository row and forwards them verbatim, so a partial edit (e.g. just changing--deleteInDays) never silently strips a previously configured password or email-OTP gate. This is the fix for the auth-strip bug — the previous code emittedSendAuthType::Nonehere, which the server treats as an overwrite.(Some(p), None)/(None, Some(e))returnAuthEdit::Set { auth: _ }to overwrite to Password / Email auth.(Some(_), Some(_))is rejected (mutually exclusive).
Note: passing --password "" is not how callers strip auth on edit. To remove a
previously configured password, use bw send remove-password (the legacy CLI’s
dedicated subcommand), or pass AuthEdit::Set { auth: SendAuthType::None } at the
SDK boundary.