integration: add SSH check mode tests
Add ReadLog method to headscale integration container for log inspection. Split SSH check mode tests into CLI and OIDC variants and add comprehensive test coverage: - TestSSHOneUserToOneCheckModeCLI: basic check mode with CLI approval - TestSSHOneUserToOneCheckModeOIDC: check mode with OIDC approval - TestSSHCheckModeUnapprovedTimeout: rejection on cache expiry - TestSSHCheckModeCheckPeriodCLI: session expiry and re-auth - TestSSHCheckModeAutoApprove: auto-approval within check period - TestSSHCheckModeNegativeCLI: explicit rejection via CLI Update existing integration tests to use headscale auth register. Updates #1850
This commit is contained in:
parent
7bab8da366
commit
3db0a483ed
8 changed files with 674 additions and 57 deletions
|
|
@ -1184,7 +1184,7 @@ func (s *Scenario) runHeadscaleRegister(userStr string, body string) error {
|
|||
return errParseAuthPage
|
||||
}
|
||||
|
||||
keySep := strings.Split(codeSep[0], "key ")
|
||||
keySep := strings.Split(codeSep[0], "--auth-id ")
|
||||
if len(keySep) != 2 {
|
||||
return errParseAuthPage
|
||||
}
|
||||
|
|
@ -1195,7 +1195,7 @@ func (s *Scenario) runHeadscaleRegister(userStr string, body string) error {
|
|||
|
||||
if headscale, err := s.Headscale(); err == nil { //nolint:noinlineerr
|
||||
_, err = headscale.Execute(
|
||||
[]string{"headscale", "nodes", "register", "--user", userStr, "--key", key},
|
||||
[]string{"headscale", "auth", "register", "--user", userStr, "--auth-id", key},
|
||||
)
|
||||
if err != nil {
|
||||
log.Printf("registering node: %s", err)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue