Coverage for pass_import/managers/firefox.py: 100%

19 statements  

« prev     ^ index     » next       coverage.py v7.4.3, created at 2024-02-26 12:11 +0000

1# -*- encoding: utf-8 -*- 

2# pass import - Passwords importer swiss army knife 

3# Copyright (C) 2017-2024 Alexandre PUJOL <alexandre@pujol.io>. 

4 

5from pass_import.core import register_managers 

6from pass_import.formats.csv import CSV 

7 

8 

9class Firefox(CSV): 

10 """Importer for Firefox in CSV format.""" 

11 name = 'firefox' 

12 url = 'https://www.mozilla.org/en-US/firefox/lockwise/' 

13 hexport = 'In about:logins Menu: Export logins' 

14 himport = 'pass import firefox file.csv' 

15 keys = {'title': 'url', 'password': 'password', 'login': 'username'} 

16 

17 @classmethod 

18 def header(cls): 

19 """Header for Firefox CSV file.""" 

20 return list(cls.keys.values()) + ['httpRealm', 'formActionOrigin', 

21 'timeCreated', 'timeLastUsed', 

22 'timePasswordChanged', 'guid'] 

23 

24 

25class FirefoxPasswordExporter(CSV): 

26 """Importer for Firefox password exporter extension in CSV format.""" 

27 name = 'firefox' 

28 default = False 

29 url = 'https://github.com/kspearrin/ff-password-exporter' 

30 hexport = 'Add-ons Prefs: Export Passwords: CSV' 

31 himport = 'pass import firefox file.csv' 

32 keys = {'title': 'hostname', 'password': 'password', 'login': 'username'} 

33 

34 

35register_managers(Firefox, FirefoxPasswordExporter)