Lines Matching refs:auth
45 tfa: { pending: false, mode: 'auth-and-writes' },
490 /npm profile enable-2fa \[auth-and-writes|auth-only\]/,
495 t.test('invalid two factor auth mode', async t => {
500 'should throw invalid auth mode error'
509 profile.exec(['enable-2fa', 'auth-only']),
521 profile.exec(['enable-2fa', 'auth-only']),
533 t.match(pass, 'bar', 'should use password for basic auth')
542 // mock legacy basic auth style
546 return { auth: Buffer.from('foo:bar').toString('base64') }
550 profile.exec(['enable-2fa', 'auth-only']),
558 t.test('from basic username/password auth', async t => {
569 // mock legacy basic auth style with user/pass
576 profile.exec(['enable-2fa', 'auth-only']),
584 t.test('no auth found', async t => {
591 profile.exec(['enable-2fa', 'auth-only']),
596 t.test('from basic auth, asks for otp', async t => {
601 t.match(pass, 'bar', 'should use password for basic auth')
612 mode: 'auth-only',
644 // mock legacy basic auth style
648 return { auth: Buffer.from('foo:bar').toString('base64') }
658 await profile.exec(['enable-2fa', 'auth-only'])
661 'Two factor authentication mode changed to: auth-only',
700 mode: 'auth-only',
752 await profile.exec(['enable-2fa', 'auth-only'])
795 profile.exec(['enable-2fa', 'auth-only']),
797 'should throw invalid 2fa auth url error'
801 t.test('from token auth provides --otp config arg', async t => {
833 await profile.exec(['enable-2fa', 'auth-and-writes'])
837 'Two factor authentication mode changed to: auth-and-writes',
876 await profile.exec(['enable-2fa', 'auth-only'])
880 'Two factor authentication mode changed to: auth-only',
885 t.test('defaults to auth-and-writes permission if no mode specified', async t => {
922 'Two factor authentication mode changed to: auth-and-writes',
923 'should enable 2fa with auth-and-writes permission'
1096 expect: ['auth-and-writes', 'auth-only'],
1097 title: 'should auto complete with auth types',