title Cloudfix credentials handling

participant "User" as u
participant "Extension client" as ec
participant "Extension server" as es


u->ec: Run "Cloudfix-linter: init"
activate ec
ec->ec: Call CLI's init command
ec->ec: Check if Cloudfix username \nand password was set
alt Cloudfix creds haven't been set
ec-->u: Show username inputbox
u->ec: Get username
ec-->u: Show password inputbox
u->ec: Get password
ec->ec: Save creds in secrets
ec->es: Execute cloudfix-linter.setCreds(username, password) command
activate es
es->es: Save username and password so that\n they are used during the reco command
deactivate es
ec-->u: Show message: "Cloudfix credentials saved"
else Cloudfix creds are already set
ec->es: Execute cloudfix-linter.setCreds(username, password) command
activate es
es->es: Save username and password so that\n they are used during the reco command
deactivate es
end
deactivate ec

u->ec: Run "Cloudfix-linter: Reset cloudfix credentials"
activate ec
ec-->u: Show username inputbox
u->ec: Get username
ec-->u: Show password inputbox
u->ec: Get password
ec->ec: Save creds in secrets
ec->es: Execute cloudfix-linter.setCreds(username, password) command
activate es
es->es: Save username and password so that\n they are used during the reco command
deactivate es
ec-->u: Show message: "Cloudfix credentials saved"
