-
Notifications
You must be signed in to change notification settings - Fork 35
Bug 2034430 - Disable Firefox Relay feature in enterprise builds #780
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
Open
victhorlopez
wants to merge
1
commit into
mozilla:enterprise-main
Choose a base branch
from
victhorlopez:bug/2034430
base: enterprise-main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
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
Some comments aren't visible on the classic Files Changed page.
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
50 changes: 50 additions & 0 deletions
50
toolkit/components/passwordmgr/test/browser/browser_relay_disabled_enterprise.js
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 |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| const TEST_URL_PATH = `https://example.org${DIRECTORY_PATH}form_basic_signup.html`; | ||
|
|
||
| Services.scriptloader.loadSubScript( | ||
| "chrome://mochitests/content/browser/toolkit/components/passwordmgr/test/browser/browser_relay_utils.js", | ||
| this | ||
| ); | ||
|
|
||
| add_task(async function test_enterprise_relay_feature_default_disabled() { | ||
| Assert.equal( | ||
| Services.prefs | ||
| .getDefaultBranch("") | ||
| .getStringPref("signon.firefoxRelay.feature"), | ||
| "unavailable", | ||
| "signon.firefoxRelay.feature default should be 'unavailable' in enterprise builds" | ||
| ); | ||
| }); | ||
|
|
||
| add_task(async function test_enterprise_relay_utils_reports_disabled() { | ||
| const { FirefoxRelayUtils } = ChromeUtils.importESModule( | ||
| "resource://gre/modules/FirefoxRelayUtils.sys.mjs" | ||
| ); | ||
|
|
||
| Assert.ok( | ||
| !FirefoxRelayUtils.relayIsAvailableOrEnabled(), | ||
| "FirefoxRelayUtils.relayIsAvailableOrEnabled() should return false when feature is disabled" | ||
| ); | ||
| }); | ||
|
|
||
| add_task( | ||
| async function test_enterprise_relay_autocomplete_not_shown_when_disabled() { | ||
| const rsSandbox = await stubRemoteSettingsAllowList(); | ||
| await BrowserTestUtils.withNewTab( | ||
| { | ||
| gBrowser, | ||
| url: TEST_URL_PATH, | ||
| }, | ||
| async function (browser) { | ||
| const popup = document.getElementById("PopupAutoComplete"); | ||
| await openACPopup(popup, browser, "#form-basic-username"); | ||
|
|
||
| const relayItem = getRelayItemFromACPopup(popup); | ||
| Assert.ok( | ||
| !relayItem, | ||
| "Relay item SHOULD NOT be present in the autocomplete popup when the feature is disabled" | ||
| ); | ||
| } | ||
| ); | ||
| rsSandbox.restore(); | ||
| } | ||
| ); |
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.
Uh oh!
There was an error while loading. Please reload this page.
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.
nit:"not supported" might be misleading here. We support it but the default for enterprise builds is that it's disabled but can be enabled by a policy (which doesn't exist as of now).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.
If we support it (I thought we don't based on the excel), then the tests should be enabled and set "signon.firefoxRelay.feature", "available" for those tests for enterprise. (together with the original unlock of url). Do you see it like this or have a diferent opinion?
Uh oh!
There was an error while loading. Please reload this page.
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.
My comment was intended as a nit and solely about the phrasing of the comment. But I have to correct my previous statement. An idea was to have a policy to disable Relay. But now that I'm revisiting this, that policy won't be applicable for Firefox Enterprise builds.
Let's wait for a product decision, because if we disable the Relay feature entirely, we also need to make sure it's not surfaced and toggleable from anywhere e.g. about:preferences, ideally with test coverage.
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.
okay, is my understand correct now, that we do not support relay?
I wrote a test already using their utils and similar logic, but based on your comment we need to test more (i.e about preferences and so on).
Uh oh!
There was an error while loading. Please reload this page.
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.
Yes, as of now we do not support Relay, hence the user shouldn't be able to turn it on. I checked and setting the preference
signon.firefoxRelay.featuretounavailableinstead ofdisabled, will make it not show up e.g. inabout:preferences#privacy. So let's set the preference value tounavailable? Relay then still shows up onabout:preferences#moreFromMozilla, but that section can be controled via the policyUserMessaging.Uh oh!
There was an error while loading. Please reload this page.
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.
Where did you get this
unavailablefrom?In the prefs it is not stated, and for this check they use this. Does it behave different than disabled?
link
edit: I just tried and with
unavailableit disappears ... niceUh oh!
There was an error while loading. Please reload this page.
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.
Based on this test I guess this is equivalent to undefined?
test
edit: ok I am leaving it as
unavailable, reason is to getundefinedwe should not set the pref, but that seems quite easy that it gets brokenThere 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.
I had a vague memory that when we integrated relay into the password manager that we made a distinction between whether the pref was set to
unavailableordisabled. So I tried it out and then assumed preemptively thatunavailablewas the correct value. But I think you are pointing it out correctly. It can be any arbitrary value except"available", "offered", "enabled" or "disabled".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.
I've reached out to Relay folks to make sure this doesn't cause unexpected breakage.