aureliencarle / cryptext

GNU General Public License v3.0
0 stars 0 forks source link

Rm issue with the write method #19

Closed aureliencarle closed 2 years ago

GregoireUhlrich commented 2 years ago

For starters, the following 2 lines in the Touch command class should be replaced: https://github.com/aureliencarle/cryptext/blob/a2a3337538a9373997a053191e34d2f73f787ce2/src/commands/touch.py#L17

GregoireUhlrich commented 2 years ago

The Touch method should not write down the passwords and read the file again.

It simply should add an item in the session.content attribute, after a simple PasswordData construction. Something like

passwd = PassworDataIO.input()
shell.session.add_password(passwd)

The add_password() method would have to be defined

GregoireUhlrich commented 2 years ago

Finally, the conversion of passwords into the encrypted file should happen when the session closes.

BTW this should be the responsibility of the PasswordDataIO class (move the convert() method from PasswordData and call it write_password() or something like that).

GregoireUhlrich commented 2 years ago

After all this is done, the Rm class should at least be able to simply remove a password from its key, e.g.

shell.session.remove_password(pass_label)

The remove_password() method should be implemented

aureliencarle commented 2 years ago

High probability that we have a problem with rm -r machin cause of the option before parameter ..

GregoireUhlrich commented 2 years ago

Indeed. A more sophisticated parser will have to be implemented.. Deserves its own PR probably

GregoireUhlrich commented 2 years ago

Implemented successfully in PR #20