Commit graph

24 commits

Author SHA1 Message Date
Eshan
74724b2185 Create directory if it doesn't exist (#963)
* create dir if it doesn't exist
* switch order of print and creation
* makedirs instead of mkdir and stderr printing
* add test
* black reformatting
2020-06-06 12:46:06 -07:00
MinchinWeb
cfadcd39ca Apply isort Mk II (#942)
* Apply isort!
2020-05-09 13:14:43 -07:00
Jonathan Wren
e3a46e9846 fix various small issues in the codebase 2020-04-18 12:35:46 -07:00
Micah Jerome Ellison
6985de2844 Add support to save journals to multiple files in a directory
Update FolderJournal reference to entry __unicode__ method to __str__
Remove DayOne test made obsolete by FolderJournal
Fix FolderJournal path tests for Windows paths
Apply Black linting
2020-04-10 11:51:56 -07:00
Jonathan Wren
46c4c88231 (#770) run black formatter on codebase for standardization 2020-04-10 11:51:56 -07:00
Peter Schmidbauer
9664924096 Move all password handling to EncryptedJournal
This commit should greatly simplify all password handling logic. No passwords are stored in the config dict anymore. Only the Encrypted Journals have any password related logic. I also had to remove some password fields from the test files, which shows how dangerous the previous approach was. A slight code change could've leaked passwords to the config file. However, I had to change the install progress a little bit to make this work. It will now not ask you for a password right away but rather if you want to encrypt or not. Only if you reply 'y' will it ask you for the password later on.
2020-04-10 11:51:56 -07:00
Peter Schmidbauer
8eb185f8a2 Add password confirmation dialog 2020-04-10 11:51:55 -07:00
Peter Schmidbauer
9d8d6a83ae remove py2 remnants and use mocks in tests
fstring wip
Run pyupgrade
fix broken pyupgrade fstring
run pyupgrade on plugin dir
fixup! remove py2 remnants and use mocks in tests
small print bugfix
The file=sys.stderr was part of the format(), so an error got printed to
stdout
Drop use of codecs package
Use builtins.open() instead
fixup! remove py2 remnants and use mocks in tests
2020-04-10 11:51:55 -07:00
Greg Bodnar
623fa6c307 Create encrypted journal
Add failing test for configuring an encrypted journal
Overload open for EncryptedJournal

This avoids the execution path that calls EncryptedJournal._create()
without a password parameter. It results in duplication of code that
requests and stores a password, which should be factored out in a
subsequent change.

Modify test to test for returned strings

The entered string for the password is not being used by the test and I
don't understand why.

Use util wrapper for getpass

This allows for tests to run without prompting for user input.
2020-04-10 11:51:55 -07:00
Manuel Ebert
69fc08f6f3 Upgrade to cryptography 1.4 2016-08-17 13:41:54 +00:00
Manuel Ebert
6c18b6f3b4 More encoding madness 2015-04-05 06:38:38 +04:00
Manuel Ebert
4a7a8cb7a4 Encryption reads and writes in binary mode 2015-04-05 06:14:18 +04:00
Manuel Ebert
76c9006ed3 Python 3 fixes :) 2015-04-05 06:05:46 +04:00
Manuel Ebert
5ffd0d5d0b Legacy Journal with old timestamps 2015-04-05 02:23:09 +04:00
Manuel Ebert
a5f08e6081 Introduce legacy classes 2015-04-05 07:25:22 +10:00
Manuel Ebert
df82ad1f4d Properly initialise journal files after creating them 2015-04-04 18:58:33 +11:00
Manuel Ebert
c0ec95679b Make backup of config when upgrading
Fixes #307
2015-04-04 18:36:34 +11:00
Manuel Ebert
2615070df0 Hardcoded salt to fix crypto 2015-04-04 17:50:44 +11:00
Manuel Ebert
a1b5a4099e Work on cryptography 2014-09-27 13:15:46 -07:00
Manuel Ebert
e75e3d73a0 Converts tests to YAML 2014-09-12 15:28:12 -07:00
Manuel Ebert
1f73d28147 Uses PBKDF2-SHA256 instead of plain SHA256
Fixes #192
2014-09-12 14:28:37 -07:00
Manuel Ebert
db494597a2 Basic support for cryptography.io
Still needs better hash function
2014-09-12 14:28:03 -07:00
Manuel Ebert
4563651b71 Deprecate config.password 2014-09-12 14:28:03 -07:00
Matthias Vogelgesang
9d589f3e64 Make Journal a general interface
This change moves the loading and saving mechanisms into its own
Plain- and EncryptedJournal subclasses for easier maintenance and lazy loading
of all the crypto modules.
2014-09-12 14:26:22 -07:00