Repository navigation
Conversation
Codecov Report
@@ Coverage Diff @@
## master #5984 +/- ##
============================================
- Coverage 78.77% 77.09% -1.68%
+ Complexity 5533 176 -5357
============================================
Files 597 32 -565
Lines 26522 1144 -25378
Branches 3877 177 -3700
============================================
- Hits 20892 882 -20010
+ Misses 4065 210 -3855
+ Partials 1565 52 -1513
Continue to review full report at Codecov.
|
| * periodic syncing will be disabled. | ||
| * @property tokenServerUrl Optional, override default tokenServerUrl to support self-hosted sync storage. | ||
| */ | ||
| data class SyncConfig( |
There was a problem hiding this comment.
@grigoryk - So it seems that the ServerConfig (which was the suggestion on where to overwrite this value in the original issue) is pulled from here in application services and doesn't currently support setting a custom token server url.
Since #3729 was filed specifically for this repo, I wanted to first confirm with you that you still think it makes sense for the ServerConfig to set this value. If so, I can close this PR and first open a PR over in application services to support setting a token server url. Then, once that merges, I can re-open this one and adjust to use that value instead.
Since that's a much larger scope of changes, I figured it'd make sense to confirm this approach with you first.
|
It's also worth noting here that I think we may also need to make additional changes to support #3762. I'm able to verify here that I can successfully overwrite the tokenserver url used for sync....but cannot get a successful sync after doing so. When setting to local sync server(http://localhost:5000/token/1.0/sync/1.5), I get a network error (is this a known issue with the android studio emulator and localhost?) and when setting to staging sync server (https://token.stage.mozaws.net/1.0/sync/1.5) I get a 401. I'm not sure if there's something else that's happening in desktop when you overwrite the token server url via |
|
Hey, @grigoryk can I get a r+ here? |
grigoryk
left a comment
There was a problem hiding this comment.
I agree with you that we don't need this PR as-is. Let's make ServerConfig in the appservices configurable enough to allow overriding values obtained from .well-known/fxa-client-configuration (https://github.com/mozilla/application-services/blob/master/components/fxa-client/src/config.rs#L120). Once that's done, I don't think we'll need any changes in a-c at all - everything we care about (content_url, tokenserver_url) will be directly configurable from Fenix.
Instead of localhost, try using 127.0.0.1? That should work in the emulator.
As to why you got a 401 when configuring a staging tokenserver - I'm not sure, actually! Does this configuration work for you in other clients (desktop)? E.g. use production auth server in conjunction with a staging token server? I would expect that to work, and code in your PR looks like it should definitely work.
| return | ||
| } | ||
|
|
||
| var tokenServerUrl = syncConfig?.tokenServerUrl |
There was a problem hiding this comment.
A more succinct way to write this (and avoid using a var):
val tokenServerUrl = syncConfig?.toknServerUrl ?: account.getTokenServerEndpointURL()
| tokenServerUrl = account.getTokenServerEndpointURL() | ||
| } | ||
|
|
||
| logger.info("caching tokenServerUrl: $tokenServerUrl") |
There was a problem hiding this comment.
Let's not log the URL itself - it could be considered PII. Just mention the fact that this is a custom tokenServerUrl.
The first step in supporting self hosted sync for Fenix is allowing the tokenserver url to be passed into the FxaAccountManager. This allows users to override the default tokenserver url, via Sync Config.
Pull Request checklist
After merge