This repository was archived by the owner on Nov 1, 2022. It is now read-only.
Repository navigation
Closes #3729: allow tokenserver url override #5984
Closed
tublitzed
wants to merge
1
commit into
mozilla-mobile:master
from
tublitzed:feat/allow-tokenserver-url-override
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -908,10 +908,16 @@ open class FxaAccountManager( | |
| return | ||
| } | ||
|
|
||
| var tokenServerUrl = syncConfig?.tokenServerUrl | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A more succinct way to write this (and avoid using a |
||
| if (tokenServerUrl == null) { | ||
| tokenServerUrl = account.getTokenServerEndpointURL() | ||
| } | ||
|
|
||
| logger.info("caching tokenServerUrl: $tokenServerUrl") | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's not log the URL itself - it could be considered PII. Just mention the fact that this is a custom tokenServerUrl. |
||
| // NB: this call will inform authErrorRegistry in case an auth error is encountered. | ||
| account.getAccessTokenAsync(SCOPE_SYNC).await()?.let { | ||
| SyncAuthInfoCache(context).setToCache( | ||
| it.asSyncAuthInfo(account.getTokenServerEndpointURL()) | ||
| it.asSyncAuthInfo(tokenServerUrl) | ||
| ) | ||
| } | ||
| } | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
@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.