-
Notifications
You must be signed in to change notification settings - Fork 1.3k
feat: Authenticate private resource requests #21331
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
base: trunk
Are you sure you want to change the base?
Conversation
Generated by 🚫 Danger |
Project dependencies changesThe following changes in project dependencies were detected (configuration list
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 (*) |
|
App Name | ![]() |
|
Flavor | Jalapeno | |
Build Type | Debug | |
Version | pr21331-c8374f9 | |
Commit | c8374f9 | |
Direct Download | wordpress-prototype-build-pr21331-c8374f9.apk |
|
App Name | ![]() |
|
Flavor | Jalapeno | |
Build Type | Debug | |
Version | pr21331-c8374f9 | |
Commit | c8374f9 | |
Direct Download | jetpack-prototype-build-pr21331-c8374f9.apk |
libs/editor/src/main/java/org/wordpress/android/editor/gutenberg/GutenbergEditorFragment.java
Fixed
Show fixed
Hide fixed
|
||
String proxyUrl = url.toString(); | ||
if (mIsPrivateAtomic) { | ||
proxyUrl = getPrivateResourceProxyUrl(url); |
There was a problem hiding this comment.
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).
libs/editor/src/main/java/org/wordpress/android/editor/gutenberg/GutenbergEditorFragment.java
Outdated
Show resolved
Hide resolved
libs/editor/src/main/java/org/wordpress/android/editor/gutenberg/GutenbergEditorFragment.java
Fixed
Show fixed
Hide fixed
Address lint error regarding a common source of bugs. #21331 (review)
|
👋🏻 @jkmassel. I updated this with the merged wordpress-mobile/GutenbergKit#30 and the latest from |
Ideally, it is merged. However, @jkmassel mentioned privately he would prefer avoiding a proxy URL. Transparently, I was unsure as to how we might accomplish that, so I have not moved this forward. @jkmassel do you have specific ideas for avoiding the proxy URL? |
172e55e
to
fc246b1
Compare
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## trunk #21331 +/- ##
=======================================
Coverage 39.67% 39.67%
=======================================
Files 2123 2123
Lines 99095 99095
Branches 15213 15213
=======================================
Hits 39316 39316
Misses 56318 56318
Partials 3461 3461 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Unauthenticated requests fail when attempting to load resources from a private site--e.g., an image.
Avoid NullPointerExceptions.
fc246b1
to
7474914
Compare
Lint configuration warned the `createGutenbergKitEditorFragment` function was over 60 lines.
We should authenticate requests for these common media types.
|
Related
Description
Authenticate resource requests originating from within the WebView so that
requests to private sites succeed. Ref CMM-235.
To Test:
Important
The proposed logic does not work for streamed files (e.g., video and audio). It appears
shouldInterceptRequest
injects aContent-Length: 0
header, which creates duplicate values creating a malformed request that disables streaming.See wordpress-mobile/GutenbergKit#34.
Regression Notes
Gutenberg Mobile or Aztec editors fail.
Manually tested both editors.
None, feels unnecessary for this currently experimental editor feature.
PR Submission Checklist:
RELEASE-NOTES.txt
if necessary.Testing Checklist (strike-out the not-applying and unnecessary ones):