Skip to content

feat(cli): sign in with an app password for unattended sync - #279

Merged
BryanFRD merged 3 commits into
mainfrom
feat/app-password-clients
Oct 6, 2026
Merged

BryanFRD merged 3 commits into
mainfrom
feat/app-password-clients

Conversation

@BryanFRD

@BryanFRD BryanFRD commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Second layer of #261: the client and the CLI sign in with an app password.

  • Remote::with_app_password authenticates every request with Basic auth instead of a Bearer token. mint_app_password and revoke_app_password wrap the existing routes.
  • The CLI reads STASHDEN_EMAIL and STASHDEN_APP_PASSWORD (or --email / --app-password) and prefers them over STASHDEN_TOKEN.
  • stashden login <email> --create-app-password <name> mints one and prints the two variables to keep, for a sync --watch that runs unattended.

End-to-end tests in api/tests/client.rs run the client against the real API: an app-password client lists and uploads, cannot mint another one, and is signed out once revoked.

Refs #261

@BryanFRD
BryanFRD added this pull request to stack #281 October 6, 2026 06:42

@ferrfleet ferrfleet Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The auth plumbing is correct. Caller on the base branch accepts Basic app-password credentials, SessionCaller returns 403 for them, and the three new tests match that behaviour. The Authorize swap covers every request site.

One blocking finding: the minted app password response is redefined in the client instead of being shared through stashden_core. One nit on an export that has no use yet.

Comment thread crates/client/src/remote.rs Outdated
Comment thread crates/client/src/lib.rs Outdated
@BryanFRD
BryanFRD force-pushed the feat/app-password-clients branch from e568ca0 to dcc59ac Compare October 6, 2026 06:58

@ferrfleet ferrfleet Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dcc59ac has the same diff as e568ca0 and looks like a rebase. The blocking thread on crates/client/src/remote.rs (move MintedAppPassword into stashden_core and redact secret in Debug) is still open. Nothing new to report.

@BryanFRD
BryanFRD marked this pull request as ready for review October 6, 2026 11:01

@ferrfleet ferrfleet Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0626f4d drops Credential from the re-exports, which settles the nit. The blocking thread on crates/client/src/remote.rs is still open: MintedAppPassword is still defined in the client, not shared from stashden_core, and its derived Debug still prints secret. Nothing new in this push.

Base automatically changed from feat/app-password-auth to main October 6, 2026 11:16
@BryanFRD
BryanFRD force-pushed the feat/app-password-clients branch from 0626f4d to f769eb6 Compare October 6, 2026 11:16

@ferrfleet ferrfleet Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

f769eb6 re-applies the lib.rs export change already reviewed in 0626f4d; no other code changed. The blocking thread on crates/client/src/remote.rs is still open: MintedAppPassword is still defined in the client rather than shared from stashden_core, and its derived Debug still prints secret.

@ferrfleet ferrfleet Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

78aa97e moves the minted app password type into stashden_core::app_password, matching how share::Minted is set up (postgres-gated FromRow, Debug with the secret redacted, wire-shape test). The blocking thread is resolved and no findings remain.

BryanFRD and others added 3 commits October 6, 2026 13:41
Signed-off-by: BryanFRD <bryanferrando59@gmail.com>
Co-authored-by: ferrfleet[bot] <307549260+ferrfleet[bot]@users.noreply.github.com>
Signed-off-by: BryanFRD <bryanferrando59@gmail.com>
…d the client

Signed-off-by: BryanFRD <bryanferrando59@gmail.com>
@BryanFRD
BryanFRD force-pushed the feat/app-password-clients branch from 78aa97e to aae9618 Compare October 6, 2026 11:41
@BryanFRD
BryanFRD merged commit 2636616 into main Oct 6, 2026
9 checks passed
@BryanFRD
BryanFRD deleted the feat/app-password-clients branch October 6, 2026 11:52
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.

1 participant