feat(ssh): Support authless SSH health check (#956)

* Feature + Test +  Documentation: added no-auth ssh health cheack feature, changed documentation to fit new behavior, added ssh test cases.

* Refactor: refactored authenticate field to infer from username and password insted of specifying it inside config.

* Refactor: removed non used field.

* Refactor: changed error, removed spaces.

* Refactor: added comments.
This commit is contained in:
Rani
2025-01-19 23:22:41 +02:00
committed by GitHub
parent 0bba77ab2b
commit fa3e5dcc6e
6 changed files with 99 additions and 4 deletions

View File

@ -19,6 +19,10 @@ type Config struct {
// Validate the SSH configuration
func (cfg *Config) Validate() error {
// If there's no username and password, this endpoint can still check the SSH banner, so the endpoint is still valid
if len(cfg.Username) == 0 && len(cfg.Password) == 0 {
return nil
}
if len(cfg.Username) == 0 {
return ErrEndpointWithoutSSHUsername
}