Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Authenticate private resource requests #21331

Open
wants to merge 17 commits into
base: trunk
Choose a base branch
from

Conversation

dcalhoun
Copy link
Member

@dcalhoun dcalhoun commented Oct 23, 2024

Related

Description

Authenticate resource requests originating from within the WebView so that
requests to private sites succeed.

To Test:

See wordpress-mobile/GutenbergKit#34.

Regression Notes

  1. Potential unintended areas of impact
    Gutenberg Mobile or Aztec editors fail.
  2. What I did to test those areas of impact (or what existing automated tests I relied on)
    Manually tested both editors.
  3. What automated tests I added (or what prevented me from doing so)
    None, feels unnecessary for this currently experimental editor feature.

PR Submission Checklist:

  • I have completed the Regression Notes.
  • 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 (strike-out the not-applying and unnecessary ones):

  • WordPress.com sites and self-hosted Jetpack sites.
  • Portrait and landscape orientations.
  • Light and dark modes.
  • Fonts: Larger, smaller and bold text.
  • High contrast.
  • Talkback.
  • 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)
  • Large and small screen sizes. (Tablet and smaller phones)
  • Multi-tasking: Split screen and Pop-up view. (Android 10 or higher)

Unauthenticated requests failed when attempting to load resources from a
private site, e.g., an image.
@dcalhoun dcalhoun added [Type] Bug Gutenberg Editing and display of Gutenberg blocks. labels Oct 23, 2024
@dangermattic
Copy link
Collaborator

dangermattic commented Oct 23, 2024

1 Warning
⚠️ PR is not assigned to a milestone.

Generated by 🚫 Danger

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Oct 23, 2024

Project dependencies changes

The following changes in project dependencies were detected (configuration wordpressVanillaReleaseRuntimeClasspath):

list
Upgraded Dependencies
org.wordpress.gutenbergkit:android:trunk-d6fbfc7bc28ae6db2cce09950f24bc3080374596, (changed from trunk-a58a46f3fbb892f311b562e3c122d7ef4ebbfe33)
tree
 +--- project :libs:editor
-|    \--- org.wordpress.gutenbergkit:android:trunk-a58a46f3fbb892f311b562e3c122d7ef4ebbfe33
+|    \--- org.wordpress.gutenbergkit:android:trunk-d6fbfc7bc28ae6db2cce09950f24bc3080374596
-\--- org.wordpress.gutenbergkit:android:trunk-a58a46f3fbb892f311b562e3c122d7ef4ebbfe33 (*)
+\--- org.wordpress.gutenbergkit:android:trunk-d6fbfc7bc28ae6db2cce09950f24bc3080374596 (*)

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Oct 23, 2024

WordPress📲 You can test the changes from this Pull Request in WordPress by scanning the QR code below to install the corresponding build.
App NameWordPress WordPress
FlavorJalapeno
Build TypeDebug
Versionpr21331-172e55e
Commit172e55e
Direct Downloadwordpress-prototype-build-pr21331-172e55e.apk
Note: Google Login is not supported on these builds.

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Oct 23, 2024

Jetpack📲 You can test the changes from this Pull Request in Jetpack by scanning the QR code below to install the corresponding build.
App NameJetpack Jetpack
FlavorJalapeno
Build TypeDebug
Versionpr21331-172e55e
Commit172e55e
Direct Downloadjetpack-prototype-build-pr21331-172e55e.apk
Note: Google Login is not supported on these builds.

This was added to mirror the `shouldInterceptRequest` method signature,
but is unnecessary complexity.

String proxyUrl = url.toString();
if (mIsPrivateAtomic) {
proxyUrl = getPrivateResourceProxyUrl(url);
Copy link
Member Author

Choose a reason for hiding this comment

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

Private Atomic sites require a proxy for request authentication (D38925-code).

@dcalhoun dcalhoun marked this pull request as ready for review October 30, 2024 16:08
Likely better performance and accuracy.
… into feat/authenticate-private-resource-requests
Copy link

sonarcloud bot commented Nov 1, 2024

@dcalhoun
Copy link
Member Author

dcalhoun commented Nov 1, 2024

👋🏻 @jkmassel. I updated this with the merged wordpress-mobile/GutenbergKit#30 and the latest from trunk. I re-tested and it appears to be functioning as expected. Whenever you have time, we can look to review and merge this feature. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Gutenberg Editing and display of Gutenberg blocks. [Type] Bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants