oauth2-proxy/mockoidc

View on GitHub
handlers.go

Summary

Maintainability
A
3 hrs
Test Coverage

Method MockOIDC.Token has 8 return statements (exceeds 4 allowed).
Open

func (m *MockOIDC) Token(rw http.ResponseWriter, req *http.Request) {
    err := req.ParseForm()
    if err != nil {
        internalServerError(rw, err.Error())
        return
Severity: Major
Found in handlers.go - About 50 mins to fix

    Method MockOIDC.Authorize has 8 return statements (exceeds 4 allowed).
    Open

    func (m *MockOIDC) Authorize(rw http.ResponseWriter, req *http.Request) {
        err := req.ParseForm()
        if err != nil {
            internalServerError(rw, err.Error())
            return
    Severity: Major
    Found in handlers.go - About 50 mins to fix

      Method MockOIDC.validateRefreshGrant has 5 return statements (exceeds 4 allowed).
      Open

      func (m *MockOIDC) validateRefreshGrant(rw http.ResponseWriter, req *http.Request) (*Session, bool) {
          if !assertPresence([]string{"refresh_token"}, rw, req) {
              return nil, false
          }
      
      
      Severity: Major
      Found in handlers.go - About 35 mins to fix

        Method MockOIDC.authorizeToken has 5 return statements (exceeds 4 allowed).
        Open

        func (m *MockOIDC) authorizeToken(t string, rw http.ResponseWriter) (*jwt.Token, bool) {
            token, err := m.Keypair.VerifyJWT(t, m.Now)
            if err != nil {
                errorResponse(rw, InvalidRequest, fmt.Sprintf("Invalid token: %v", err), http.StatusUnauthorized)
                return nil, false
        Severity: Major
        Found in handlers.go - About 35 mins to fix

          Method MockOIDC.validateCodeChallenge has 5 return statements (exceeds 4 allowed).
          Open

          func (m *MockOIDC) validateCodeChallenge(rw http.ResponseWriter, req *http.Request, session *Session) bool {
              if session.CodeChallenge == "" || session.CodeChallengeMethod == "" {
                  return true
              }
          
          
          Severity: Major
          Found in handlers.go - About 35 mins to fix

            There are no issues that match your filters.

            Category
            Status