Remove token traces
@@ -12,7 +12,6 @@ import (
"github.com/hellofresh/janus/pkg/render"
"github.com/pkg/errors"
log "github.com/sirupsen/logrus"
- "go.opencensus.io/trace"
"golang.org/x/oauth2"
)
@@ -30,9 +29,7 @@ type Handler struct {
// Reply will be of the form {"token": "<TOKEN>"}.
func (j *Handler) Login(config config.Credentials) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
- _, span := trace.StartSpan(r.Context(), "token.extract")
accessToken, err := extractAccessToken(r)
- span.End()
if err != nil {
log.WithError(err).Debug("failed to extract access token")
@@ -42,9 +39,7 @@ func (j *Handler) Login(config config.Credentials) http.HandlerFunc {
factory := provider.Factory{}
p := factory.Build(r.URL.Query().Get("provider"), config)
- _, span = trace.StartSpan(r.Context(), "token.verify")
verified, err := p.Verify(r, httpClient)
- span.End()
if err != nil || !verified {
log.WithError(err).Debug(err.Error())
@@ -62,9 +57,7 @@ func (j *Handler) Login(config config.Credentials) http.HandlerFunc {
return
}
- _, span = trace.StartSpan(r.Context(), "token.issue_admin")
token, err := IssueAdminToken(j.Guard.SigningMethod, claims, j.Guard.Timeout)
- span.End()
if err != nil {
render.JSON(w, http.StatusUnauthorized, "problem issuing JWT")
