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

39
app.go
View file

@ -657,11 +657,10 @@ func (h *Headscale) getTLSSettings() (*tls.Config, error) {
log.Warn().Msg("Listening with TLS but ServerURL does not start with https://")
}
clientAuthMode, err := h.GetClientAuthMode()
if err != nil {
return nil, err
}
clientAuthMode, err := h.GetClientAuthMode()
if err != nil {
return nil, err
}
log.Info().Msg(fmt.Sprintf(
"Client authentication (mTLS) is \"%s\". See the docs to learn about configuring this setting.",
@ -683,22 +682,20 @@ 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.
return tls.NoClientCert, nil
case RelaxedClientAuth:
// Client cert required, but _not verified_.
return tls.RequireAnyClientCert, nil
case EnforcedClientAuth:
// Client cert is _required and verified_.
return tls.RequireAndVerifyClientCert, nil
default:
return tls.NoClientCert, Error("Invalid tls_client_auth_mode provided: " +
h.cfg.TLSClientAuthMode)
}
switch h.cfg.TLSClientAuthMode {
case DisabledClientAuth:
// Client cert is _not_ required.
return tls.NoClientCert, nil
case RelaxedClientAuth:
// Client cert required, but _not verified_.
return tls.RequireAnyClientCert, nil
case EnforcedClientAuth:
// Client cert is _required and verified_.
return tls.RequireAndVerifyClientCert, nil
default:
return tls.NoClientCert, Error("Invalid tls_client_auth_mode provided: " +
h.cfg.TLSClientAuthMode)
}
}
func (h *Headscale) setLastStateChangeToNow(namespace string) {