Merge pull request #1587 from mozilla/remove-unblock-context-check
Remove unblock context check
This commit is contained in:
Коммит
a60b808187
|
@ -509,24 +509,6 @@ var conf = convict({
|
|||
doc: 'signin unblock sample rate, between 0.0 and 1.0',
|
||||
default: 1.0,
|
||||
env: 'SIGNIN_UNBLOCK_RATE'
|
||||
},
|
||||
supportedClients: {
|
||||
doc: 'support sign-in unblock for only these clients',
|
||||
format: Array,
|
||||
default: [
|
||||
'web',
|
||||
'oauth',
|
||||
'iframe',
|
||||
'fx_firstrun_v1',
|
||||
'fx_firstrun_v2',
|
||||
'fx_desktop_v1',
|
||||
'fx_desktop_v2',
|
||||
'fx_desktop_v3',
|
||||
'fx_ios_v1',
|
||||
'fx_ios_v2',
|
||||
'fx_fennec_v1'
|
||||
],
|
||||
env: 'SIGNIN_UNBLOCK_SUPPORTED_CLIENTS'
|
||||
}
|
||||
},
|
||||
hpkpConfig: {
|
||||
|
|
|
@ -47,17 +47,6 @@ module.exports = config => {
|
|||
return true
|
||||
}
|
||||
|
||||
// While we're testing this feature, there may be some funky
|
||||
// edge-cases in device login flows that haven't been fully tested.
|
||||
// Temporarily avoid them for regular users by checking the `context` flag,
|
||||
const context = request.payload &&
|
||||
request.payload.metricsContext &&
|
||||
request.payload.metricsContext.context
|
||||
|
||||
if (signinUnblock.supportedClients.indexOf(context) === -1) {
|
||||
return false
|
||||
}
|
||||
|
||||
// Check to see if user in roll-out cohort.
|
||||
return isSampledUser(signinUnblock.sampleRate, uid, 'signinUnblock')
|
||||
},
|
||||
|
|
|
@ -189,9 +189,6 @@ describe('features', () => {
|
|||
const email = 'blee@mozilla.com'
|
||||
const request = {
|
||||
payload: {
|
||||
metricsContext: {
|
||||
context: 'iframe'
|
||||
}
|
||||
}
|
||||
}
|
||||
// First 27 characters are ignored, last 13 are 0.02 * 0xfffffffffffff
|
||||
|
@ -202,7 +199,6 @@ describe('features', () => {
|
|||
unblock.enabled = true
|
||||
unblock.sampleRate = 0.02
|
||||
unblock.allowedEmailAddresses = /.+@notmozilla.com$/
|
||||
unblock.supportedClients = [ 'wibble', 'iframe' ]
|
||||
assert.equal(features.isSigninUnblockEnabledForUser(uid, email, request), false, 'should return false when email is not allowed and uid is not sampled')
|
||||
|
||||
unblock.forcedEmailAddresses = /.+/
|
||||
|
@ -215,15 +211,6 @@ describe('features', () => {
|
|||
unblock.allowedEmailAddresses = /.+@notmozilla.com$/
|
||||
unblock.sampleRate = 0.03
|
||||
assert.equal(features.isSigninUnblockEnabledForUser(uid, email, request), true, 'should return when uid is sampled')
|
||||
|
||||
|
||||
request.payload.metricsContext.context = ''
|
||||
assert.equal(features.isSigninUnblockEnabledForUser(uid, email, request), false, 'should return false when context is not supported')
|
||||
|
||||
|
||||
request.payload.metricsContext.context = 'iframe'
|
||||
unblock.enabled = false
|
||||
assert.equal(features.isSigninUnblockEnabledForUser(uid, email, request), false, 'should return false when feature is disabled')
|
||||
}
|
||||
)
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче