Skip to content
Merged
Prev Previous commit
Next Next commit
make lint / make gen
Signed-off-by: Danny Kopping <danny@coder.com>
  • Loading branch information
dannykopping committed Jul 16, 2024
commit 01d4f2f4d743bd0914f0d1257946448ef9f50eec
11 changes: 6 additions & 5 deletions coderd/apidoc/docs.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 6 additions & 5 deletions coderd/apidoc/swagger.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 6 additions & 3 deletions coderd/notifications/dispatch/smtp.go
Original file line number Diff line number Diff line change
Expand Up @@ -327,8 +327,8 @@ func (s *SMTPHandler) client(ctx context.Context, host string, port string) (*sm
}

// Align with context deadline.
c.CommandTimeout = deadline.Sub(time.Now())
c.SubmissionTimeout = deadline.Sub(time.Now())
c.CommandTimeout = time.Until(deadline)
c.SubmissionTimeout = time.Until(deadline)

return c, nil
}
Expand Down Expand Up @@ -360,7 +360,8 @@ func (s *SMTPHandler) tlsConfig() (*tls.Config, error) {
}

return &tls.Config{
ServerName: srvName,
ServerName: srvName,
// nolint:gosec // Users may choose to enable this.
InsecureSkipVerify: s.cfg.TLS.InsecureSkipVerify.Value(),

RootCAs: ca,
Expand All @@ -371,6 +372,7 @@ func (s *SMTPHandler) tlsConfig() (*tls.Config, error) {

func (s *SMTPHandler) loadCAFile() (*x509.CertPool, error) {
if s.cfg.TLS.CAFile == "" {
// nolint:nilnil // A nil CertPool is a valid response.
return nil, nil
}

Expand All @@ -389,6 +391,7 @@ func (s *SMTPHandler) loadCAFile() (*x509.CertPool, error) {

func (s *SMTPHandler) loadCertificate() (*tls.Certificate, error) {
if len(s.cfg.TLS.CertFile) == 0 && len(s.cfg.TLS.KeyFile) == 0 {
// nolint:nilnil // A nil certificate is a valid response.
return nil, nil
}

Expand Down
1 change: 1 addition & 0 deletions coderd/notifications/dispatch/smtp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,7 @@ func TestSMTP(t *testing.T) {
},
}

// nolint:paralleltest // Reinitialization is not required as of Go v1.22.
for _, tc := range tests {
t.Run(tc.name, func(t *testing.T) {
t.Parallel()
Expand Down
6 changes: 4 additions & 2 deletions coderd/notifications/dispatch/smtp_util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,13 @@ func (s *Session) Data(r io.Reader) error {
return nil
}

func (s *Session) Reset() {}
func (*Session) Reset() {}

func (s *Session) Logout() error { return nil }
func (*Session) Logout() error { return nil }

// nolint:revive // Yes, useTLS is a control flag.
func createMockSMTPServer(be *Backend, useTLS bool) (*smtp.Server, net.Listener, error) {
// nolint:gosec
tlsCfg := &tls.Config{
GetCertificate: readCert,
}
Expand Down
16 changes: 8 additions & 8 deletions docs/api/schemas.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.