-
Notifications
You must be signed in to change notification settings - Fork 473
FxA webchannel support and account manager integration #4221
Conversation
9d13484
to
140b251
Compare
components/service/firefox-accounts/src/main/java/mozilla/components/service/fxa/Utils.kt
Outdated
Show resolved
Hide resolved
Codecov Report
@@ Coverage Diff @@
## master #4221 +/- ##
============================================
+ Coverage 81.14% 82.42% +1.28%
+ Complexity 3981 3835 -146
============================================
Files 514 495 -19
Lines 17399 16328 -1071
Branches 2577 2412 -165
============================================
- Hits 14118 13459 -659
+ Misses 2215 1854 -361
+ Partials 1066 1015 -51 Continue to review full report at Codecov.
|
01ff631
to
b5e8c43
Compare
c132a96
to
34ac69e
Compare
Fenix side of this: mozilla-mobile/fenix#4931 (note that fxa functionality is currently running on a dev box 2). |
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.
Looks great! Thanks for adding so many tests and comments. I've had a few comments and two small things to change (just naming), but otherwise I think this is ready.
components/service/firefox-accounts/src/main/java/mozilla/components/service/fxa/Utils.kt
Outdated
Show resolved
Hide resolved
components/concept/sync/src/main/java/mozilla/components/concept/sync/OAuthAccount.kt
Show resolved
Hide resolved
components/feature/accounts/src/main/assets/extensions/fxawebchannel/fxawebchannel.js
Show resolved
Hide resolved
...ents/feature/accounts/src/main/java/mozilla/components/feature/accounts/WebChannelFeature.kt
Outdated
Show resolved
Hide resolved
* @param engine a reference to the application's browser engine. | ||
*/ | ||
fun install(engine: Engine) { | ||
engine.installWebExtension(WEB_CHANNEL_EXTENSION_ID, WEB_CHANNEL_EXTENSION_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.
This had to bring in a lot of code from the reader view feature. I've filed #4297 to address the code duplication and come up with an abstraction.
34ac69e
to
adf4c28
Compare
@csadilek addressed your feedback. |
reference-browser PR: mozilla-mobile/reference-browser#895 |
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.
Looks good!
We've also just started upgrading Fenix to 12.0.0, so we need to update the PR there as well and orchestrate the merge.
Preparatory work for allowing users to choose what to sync. We are about to tie SyncConfig with FxA's "capabilities" webchannel API, which takes a set of "engines" as strings. To simplify our integration work, this patch replaces an untyped set of "stores" with a typed set of "engines" at the API level.
This patch does a few things: - adds a webextension for communicating with fxa web content - provides a backend for said webextension, which understands webchannel communication protocol and knows how to relay messages to the account manager, and query its state - expands account manager a bit to support the webchannel authentication protocol - adds a (rather detailed!) AuthType parameter to AccountObserver:onAuthenticated, instead of the very vague 'newAccount' flag Co-authored-by: Arturo Mejia <arturomejiamarmol@gmail.com> Co-authored-by: vladikoff <vlad.filippov@gmail.com>
adf4c28
to
f186993
Compare
bors r=csadilek |
4221: FxA webchannel support and account manager integration r=csadilek a=grigoryk ## Part 1: Preparatory work for allowing users to choose what to sync. We are about to tie SyncConfig with FxA's "capabilities" webchannel API, which takes a set of "engines" as strings. To simplify our integration work, this patch replaces an untyped set of "stores" with a typed set of "engines" at the API level. ## Part 2: (should have been split up further for easier reviewing, but things got a bit tangled) This patch does a few things: - adds a webextension for communicating with fxa web content - provides a backend for said webextension, which understands webchannel communication protocol and knows how to relay messages to the account manager, and query its state - expands account manager a bit to support the webchannel authentication protocol - adds a (rather detailed!) AuthType parameter to AccountObserver:onAuthenticated, instead of the very vague 'newAccount' flag - Closes #4238 Co-authored-by: Grisha Kruglov <gkruglov@mozilla.com>
"version": "1.0", | ||
"content_scripts": [ | ||
{ | ||
"matches": ["https://acounts.firefox.com/*"], |
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.
this is missing lcip domains, we should probably include them still
* loaded ------> | fxa web content loaded | ||
* fxa-status ------> | web content requests account status & device capabilities | ||
* | <------ fxa-status-response this class responds, based on state of [accountManager] | ||
* can-link-account ------> | user submitted credentials, web content verifying if account linking is allowed |
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.
can link account should ago away?
* @property accountManager a reference to application's [FxaAccountManager]. | ||
*/ | ||
@Suppress("TooManyFunctions") | ||
class FxaWebChannelFeature( |
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.
the other class is called Firefox Accounts Auth Feature
, this one just says Fxa....
, does that matter?
Build succeeded |
4375: Proper 'matches' permission for webchannel extension manifest r=vladikoff a=grigoryk FxA URL was mistyped in #4221 :( ### After merge - [ ] **Milestone**: Make sure issues closed by this pull request are added to the [milestone](https://github.com/mozilla-mobile/android-components/milestones) of the version currently in development. - [ ] **Breaking Changes**: If this is a breaking change, please push a draft PR on [Reference Browser](https://github.com/mozilla-mobile/reference-browser) to address the breaking issues. Co-authored-by: Grisha Kruglov <gkruglov@mozilla.com>
4375: Proper 'matches' permission for webchannel extension manifest r=jonalmeida a=grigoryk FxA URL was mistyped in #4221 :( ### After merge - [ ] **Milestone**: Make sure issues closed by this pull request are added to the [milestone](https://github.com/mozilla-mobile/android-components/milestones) of the version currently in development. - [ ] **Breaking Changes**: If this is a breaking change, please push a draft PR on [Reference Browser](https://github.com/mozilla-mobile/reference-browser) to address the breaking issues. Co-authored-by: Grisha Kruglov <gkruglov@mozilla.com>
Part 1:
Preparatory work for allowing users to choose what to sync. We are about to
tie SyncConfig with FxA's "capabilities" webchannel API, which takes a set of
"engines" as strings. To simplify our integration work, this patch replaces an
untyped set of "stores" with a typed set of "engines" at the API level.
Part 2:
(should have been split up further for easier reviewing, but things got a bit tangled)
This patch does a few things:
and knows how to relay messages to the account manager, and query its state
Pull Request checklist
After merge