1
0
mirror of https://github.com/juanfont/headscale.git synced 2024-10-17 20:05:55 +02:00

linting again

This commit is contained in:
Justin Angel 2022-01-31 10:27:43 -05:00
parent 9de5c7f8b8
commit da5250ea32
2 changed files with 30 additions and 36 deletions

3
app.go
View File

@ -658,7 +658,6 @@ func (h *Headscale) getTLSSettings() (*tls.Config, error) {
}
clientAuthMode, err := h.GetClientAuthMode()
if err != nil {
return nil, err
}
@ -683,7 +682,6 @@ func (h *Headscale) getTLSSettings() (*tls.Config, error) {
// Look up the TLS constant relative to user-supplied TLS client
// authentication mode.
func (h *Headscale) GetClientAuthMode() (tls.ClientAuthType, error) {
switch h.cfg.TLSClientAuthMode {
case DisabledClientAuth:
// Client cert is _not_ required.
@ -698,7 +696,6 @@ func (h *Headscale) GetClientAuthMode() (tls.ClientAuthType, error) {
return tls.NoClientCert, Error("Invalid tls_client_auth_mode provided: " +
h.cfg.TLSClientAuthMode)
}
}
func (h *Headscale) setLastStateChangeToNow(namespace string) {

View File

@ -72,16 +72,13 @@ func (s *Suite) TestInvalidClientAuthMode(c *check.C){
c.Assert(err, check.NotNil)
}
// Ensure that all client auth modes return a nil error
// Ensure that all client auth modes return a nil error.
func (s *Suite) TestAuthModes(c *check.C) {
var modes = []string{"disabled", "relaxed", "enforced"}
modes := []string{"disabled", "relaxed", "enforced"}
for _, v := range modes {
app.cfg.TLSClientAuthMode = v
_, err := app.GetClientAuthMode()
c.Assert(err, check.IsNil)
}
}