portainer/portainer

View on GitHub
api/http/handler/auth/authenticate.go

Summary

Maintainability
A
1 hr
Test Coverage

Method Handler.authenticate has 7 return statements (exceeds 4 allowed).
Open

func (handler *Handler) authenticate(rw http.ResponseWriter, r *http.Request) *httperror.HandlerError {
    var payload authenticatePayload
    err := request.DecodeAndValidateJSONPayload(r, &payload)
    if err != nil {
        return httperror.BadRequest("Invalid request payload", err)
Severity: Major
Found in api/http/handler/auth/authenticate.go - About 45 mins to fix

    Method Handler.syncUserTeamsWithLDAPGroups has 6 return statements (exceeds 4 allowed).
    Open

    func (handler *Handler) syncUserTeamsWithLDAPGroups(user *portainer.User, settings *portainer.LDAPSettings) error {
        // only sync if there is a group base DN
        if len(settings.GroupSearchSettings) == 0 || len(settings.GroupSearchSettings[0].GroupBaseDN) == 0 {
            return nil
        }
    Severity: Major
    Found in api/http/handler/auth/authenticate.go - About 40 mins to fix

      There are no issues that match your filters.

      Category
      Status