Warn before self-hosted sign-in over an insecure connection - #25870
Draft
crazytonyli wants to merge 3 commits into
Draft
Warn before self-hosted sign-in over an insecure connection#25870crazytonyli wants to merge 3 commits into
crazytonyli wants to merge 3 commits into
Conversation
Present a confirmation alert at the top of the authenticate choke point when any pre-authorization credential destination (the site URL, REST API root, or application-password authorization URL) uses non-loopback http. Cancel reuses the existing SignInError.cancelled, and the debug launch-argument path never reaches this gate. The alert is presented from the topmost controller because the sign-in entry points already present the SwiftUI login flow. When the pre-authorization flow was fully secure, coerce an unexpectedly-http callback site URL to https, and skip the sign-in-time XML-RPC options fetch if discovery resolves an insecure endpoint, so a site that proved secure end-to-end never has its credentials sent over an unencrypted connection.
ApplicationPasswordRepository must never transmit credentials to a non-loopback http destination on its own. createPasswordIfNeeded now throws a new insecureConnection error before any network activity when any statically-known credential destination is insecure: the site URL, the stored REST API root, the xmlrpc-derived wp-json base, login_url, or admin_url, each of which can use http independently of the others. The REST API root resolved by discovery is validated before it is persisted, so an insecure value is never written to Blog.restApiRootURL where other consumers could later send credentials to it. Getting an application password for such a site goes through the interactive sign-in flow, which shows the insecure-connection warning; the existing repository callers already catch the error and degrade gracefully.
Collaborator
Generated by 🚫 Danger |
Contributor
|
| App Name | WordPress | |
| Configuration | Release-Alpha | |
| Build Number | 33620 | |
| Version | PR #25870 | |
| Bundle ID | org.wordpress.alpha | |
| Commit | 85ddadc | |
| Installation URL | 1kv3jsldkcua8 |
Contributor
|
| App Name | Jetpack | |
| Configuration | Release-Alpha | |
| Build Number | 33620 | |
| Version | PR #25870 | |
| Bundle ID | com.jetpack.alpha | |
| Commit | 85ddadc | |
| Installation URL | 6o22d5iht2f7g |
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.


Note
This PR will be merged after #25869.