Add two factor authentication for boursorama module

This commit is contained in:
Gabriel 2012-12-05 18:11:22 +01:00 committed by Romain Bignon
commit ee4f3793a1
4 changed files with 196 additions and 9 deletions

View file

@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
# Copyright(C) 2012 Gabriel Serme
# Copyright(C) 2011 Gabriel Kerneis
# Copyright(C) 2010-2011 Jocelyn Jaubert
#
@ -24,7 +25,7 @@ from __future__ import with_statement
from weboob.capabilities.bank import ICapBank, AccountNotFound
from weboob.tools.backend import BaseBackend, BackendConfig
from weboob.tools.value import ValueBackendPassword
from weboob.tools.value import ValueBackendPassword, ValueBool, Value
from .browser import Boursorama
@ -40,12 +41,17 @@ class BoursoramaBackend(BaseBackend, ICapBank):
LICENSE = 'AGPLv3+'
DESCRIPTION = u'Boursorama French bank website'
CONFIG = BackendConfig(ValueBackendPassword('login', label='Account ID', masked=False),
ValueBackendPassword('password', label='Password'))
ValueBackendPassword('password', label='Password'),
ValueBool('enable_twofactors', label='Send validation sms', default=False),
Value('device', label='Device name', regexp='\w*'),)
BROWSER = Boursorama
def create_default_browser(self):
return self.create_browser(self.config['login'].get(),
self.config['password'].get())
return self.create_browser(
self.config["device"].get()
, self.config["enable_twofactors"].get()
, self.config['login'].get()
, self.config['password'].get())
def iter_accounts(self):
for account in self.browser.get_accounts_list():