Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions internal/auth/authenticator.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ func (p *Authenticator) authenticate(rw http.ResponseWriter, req *http.Request)
}

logger.WithRemoteAddress(remoteAddr).WithUser(session.Email).Info(
fmt.Sprintf("authentication: user passed validation"))
"authentication: user passed validation")

return session, nil
}
Expand Down Expand Up @@ -600,7 +600,7 @@ func (p *Authenticator) getOAuthCallback(rw http.ResponseWriter, req *http.Reque
return "", HTTPError{Code: http.StatusForbidden, Message: errorMsg}
}
logger.WithRemoteAddress(remoteAddr).WithUser(session.Email).Info(
fmt.Sprintf("oauth callback: user passed validation"))
"oauth callback: user passed validation")

logger.WithRemoteAddress(remoteAddr).WithUser(session.Email).Info("authentication complete")
err = p.sessionStore.SaveSession(rw, req, session)
Expand Down Expand Up @@ -669,7 +669,7 @@ func (p *Authenticator) Redeem(rw http.ResponseWriter, req *http.Request) {
logger.WithUser(session.Email).WithRefreshDeadline(session.RefreshDeadline).WithLifetimeDeadline(session.LifetimeDeadline).Error("expired session")
p.sessionStore.ClearSession(rw, req)

http.Error(rw, fmt.Sprintf("expired session"), http.StatusUnauthorized)
http.Error(rw, "expired session", http.StatusUnauthorized)
return
}

Expand Down
3 changes: 1 addition & 2 deletions internal/pkg/validators/email_address_validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package validators

import (
"errors"
"fmt"
"strings"

"github.com/buzzfeed/sso/internal/pkg/sessions"
Expand Down Expand Up @@ -32,7 +31,7 @@ func NewEmailAddressValidator(allowedEmails []string) EmailAddressValidator {
var emailAddresses []string

for _, email := range allowedEmails {
emailAddress := fmt.Sprintf("%s", strings.ToLower(email))
emailAddress := strings.ToLower(email)
emailAddresses = append(emailAddresses, emailAddress)
}

Expand Down
4 changes: 2 additions & 2 deletions internal/proxy/oauthproxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ func (p *OAuthProxy) OAuthCallback(rw http.ResponseWriter, req *http.Request) {
}

logger.WithRemoteAddress(remoteAddr).WithUser(session.Email).WithInGroups(session.Groups).Info(
fmt.Sprintf("oauth callback: user validated "))
"oauth callback: user validated ")

// We add the request host into the session to allow us to validate that each request has
// been authorized for the upstream it's requesting.
Expand Down Expand Up @@ -733,7 +733,7 @@ func (p *OAuthProxy) Authenticate(rw http.ResponseWriter, req *http.Request) (er
}

logger.WithRemoteAddress(remoteAddr).WithUser(session.Email).Info(
fmt.Sprintf("authentication: user validated"))
"authentication: user validated")

for key, val := range p.upstreamConfig.InjectRequestHeaders {
req.Header.Set(key, val)
Expand Down
2 changes: 1 addition & 1 deletion internal/proxy/reverse_proxy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ func TestTimeoutHandler(t *testing.T) {
},
globalTimeout: time.Duration(100) * time.Millisecond,
ExpectedStatusCode: 503,
ExpectedBody: fmt.Sprintf("service-test failed to respond within the 10ms timeout period"),
ExpectedBody: "service-test failed to respond within the 10ms timeout period",
},
{
name: "times out using global write timeout",
Expand Down