-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1fb26a2
commit 255fd1f
Showing
47 changed files
with
285 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
uml/src/KeyVaultCli.Application/Cli/Commands/ExitCommand.puml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 14 additions & 14 deletions
28
uml/src/KeyVaultCli.Application/Common/Constants/CommandFlag.puml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
@startuml | ||
enum CommandFlag { | ||
CreatePassword= 1, | ||
CreatePasswordGenerated= 11, | ||
GetPassword= 2, | ||
GetAllPasswords= 3, | ||
UpdatePassword= 4, | ||
UpdatePasswordGenerated= 44, | ||
DeletePassword= 5, | ||
SearchPasswordEntries= 6, | ||
UpdateMasterPassword= 7, | ||
Exit= 0, | ||
CreateVault= 100, | ||
BackupVault= 101, | ||
RestoreVault= 102, | ||
DeleteAllPasswords= -1, | ||
DeleteVault= -11, | ||
CreatePassword= 10, | ||
CreatePasswordGenerated= 11, | ||
GetPassword= 12, | ||
GetAllPasswords= 13, | ||
UpdatePassword= 14, | ||
UpdatePasswordGenerated= 15, | ||
DeletePassword= 16, | ||
DeleteAllPasswords= 17, | ||
SearchPasswordEntries= 18, | ||
CreateVault= 20, | ||
BackupVault= 21, | ||
RestoreVault= 22, | ||
DeleteVault= 23, | ||
UpdateMasterPassword= 30, | ||
} | ||
@enduml |
1 change: 1 addition & 0 deletions
1
uml/src/KeyVaultCli.Application/Common/Interfaces/ICommand.puml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
@startuml | ||
interface ICommand { | ||
Execute() : void | ||
} | ||
@enduml |
3 changes: 3 additions & 0 deletions
3
uml/src/KeyVaultCli.Application/Common/Interfaces/ICommandService.puml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
@startuml | ||
interface ICommandService { | ||
ExecuteCommand(command:CommandFlag, errorMessage:string) : bool | ||
GetCommandValidationErrorMessage(commandString:string) : string? | ||
+ IsCommandSupported(commandString:string) : bool | ||
+ IsCommandRecognized(commandString:string) : bool | ||
IsExitCommand(commandString:string) : bool | ||
} | ||
@enduml |
6 changes: 6 additions & 0 deletions
6
...aultCli.Application/PasswordEntry/Commands/CreatePasswordEntry/CreatePasswordCommand.puml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
...pplication/PasswordEntry/Commands/CreatePasswordEntry/CreatePasswordGeneratedCommand.puml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,14 @@ | ||
@startuml | ||
class CreatePasswordGenerateCommand { | ||
- <<readonly>> serviceNamePrompt : string = "Enter service name for the new password: " | ||
- <<readonly>> accountNamePrompt : string = "Enter account name for the new password: " | ||
- <<readonly>> passwordLengthPrompt : string = "Enter the desired password length: " | ||
- <<readonly>> urlPrompt : string = "Enter the URL (leave empty if not applicable): " | ||
- <<readonly>> categoryPrompt : string = "Enter the category (leave empty if not applicable): " | ||
- <<readonly>> invalidLengthError : string = "Invalid input for password length. Ensure you enter a valid number." | ||
- <<readonly>> successMessage : string = "A new password has been created and stored for {0}, {1} with the value {2}." | ||
+ Execute() : void | ||
- GetPasswordLength() : int | ||
} | ||
ICommand <|-- CreatePasswordGenerateCommand | ||
@enduml |
3 changes: 3 additions & 0 deletions
3
...Cli.Application/PasswordEntry/Commands/DeletePasswordEntry/DeleteAllPasswordsCommand.puml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
...aultCli.Application/PasswordEntry/Commands/DeletePasswordEntry/DeletePasswordCommand.puml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,12 @@ | ||
@startuml | ||
class DeletePasswordCommand { | ||
- <<readonly>> serviceNamePrompt : string = "Enter the service name for the password you want to delete: " | ||
- <<readonly>> accountNamePrompt : string = "Enter the account name for the password you want to delete: " | ||
- <<readonly>> successMessage : string = "Password entry has been deleted." | ||
- <<readonly>> errorMessage : string = "Failed to delete the password entry. Ensure the service and account names are correct." | ||
+ Execute() : void | ||
- GetServiceName() : string | ||
- GetAccountName() : string | ||
} | ||
ICommand <|-- DeletePasswordCommand | ||
@enduml |
7 changes: 7 additions & 0 deletions
7
...yVaultCli.Application/PasswordEntry/Commands/GetPasswordEntry/GetAllPasswordsCommand.puml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,13 @@ | ||
@startuml | ||
class GetAllPasswordsCommand { | ||
- <<readonly>> infoMessage : string = "A healthy password should be unique within the vault, at least 8 characters long, and contain at least one uppercase letter, one lowercase letter, and one digit." | ||
- <<readonly>> errorMessage : string = "No password entries found." | ||
+ GetAllPasswordsCommand(vault:IVault, consoleService:IConsole) | ||
+ Execute() : void | ||
- GetPasswordHealthDescription(passwordHealthResult:PasswordHealthResult) : string | ||
} | ||
ICommand <|-- GetAllPasswordsCommand | ||
GetAllPasswordsCommand --> "vault" IVault | ||
GetAllPasswordsCommand --> "consoleService" IConsole | ||
GetAllPasswordsCommand --> "passwordHealthService" PasswordHealthService | ||
@enduml |
14 changes: 14 additions & 0 deletions
14
...c/KeyVaultCli.Application/PasswordEntry/Commands/GetPasswordEntry/GetPasswordCommand.puml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,20 @@ | ||
@startuml | ||
class GetPasswordCommand { | ||
- <<readonly>> serviceNamePrompt : string = "Enter the service name: " | ||
- <<readonly>> accountNamePrompt : string = "Enter the account name: " | ||
- <<readonly>> errorEmptyInputMessage : string = "Service name and account name cannot be empty." | ||
- <<readonly>> passwordInfoMessage : string = "Information for {0}, {1}:" | ||
- <<readonly>> passwordNotFoundMessage : string = "No password entry found for service {0}, account {1}." | ||
- <<readonly>> warningMessage : string = "This password is not healthy. A healthy password should be at least 8 characters long, contain at least one uppercase letter, one lowercase letter, one digit and be unique inside this Vault." | ||
- <<readonly>> passwordHealthyMessage : string = "This password is healthy." | ||
+ GetPasswordCommand(vault:IVault, consoleService:IConsole) | ||
+ Execute() : void | ||
- GetServiceName() : string | ||
- GetAccountName() : string | ||
- WritePasswordInfo(passwordEntry:Domain.Entities.PasswordEntry, serviceName:string, accountName:string) : void | ||
} | ||
ICommand <|-- GetPasswordCommand | ||
GetPasswordCommand --> "vault" IVault | ||
GetPasswordCommand --> "consoleService" IConsole | ||
GetPasswordCommand --> "passwordHealthService" PasswordHealthService | ||
@enduml |
4 changes: 4 additions & 0 deletions
4
...Cli.Application/PasswordEntry/Commands/GetPasswordEntry/SearchPasswordEntriesCommand.puml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
@startuml | ||
class SearchPasswordEntriesCommand { | ||
- <<readonly>> searchPrompt : string = "Enter your search query: " | ||
- <<readonly>> matchingEntriesMessage : string = "Matching search entries:" | ||
- <<readonly>> noEntriesFoundError : string = "No matching entries found." | ||
+ Execute() : void | ||
- GetMatchingEntriesDataRows(matchingEntries:IEnumerable<Domain.Entities.PasswordEntry>) : List<List<object>> | ||
} | ||
ICommand <|-- SearchPasswordEntriesCommand | ||
@enduml |
4 changes: 4 additions & 0 deletions
4
...i.Application/PasswordEntry/Commands/UpdatePasswordEntry/UpdateMasterPasswordCommand.puml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
...aultCli.Application/PasswordEntry/Commands/UpdatePasswordEntry/UpdatePasswordCommand.puml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
...pplication/PasswordEntry/Commands/UpdatePasswordEntry/UpdatePasswordGeneratedCommand.puml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
uml/src/KeyVaultCli.Application/Vault/Commands/BackupVault/BackupVaultCommand.puml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,12 @@ | ||
@startuml | ||
class BackupVaultCommand { | ||
- <<readonly>> backupSuccessMsg : string = " ____ _ ____ __ _ \n | __ ) __ _ ___| | ___ _ _ __ / ___| _ _ ___ ___ ___ ___ ___ / _|_ _| |\n | _ \\ / _` |/ __| |/ / | | | '_ \\ \\___ \\| | | |/ __/ __/ _ \\/ __/ __| |_| | | | |\n | |_) | (_| | (__| <| |_| | |_) | ___) | |_| | (_| (_| __/\\__ \\__ \\ _| |_| | |\n |____/ \\__,_|\\___|_|\\_\\\\__,_| .__/ |____/ \\__,_|\\___\\___\\___||___/___/_| \\__,_|_|\n |_| " | ||
- <<readonly>> confirmationPrompt : string = "Are you sure you want to backup the vault?" | ||
- <<readonly>> filePathPrompt : string = "Enter the full path to the backup file: " | ||
- <<readonly>> backupErrMsg : string = "Failed to backup vault." | ||
- <<readonly>> operationCancelMsg : string = "Operation cancelled." | ||
+ Execute() : void | ||
- PerformBackup() : void | ||
} | ||
ICommand <|-- BackupVaultCommand | ||
@enduml |
1 change: 1 addition & 0 deletions
1
uml/src/KeyVaultCli.Application/Vault/Commands/CreateVault/CreateVaultCommand.puml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
uml/src/KeyVaultCli.Application/Vault/Commands/DeleteVault/DeleteVaultCommand.puml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
uml/src/KeyVaultCli.Application/Vault/Commands/RestoreVault/RestoreVaultCommand.puml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,12 @@ | ||
@startuml | ||
class RestoreVaultCommand { | ||
- <<readonly>> restoreSuccessMsg : string = " ____ _ _ \n | _ \\ ___ ___| |_ ___ _ __ ___ __| |\n | |_) / _ \\/ __| __/ _ \\| '__/ _ \\/ _` |\n | _ < __/\\__ \\ || (_) | | | __/ (_| |\n |_| \\_\\___||___/\\__\\___/|_| \\___|\\__,_|\n " | ||
- confirmationPrompt : string = "Are you sure you want to restore the vault?" | ||
- filePathPrompt : string = "Enter the full path to the backup file: " | ||
- <<readonly>> restoreErrorMsg : string = "Failed to restore vault." | ||
- <<readonly>> operationCancelMsg : string = "Operation cancelled." | ||
+ Execute() : void | ||
- PerformRestore() : void | ||
} | ||
ICommand <|-- RestoreVaultCommand | ||
@enduml |
5 changes: 5 additions & 0 deletions
5
uml/src/KeyVaultCli.Domain/Common/Interfaces/ICompromisedPasswordService.puml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
@startuml | ||
interface ICompromisedPasswordService { | ||
HasBeenCompromisedAsync(password:string) : Task<bool> | ||
} | ||
@enduml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,13 @@ | ||
@startuml | ||
interface IConsole { | ||
GetInputFromPrompt(prompt:string, isBold:bool) : string | ||
GetUserConfirmation(promptMessage:string, isBold:bool) : bool | ||
WriteText(message:string, isBold:bool) : void | ||
WriteInfo(message:string, isBold:bool) : void | ||
WriteSuccess(message:string, isBold:bool) : void | ||
WriteWarning(message:string, isBold:bool) : void | ||
WriteError(message:string, isBold:bool) : void | ||
WriteTable(headers:string[], data:List<List<object>>) : void | ||
Clear() : void | ||
} | ||
@enduml |
5 changes: 5 additions & 0 deletions
5
uml/src/KeyVaultCli.Domain/Common/Interfaces/IPasswordStrengthService.puml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
@startuml | ||
interface IPasswordStrengthService { | ||
IsStrongPassword(password:string) : bool | ||
} | ||
@enduml |
5 changes: 5 additions & 0 deletions
5
uml/src/KeyVaultCli.Domain/Common/Interfaces/IPasswordUniquenessService.puml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
@startuml | ||
interface IPasswordUniquenessService { | ||
IsUniquePasswordAsync(password:string) : Task<bool> | ||
} | ||
@enduml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
uml/src/KeyVaultCli.Domain/Common/Interfaces/IVaultEncryptionService.puml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
@startuml | ||
interface IVaultEncryptionService { | ||
Encrypt(password:string, masterPassword:string) : string | ||
Decrypt(password:string, masterPassword:string) : string | ||
} | ||
@enduml |
3 changes: 3 additions & 0 deletions
3
uml/src/KeyVaultCli.Domain/Common/Interfaces/IVaultFactory.puml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
@startuml | ||
interface IVaultFactory { | ||
CreateVault(masterPassword:string) : IVault? | ||
DeleteVault() : bool | ||
GetVault() : IVault | ||
} | ||
@enduml |
4 changes: 4 additions & 0 deletions
4
uml/src/KeyVaultCli.Domain/Common/Interfaces/IVaultFileService.puml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
@startuml | ||
interface IVaultFileService { | ||
Exists(path:string) : bool | ||
WriteAllText(path:string, content:string) : void | ||
ReadAllText(path:string) : string | ||
Delete(path:string) : bool | ||
} | ||
@enduml |
1 change: 1 addition & 0 deletions
1
uml/src/KeyVaultCli.Domain/Common/Interfaces/IVaultPasswordGenerator.puml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
@startuml | ||
interface IVaultPasswordGenerator { | ||
GeneratePassword(length:int) : string | ||
} | ||
@enduml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.