Skip to content

Commit

Permalink
regenerated uml diagrams
Browse files Browse the repository at this point in the history
  • Loading branch information
BeierKevin committed Apr 21, 2024
1 parent 1fb26a2 commit 255fd1f
Show file tree
Hide file tree
Showing 47 changed files with 285 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace KeyVaultCli.Presentation.UserInterface;

public struct CustomConsoleColor
public class CustomConsoleColor
{
public byte R { get; }
public byte G { get; }
Expand Down
12 changes: 12 additions & 0 deletions uml/include.puml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
!include .\\.\src\KeyVaultCli.Infrastructure\Services\FileService.puml
!include .\\.\src\KeyVaultCli.Infrastructure\Services\PasswordGeneratorService.puml
!include .\\.\src\KeyVaultCli.Presentation\Services\ConsoleService.puml
!include .\\.\src\KeyVaultCli.Presentation\UserInterface\ColorGenerated.puml
!include .\\.\src\KeyVaultCli.Presentation\UserInterface\CustomConsoleColor.puml
!include .\\.\src\KeyVaultCli.Presentation\UserInterface\Logo.puml
!include .\\.\src\KeyVaultCli.Presentation\UserInterface\Text.puml
!include .\\.\src\KeyVaultCli.Application\Cli\Commands\ExitCommand.puml
!include .\\.\src\KeyVaultCli.Application\Common\Constants\CommandFlag.puml
!include .\\.\src\KeyVaultCli.Application\Common\Interfaces\ICommand.puml
Expand All @@ -22,12 +26,20 @@
!include .\\.\src\KeyVaultCli.Application\Common\Interfaces\IFileService.puml
!include .\\.\src\KeyVaultCli.Application\Common\Interfaces\IPasswordGeneratorService.puml
!include .\\.\src\KeyVaultCli.Application\Common\Interfaces\IVaultService.puml
!include .\\.\src\KeyVaultCli.Domain\Common\Interfaces\ICompromisedPasswordService.puml
!include .\\.\src\KeyVaultCli.Domain\Common\Interfaces\IConsole.puml
!include .\\.\src\KeyVaultCli.Domain\Common\Interfaces\IPasswordStrengthService.puml
!include .\\.\src\KeyVaultCli.Domain\Common\Interfaces\IPasswordUniquenessService.puml
!include .\\.\src\KeyVaultCli.Domain\Common\Interfaces\IVault.puml
!include .\\.\src\KeyVaultCli.Domain\Common\Interfaces\IVaultEncryptionService.puml
!include .\\.\src\KeyVaultCli.Domain\Common\Interfaces\IVaultFactory.puml
!include .\\.\src\KeyVaultCli.Domain\Common\Interfaces\IVaultFileService.puml
!include .\\.\src\KeyVaultCli.Domain\Common\Interfaces\IVaultPasswordGenerator.puml
!include .\\.\src\KeyVaultCli.Domain\Services\PasswordHealthCheck\CompromisedPasswordService.puml
!include .\\.\src\KeyVaultCli.Domain\Services\PasswordHealthCheck\PasswordHealthResult.puml
!include .\\.\src\KeyVaultCli.Domain\Services\PasswordHealthCheck\PasswordHealthService.puml
!include .\\.\src\KeyVaultCli.Domain\Services\PasswordHealthCheck\PasswordStrengthService.puml
!include .\\.\src\KeyVaultCli.Domain\Services\PasswordHealthCheck\PasswordUniquenessService.puml
!include .\\.\src\KeyVaultCli.Presentation\UserInterface\Table\Alignment.puml
!include .\\.\src\KeyVaultCli.Presentation\UserInterface\Table\ConsoleTable.puml
!include .\\.\src\KeyVaultCli.Presentation\UserInterface\Table\ConsoleTableOptions.puml
Expand Down
2 changes: 2 additions & 0 deletions uml/src/KeyVaultCli.Application/Cli/Commands/ExitCommand.puml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
@startuml
class ExitCommand {
- <<readonly>> exitPrompt : string = "Are you sure you want to close the application?"
- <<readonly>> asciiExitingApplication : string = " _____ _ _ _ _ _ _ _ _ \n | ____|_ _(_) |_(_)_ __ __ _ / \\ _ __ _ __ | (_) ___ __ _| |_(_) ___ _ __ \n | _| \\ \\/ / | __| | '_ \\ / _` | / _ \\ | '_ \\| '_ \\| | |/ __/ _` | __| |/ _ \\| '_ \\ \n | |___ > <| | |_| | | | | (_| | / ___ \\| |_) | |_) | | | (_| (_| | |_| | (_) | | | |\n |_____/_/\\_\\_|\\__|_|_| |_|\\__, | /_/ \\_\\ .__/| .__/|_|_|\\___\\__,_|\\__|_|\\___/|_| |_|\n |___/ |_| |_| "
+ Execute() : void
}
ICommand <|-- ExitCommand
Expand Down
28 changes: 14 additions & 14 deletions uml/src/KeyVaultCli.Application/Common/Constants/CommandFlag.puml
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
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@startuml
interface ICommand {
Execute() : void
}
@enduml
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
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
@startuml
class CreatePasswordCommand {
- <<readonly>> serviceNamePrompt : string = "Enter service name for the new password: "
- <<readonly>> accountNamePrompt : string = "Enter account name for the new password: "
- <<readonly>> passwordPrompt : string = "Enter the password: "
- <<readonly>> urlPrompt : string = "Enter the URL (leave empty if not applicable): "
- <<readonly>> categoryPrompt : string = "Enter the category (leave empty if not applicable): "
- <<readonly>> successMessage : string = "A new password has been created and stored for {0&#125;, {1&#125;."
+ Execute() : void
}
ICommand <|-- CreatePasswordCommand
Expand Down
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&#125;, {1&#125; with the value {2&#125;."
+ Execute() : void
- GetPasswordLength() : int
}
ICommand <|-- CreatePasswordGenerateCommand
@enduml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
@startuml
class DeleteAllPasswordsCommand {
- <<readonly>> confirmationPrompt : string = "Are you sure you want to delete all passwords?"
- <<readonly>> successMessage : string = "All passwords have been deleted."
- <<readonly>> errorMessage : string = "Operation cancelled."
+ Execute() : void
}
ICommand <|-- DeleteAllPasswordsCommand
Expand Down
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
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
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&#125;, {1&#125;:"
- <<readonly>> passwordNotFoundMessage : string = "No password entry found for service {0&#125;, account {1&#125;."
- <<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
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
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
@startuml
class UpdateMasterPasswordCommand {
- <<readonly>> oldPasswordPrompt : string = "Enter current master password: "
- <<readonly>> newPasswordPrompt : string = "Enter new master password: "
- <<readonly>> successMessage : string = "Master password has been updated."
- <<readonly>> errorMessage : string = "No need to update you entered the same passwords."
+ Execute() : void
}
ICommand <|-- UpdateMasterPasswordCommand
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
@startuml
class UpdatePasswordCommand {
- <<readonly>> currentServiceNamePrompt : string = "Enter current service name: "
- <<readonly>> currentAccountNamePrompt : string = "Enter current account name: "
- <<readonly>> newServiceNamePrompt : string = "Enter new service name: "
- <<readonly>> newAccountNamePrompt : string = "Enter new account name: "
- <<readonly>> newPasswordPrompt : string = "Enter new password: "
- <<readonly>> newUrlPrompt : string = "Enter new URL: "
- <<readonly>> newCategoryPrompt : string = "Enter new Category: "
- <<readonly>> successMessage : string = "The password entry has been updated."
- <<readonly>> errorMessage : string = "Failed to update the password entry. Ensure the service and account exists."
+ Execute() : void
}
ICommand <|-- UpdatePasswordCommand
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
@startuml
class UpdatePasswordGeneratedCommand {
- <<readonly>> oldServiceNamePrompt : string = "Enter old service name: "
- <<readonly>> oldAccountNamePrompt : string = "Enter old account name: "
- <<readonly>> newServiceNamePrompt : string = "Enter new service name: "
- <<readonly>> newAccountNamePrompt : string = "Enter new account name: "
- <<readonly>> newUrlPrompt : string = "Enter new URL: "
- <<readonly>> newCategoryPrompt : string = "Enter new Category: "
- <<readonly>> passwordLengthPrompt : string = "Enter the number of characters for the new password (e.g. 10): "
- <<readonly>> invalidLengthError : string = "Invalid input for password length. Ensure you enter a valid number."
- <<readonly>> successMessage : string = "Password entry for {0&#125;, {1&#125; has been updated with new details."
- <<readonly>> errorMessage : string = "Failed to update the password entry. Ensure the old service and account names are correct."
+ Execute() : void
}
ICommand <|-- UpdatePasswordGeneratedCommand
Expand Down
5 changes: 5 additions & 0 deletions uml/src/KeyVaultCli.Application/Services/VaultService.puml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,9 @@ class VaultService {
+ GetVault() : IVault
}
IVaultService <|-- VaultService
VaultService --> "_vaultConsoleService" IConsole
VaultService --> "_vaultEncryptionService" IVaultEncryptionService
VaultService --> "_vaultFileService" IVaultFileService
VaultService --> "_vaultPasswordGenerator" IVaultPasswordGenerator
VaultService --> "_vaultFactory" VaultFactory
@enduml
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
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
@startuml
class CreateVaultCommand {
- <<readonly>> passwordPrompt : string = "Enter your master password: "
+ Execute() : void
}
ICommand <|-- CreateVaultCommand
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
@startuml
class DeleteVaultCommand {
- <<readonly>> confirmationPrompt : string = "Are you sure you want to delete the vault?"
- <<readonly>> deleteSuccessMsg : string = "Deleted Vault with all passwords in it!"
- <<readonly>> deleteErrMsg : string = "Closing application, to create a new vault run the application again."
- <<readonly>> operationCancelMsg : string = "Operation cancelled."
+ Execute() : void
}
ICommand <|-- DeleteVaultCommand
Expand Down
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@startuml
interface ICompromisedPasswordService {
HasBeenCompromisedAsync(password:string) : Task<bool>
}
@enduml
9 changes: 9 additions & 0 deletions uml/src/KeyVaultCli.Domain/Common/Interfaces/IConsole.puml
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@startuml
interface IPasswordStrengthService {
IsStrongPassword(password:string) : bool
}
@enduml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@startuml
interface IPasswordUniquenessService {
IsUniquePasswordAsync(password:string) : Task<bool>
}
@enduml
1 change: 1 addition & 0 deletions uml/src/KeyVaultCli.Domain/Common/Interfaces/IVault.puml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ interface IVault {
+ DeletePasswordEntry(serviceName:string, accountName:string) : bool
+ DeleteAllPasswordEntries() : void
+ LoadPasswordEntries() : List<PasswordEntry>
+ GetAllDecryptedPasswords() : Dictionary<string, string>
+ GetPassword(serviceName:string, accountName:string) : string
+ GetPasswordEntry(serviceName:string, accountName:string) : PasswordEntry?
+ UpdatePasswordEntry(currentServiceName:string, currentAccountName:string, newServiceName:string, newAccountName:string, passwordLength:int, newPassword:string?, newUrl:string?, newCategory:string?) : bool
Expand Down
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
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
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
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@startuml
interface IVaultPasswordGenerator {
GeneratePassword(length:int) : string
}
@enduml
1 change: 1 addition & 0 deletions uml/src/KeyVaultCli.Domain/Entities/PasswordEntry.puml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class PasswordEntry {
+ UpdateUrl(newUrl:string) : void
+ UpdateCategory(newCategory:string) : void
+ UpdateEncryptedPassword(newPassword:string) : void
- UpdateLastModifiedDate() : void
}
PasswordEntry --> "EntryId" Guid
PasswordEntry --> "CreationDate" DateTime
Expand Down
10 changes: 10 additions & 0 deletions uml/src/KeyVaultCli.Domain/Entities/Vault.puml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
@startuml
class Vault {
- _masterPassword : string
- <<readonly>> _passwordEntryFilePath : string
- <<readonly>> _masterPasswordFilePath : string
+ Vault(vaultFilePath:string, masterPasswordFilePath:string, masterPassword:string, vaultEncryptionService:IVaultEncryptionService, vaultFileService:IVaultFileService, vaultPasswordGenerator:IVaultPasswordGenerator)
+ SaveMasterPassword() : void
+ LoadMasterPassword() : string?
Expand All @@ -9,6 +12,7 @@ class Vault {
+ DeletePasswordEntry(serviceName:string, accountName:string) : bool
+ DeleteAllPasswordEntries() : void
+ LoadPasswordEntries() : List<PasswordEntry>
+ GetAllDecryptedPasswords() : Dictionary<string, string>
+ GetPassword(serviceName:string, accountName:string) : string
+ GetPasswordEntry(serviceName:string, accountName:string) : PasswordEntry?
+ UpdatePasswordEntry(currentServiceName:string, currentAccountName:string, newServiceName:string, newAccountName:string, passwordLength:int, newPassword:string?, newUrl:string?, newCategory:string?) : bool
Expand All @@ -17,5 +21,11 @@ class Vault {
+ BackupVault(backupFilePath:string) : bool
+ RestoreVault(backupFilePath:string) : bool
}
class "List`1"<T> {
}
IVault <|-- Vault
Vault --> "_passwordEntries<PasswordEntry>" "List`1"
Vault --> "_vaultEncryptionService" IVaultEncryptionService
Vault --> "_vaultFileService" IVaultFileService
Vault --> "_vaultPasswordGenerator" IVaultPasswordGenerator
@enduml
Loading

0 comments on commit 255fd1f

Please sign in to comment.