コード例 #1
0
ファイル: base.py プロジェクト: jre21/inbox
    def password(self, value):
        assert AUTH_TYPES.get(self.provider) == 'Password'
        assert value is not None

        key_size = int(config.get('KEY_SIZE', 128))
        self.password_aes, key = encrypt_aes(value, key_size)
        self.key = key[:len(key)/2]

        with open(self._keyfile, 'w+') as f:
            f.write(key[len(key)/2:])
コード例 #2
0
ファイル: crispin.py プロジェクト: nvdnkpr/inbox
    def _set_account_info(self):
        with session_scope() as db_session:
            account = db_session.query(ImapAccount).get(self.account_id)

            # Refresh token if need be, for OAuthed accounts
            if AUTH_TYPES.get(account.provider) == 'OAuth':
                account = verify_imap_account(db_session, account)
                self.o_access_token = account.o_access_token

            self.email_address = account.email_address
            self.provider = account.provider
コード例 #3
0
ファイル: crispin.py プロジェクト: caitp/inbox
    def _set_account_info(self):
        with session_scope() as db_session:
            account = db_session.query(ImapAccount).get(self.account_id)

            # Refresh token if need be, for OAuthed accounts
            if AUTH_TYPES.get(account.provider) == 'OAuth':
                account = verify_imap_account(db_session, account)
                self.o_access_token = account.o_access_token

            self.email_address = account.email_address
            self.provider = account.provider
コード例 #4
0
ファイル: postel.py プロジェクト: jre21/inbox
    def _set_account_info(self):
        with session_scope() as db_session:
            account = db_session.query(Account).get(self.account_id)

            #self.full_name = account.full_name
            self.full_name = 'TEST'
            self.email_address = account.email_address
            self.provider = account.provider

            self.auth_type = AUTH_TYPES.get(account.provider)

            if self.auth_type == 'OAuth':
                # Refresh OAuth token if need be
                account = verify_imap_account(db_session, account)
                self.o_access_token = account.o_access_token
            else:
                assert self.auth_type == 'Password'
                self.password = account.password
コード例 #5
0
ファイル: postel.py プロジェクト: caitp/inbox
    def _set_account_info(self):
        with session_scope() as db_session:
            account = db_session.query(ImapAccount).get(self.account_id)

            self.email_address = account.email_address
            self.provider = account.provider
            self.full_name = account.full_name if account.provider == 'Gmail'\
                else ''
            self.sent_folder = account.sent_folder.name

            self.auth_type = AUTH_TYPES.get(account.provider)

            if self.auth_type == 'OAuth':
                # Refresh OAuth token if need be
                account = verify_imap_account(db_session, account)
                self.o_access_token = account.o_access_token
            else:
                assert self.auth_type == 'Password'
                self.password = account.password