Extract AuthClient and associated logic to the warp_server_client crate.#11977
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
ba90a52 to
4330f49
Compare
ba41325 to
3134fc6
Compare
3134fc6 to
0436dad
Compare
| }) | ||
| } | ||
|
|
||
| async fn list_agent_identities(&self) -> Result<Vec<AgentIdentity>> { |
There was a problem hiding this comment.
this is temporarily awkwardly here until we push get_public_api() down into BaseClient (such that AuthClientImpl can call it).
|
I'm starting a first review of this pull request. You can view the conversation on Warp. I completed the review and no human review was requested for this pull request. Comment Powered by Oz |
There was a problem hiding this comment.
Overview
This PR extracts authentication client/session logic into warp_server_client and updates app callers to use the new AuthClient, AuthSession, BaseClient, and AuthEvent boundaries. The moved GraphQL helper behavior, auth event forwarding, API-key flows, privacy-settings updates, and session token refresh paths appear to preserve the previous app behavior.
Concerns
- No blocking correctness, security, or spec-drift concerns found in the annotated diff.
Verdict
Found: 0 critical, 0 important, 0 suggestions
Approve
Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).
Powered by Oz

Description
This PR is the authentication slice of a broader effort to move server API client traits and implementations out of the
warpapplication crate and intowarp_server_client. It completes the intended extraction ofAuthClientand reusable authentication-session behavior for this phase: shared server clients can now consume auth functionality without depending on app-ownedServerApiimplementation details, while UI/model reactions and app-specific conversions remain inwarp.This PR is stacked on #11976 (
david/get-rid-of-unneeded-datetime-ext). It intentionally changes ownership rather than behavior; extraction of non-auth server clients is left to future PRs.Architectural decisions
warp_server_client::authnow ownsAuthClient, its implementation, and the reusable authentication-session mechanics used by server clients.AuthSessionrepresents the stateful mechanics of authenticating requests: exchanging login credentials, fetching or refreshing Firebase tokens (including proxy fallback), completing OAuth device authorization, and producing usable access tokens. It owns mechanics, not product reactions.AuthEventis the lower-crate event vocabulary for authentication and authenticated-transport conditions observed while making requests. The app continues to decide what those events mean for models/UI, such as setting reauth state, rotating remote-server tokens, showing staging access feedback, logging out disabled users, or responding to IAP challenges.AuthClientImplis constructed directly byServerApiProvideraround the shared app transport adapter andAuthSession; the app no longer implements a forwardingAuthClientwrapper.BaseClientsupplies the app-owned transport/platform capabilities still required by the extracted client (HTTP setup, GraphQL request options, ambient workload token behavior, and notification hooks), rather than owning token/OAuth lifecycle operations.UserPropertiesconversion remains inwarpbecause it maps protocol user output into app models, server experiment state, and app LLM preferences rather than describing reusable server authentication behavior.warp_server_client, so authentication rejection/event behavior is tested at the owning layer.skip_loginbuild-time behavior is forwarded intowarp_server_clientbecause authenticated-request rejection is now implemented byAuthSession.Reviewer notes
ServerApimethods intentionally remain app-owned for later work.AuthSession, preserving the existing initialization invariant while allowing the extracted session to reuse that client.Linked Issue
N/A — internal refactor in a stacked extraction series.
Testing
./script/formatcargo check -p warp_server_client -p warp --testscargo nextest run -p warp_server_client --no-tests=passcargo nextest run -p warp -E 'test(/auth_manager|server_api::auth|server_api::ai|settings::privacy|settings_view::platform|terminal::shared_session::viewer/)' --no-tests=passcargo nextest run -p warp --features skip_login -E 'test(access_token_skip_login_rejects_bearer_token)' --no-tests=passcargo nextest run --no-fail-fast --workspace --exclude command-signatures-v2cargo clippy --workspace --exclude warp_completer --all-targets --tests -- -D warningsPATH="$(brew --prefix llvm)/bin:$PATH" cargo clippy --locked --target wasm32-unknown-unknown --profile release-wasm-debug_assertions -- -D warnings -A clippy::large_digit_groupsgit --no-pager diff --checkI have manually tested my changes locally with
./script/runAgent Mode
CHANGELOG-NONE
Co-Authored-By: Oz oz-agent@warp.dev