Skip to content

Commit

Permalink
Merge 71a1c5f into 57b25a2
Browse files Browse the repository at this point in the history
  • Loading branch information
wn committed Oct 23, 2018
2 parents 57b25a2 + 71a1c5f commit 2c86251
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions docs/DeveloperGuide.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,49 @@ image::UndoRedoActivityDiagram.png[width="650"]
** Cons: Requires dealing with commands that have already been undone: We must remember to skip these commands. Violates Single Responsibility Principle and Separation of Concerns as `HistoryManager` now needs to do two different things.
// end::undoredo[]

// tag::userconfirmation[]
=== User Confirmation
Before a loan entry can be deleted, user confirmation should be required. This ensures that only authorized users are able to delete loans. This is done through the `Password` class validating any attempts to delete loans or change password.

* Current Implementation *
There are three stages in this implementation:

===== Allowing the `delete` command to accept a password
1. To allow `delete` command to accept a password, we set a stub password of `a12345` and require all `delete` command to take in a password argument.
* When password is wrong, we do not perform the deletion of the loans.
* Only when password matches with stub password will the loan be deleted.
2. Tests were edited to include and check for a valid password before deletion.

The following sequence diagram shows how the new `delete` operation works.

image::deleteLoanWithPass.png[width="1000"]

===== Allow changing of master password

This is done in the following steps:

1. Create a `Password` class to store the password string.
2. Create a `setpass` command that takes in the old password and new password.
* We reject the command if the given old password is not equal to password
that is stored in the database. This is to ensure only the user who has the password would be allowed to change it.
* Set password in `UserPref` to new password if old password corresponds to current password.
3. Write test to ensure no regression.

The following sequence diagram shows how the `setpass` operation works:

image::setPasswordLogic.png[width="1000"]

image::setPasswordModel.png[width="1000"]

===== Encrypt current password for security
To ensure that others are unable to retrieve the app's password from the preference.json, we encrypt the password before storing. Decryption of password can only be done by Password.java.

This is currently done by appending `-encrypt` to the password, and removing it when
decrypting. For version 2.0, we plan to utilise existing libraries to encrypt and
decrypt our stored password.

// end::userconfirmation[]

=== Return a Loan feature
==== Proposed Implementation

Expand Down
Binary file added docs/images/deleteLoanWithPass.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/setPasswordLogic.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/setPasswordModel.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 2c86251

Please sign in to comment.