Skip to content

Conversation

@crazytonyli
Copy link
Contributor

Note

This PR is built on top of #23715.

The main change in this PR is taken from #23572, which is opening up "Application Passwords" entry (and upcoming "Users") to all self-hosted sites, with a prompt (RestApiUpgradePrompt) for application password authentication if the site is not authenticated with application password.

Here is a walkthrough video:

Simulator.Screen.Recording.-.iPhone.16.-.2024-10-30.at.21.22.21.mp4

Regression Notes

  1. Potential unintended areas of impact

  2. What I did to test those areas of impact (or what existing automated tests I relied on)

  3. What automated tests I added (or what prevented me from doing so)

PR submission checklist:

  • I have completed the Regression Notes.
  • I have considered adding unit tests for my changes.
  • I have considered adding accessibility improvements for my changes.
  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

Testing checklist:

  • WordPress.com sites and self-hosted Jetpack sites.
  • Portrait and landscape orientations.
  • Light and dark modes.
  • Fonts: Larger, smaller and bold text.
  • High contrast.
  • VoiceOver.
  • Languages with large words or with letters/accents not frequently used in English.
  • Right-to-left languages. (Even if translation isn’t complete, formatting should still respect the right-to-left layout)
  • iPhone and iPad.
  • Multi-tasking: Split view and Slide over. (iPad)

@crazytonyli crazytonyli added this to the 25.6 milestone Oct 30, 2024
@crazytonyli crazytonyli requested review from jkmassel and kean October 30, 2024 08:25
@dangermattic
Copy link
Collaborator

dangermattic commented Oct 30, 2024

1 Warning
⚠️ This PR is assigned to the milestone 25.6. This milestone is due in less than 4 days.
Please make sure to get it merged by then or assign it to a milestone with a later deadline.

Generated by 🚫 Danger

@crazytonyli crazytonyli changed the title Add/rest api upgrade prompt Add prompt to authenticate with application passwords Oct 30, 2024

if #available(iOS 16.4, *) {
scrollView.scrollBounceBehavior(.basedOnSize, axes: [.vertical])
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jkmassel I didn't use the AccessibilityScrollView in your PR, because dynamic size seems working fine without it. Let me know if I missed anything.

Copy link
Contributor

Choose a reason for hiding this comment

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

Not a problem – we have a lot more room to work with here

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Oct 30, 2024

WordPress Alpha📲 You can test the changes from this Pull Request in WordPress Alpha by scanning the QR code below to install the corresponding build.
App NameWordPress Alpha WordPress Alpha
ConfigurationRelease-Alpha
Build Numberpr23726-97a28ad
Version25.4.2
Bundle IDorg.wordpress.alpha
Commit97a28ad
App Center BuildWPiOS - One-Offs #10977
Automatticians: You can use our internal self-serve MC tool to give yourself access to App Center if needed.

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Oct 30, 2024

Jetpack Alpha📲 You can test the changes from this Pull Request in Jetpack Alpha by scanning the QR code below to install the corresponding build.
App NameJetpack Alpha Jetpack Alpha
ConfigurationRelease-Alpha
Build Numberpr23726-97a28ad
Version25.4.2
Bundle IDcom.jetpack.alpha
Commit97a28ad
App Center Buildjetpack-installable-builds #10017
Automatticians: You can use our internal self-serve MC tool to give yourself access to App Center if needed.

}
}

#Preview {
Copy link
Contributor

Choose a reason for hiding this comment

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

Did you get it to work?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nope 🤦‍♂️

@MainActor
private func migrate() async {
guard let url = try? blog.getUrlString() else {
let error = NSLocalizedString("applicationPasswordMigration.error.siteUrlNotFound", value: "Cannot find the current site's url", comment: "Error message when the current site's url cannot be found")
Copy link
Contributor

Choose a reason for hiding this comment

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

(nit) Move to the bottom to Strings (applies to all other instances too)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Addressed in 53aaea9

}

static func description(localizedFeatureName: String) -> String {
let format = NSLocalizedString("applicationPasswordRequired.description", value: "Application passwords are a more secure way to connect to your self-hosted site, and enable support for features like %@.", comment: "Description for the prompt to upgrade to Application Passwords. The first argument is the name of the feature that requires Application Passwords.")
Copy link
Contributor

Choose a reason for hiding this comment

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

"are a more secure way" – as opposed to what? I'd probably leave it out as it raises questions about the alternative options. I don't think it's inherently more secure than cookies.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think that's compared to what the app currently uses to authenticate: xmlrpc.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yep that's right – it's way more secure than XMLRPC

"WordPressFlux",
"WordPressShared",
"WordPressUI",
"WordPressAppUI",
Copy link
Contributor

@kean kean Oct 30, 2024

Choose a reason for hiding this comment

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

I'd suggest adding a new auth-related module for these new screens like we had with WordPressAuthentificator as opposed to a broad "AppUI". For shared components, we already have WordPressUI.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed in ce8d2f8.

Base automatically changed from self-hosted-sites-user-management to trunk November 4, 2024 12:38
@crazytonyli crazytonyli force-pushed the add/rest-api-upgrade-prompt branch from ce8d2f8 to 97a28ad Compare November 4, 2024 20:58
@crazytonyli
Copy link
Contributor Author

⬆️ Rebased without code changes.

@crazytonyli crazytonyli requested a review from kean November 4, 2024 21:10
@crazytonyli crazytonyli added this pull request to the merge queue Nov 5, 2024
Merged via the queue into trunk with commit 9358451 Nov 5, 2024
25 checks passed
@crazytonyli crazytonyli deleted the add/rest-api-upgrade-prompt branch November 5, 2024 05:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants