Set Password Expiration Dates | Closes Issue #15 #85
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Related Issue
Closes #15
Type of Change
Description of Change
New feature to set an expiration date for each password while adding it, in the format YYYY-MM-DD.
If password has expired, user can either:
Implementation Details
In the
add_password
workflow, I modified the program to prompt user to enter an expiration date when adding a new password, validate date format usingdatetime.strptime
and check if the entered date has expired or notIntroduced a logic to handle expired passwords-
_is_expired
(to check if the given date has passed) andhandle_expired_password
(which manages expired passwords by offering the update/remove options.)The password file now includes expiration dates in the format:
when loading or saving passwords, the program reads and process expiration dates from the file using
load_password_file
andadd_password
.self.password_dict
stores both the password and its expiration dateadd_password
Demo