provs/doc/dev/architecture.md

77 lines
1.8 KiB
Markdown
Raw Normal View History

2023-08-03 16:40:23 +00:00
## Initialization
```mermaid
sequenceDiagram
actor user
participant app as Application
participant ds as DesktopService
participant gtr as KnownHost
2023-08-03 16:43:18 +00:00
participant pa as CliArgumentsParser
participant cr as DesktopConfigRepository
2023-08-03 16:40:23 +00:00
participant ut as CliUtils
participant su as ProvsWithSudo
2023-08-03 16:43:18 +00:00
2023-08-03 16:40:23 +00:00
user ->> app: main
activate app
app ->> pa: parseCommands
app ->> cr: getConfig(configFileName)
app ->> ut: createProvInstance(cmd.target)
app ->> su: ensureSudoWithoutPassword(cmd.target.remoteTarget()?.password)
app ->> ds: provisionDesktopCommand(cmd, config)
activate ds
ds ->> gtr: values()
gtr -->> ds: List(KnownHost)
2023-08-03 16:40:23 +00:00
deactivate ds
deactivate app
```
## Domain
```mermaid
classDiagram
2023-08-03 16:45:59 +00:00
2023-08-03 16:40:23 +00:00
namespace configuration {
2023-08-03 16:45:59 +00:00
2023-08-03 16:40:23 +00:00
class TargetCliCommand {
val target: String,
val passwordInteractive: Boolean = false
}
2023-08-03 16:45:59 +00:00
2023-08-03 16:40:23 +00:00
class ConfigFileName {
fileName: String
2023-08-03 16:45:59 +00:00
}
2023-08-03 16:40:23 +00:00
}
namespace desktop {
2023-08-03 16:45:59 +00:00
2023-08-03 16:40:23 +00:00
class DesktopCliCommand {
}
class DesktopConfig {
val ssh: SshKeyPairSource? = null,
val gpg: KeyPairSource? = null,
val gitUserName: String? = null,
val gitEmail: String? = null,
}
class DesktopType {
val name: String
}
class DesktopOnlyModule {
<<enum>>
FIREFOX, VERIFY
}
class KnownHost {
hostName: String,
hostKeys: List<HostKey>
}
2023-08-03 16:40:23 +00:00
}
DesktopCliCommand "1" *-- "1" DesktopType: type
DesktopCliCommand "1" *-- "1" TargetCliCommand: target
DesktopCliCommand "1" *-- "1" ConfigFileName: configFile
DesktopCliCommand "1" *-- "..n" DesktopOnlyModule: onlyModules
```