Route the application-passwords list screen through Basic auth#22892
Merged
jkmassel merged 0 commit intoMay 25, 2026
Merged
Conversation
Collaborator
Generated by 🚫 Danger |
b22543d to
2828efe
Compare
912dd2e to
a123523
Compare
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes a bug where the application-passwords list screen returned an empty list / auth error on Atomic sites.
Summary
wpApiClientProvider.getWpApiClient(site)→wpApiClientProvider.getApplicationPasswordClient(site)inApplicationPasswordsViewModel.kt.Root Cause
getWpApiClientroutes WPCom-flagged sites (including Atomic) through the WP.com REST proxy athttps://public-api.wordpress.com/rest/v1.1/sites/{id}/wp/v2/.... The proxy doesn't expose theapplication-passwordsroutes — every request 404s withrest_no_route. The same upstream wordpress-rs limitation (Automattic/wordpress-rs#1350) drove dropping the headless wordpress-rs mint attempt in #22885.Fix
getApplicationPasswordClient(site)always builds a direct-host Basic-auth client using the SiteModel'sapiRestUsernamePlain/apiRestPasswordPlain. The direct host serves theapplication-passwordsroutes on every WordPress install.Limitations
The SiteModel must already have credentials — typically populated by the My Site auto-mint flow on first foreground (introduced in #22885). A user reaching the list screen without ever visiting My Site would 401 instead of seeing the (already-empty) screen. Out of scope here; can be handled by minting on demand if it turns out to matter.
Test plan
Related
getApplicationPasswordClient).