ory-am/hydra

View on GitHub

Showing 412 of 865 total issues

Method DefaultStrategy.requestConsent has 6 return statements (exceeds 4 allowed).
Open

func (s *DefaultStrategy) requestConsent(
    ctx context.Context,
    w http.ResponseWriter,
    r *http.Request,
    ar fosite.AuthorizeRequester,
Severity: Major
Found in consent/strategy_default.go - About 40 mins to fix

    Method OidcAPIService.RevokeOidcSessionExecute has 6 return statements (exceeds 4 allowed).
    Open

    func (a *OidcAPIService) RevokeOidcSessionExecute(r ApiRevokeOidcSessionRequest) (*http.Response, error) {
        var (
            localVarHTTPMethod = http.MethodGet
            localVarPostBody   interface{}
            formFiles          []formFile
    Severity: Major
    Found in internal/httpclient/api_oidc.go - About 40 mins to fix

      Method MigrateHandler.MigrateStatus has 6 return statements (exceeds 4 allowed).
      Open

      func (h *MigrateHandler) MigrateStatus(cmd *cobra.Command, args []string) error {
          p, err := h.makePersister(cmd, args)
          if err != nil {
              return err
          }
      Severity: Major
      Found in cmd/cli/handler_migrate.go - About 40 mins to fix

        Function serve has 6 return statements (exceeds 4 allowed).
        Open

        func serve(
            ctx context.Context,
            d driver.Registry,
            cmd *cobra.Command,
            wg *sync.WaitGroup,
        Severity: Major
        Found in cmd/server/handler.go - About 40 mins to fix

          Function NewCreateClientsCommand has 6 return statements (exceeds 4 allowed).
          Open

          func NewCreateClientsCommand() *cobra.Command {
              cmd := &cobra.Command{
                  Use:     "oauth2-client",
                  Short:   "Create an OAuth 2.0 Client",
                  Aliases: []string{"client"},
          Severity: Major
          Found in cmd/cmd_create_client.go - About 40 mins to fix

            Method router.consentGET has 6 return statements (exceeds 4 allowed).
            Open

            func (rt *router) consentGET(w http.ResponseWriter, r *http.Request, _ httprouter.Params) {
                req, raw, err := rt.cl.OAuth2API.GetOAuth2ConsentRequest(r.Context()).
                    ConsentChallenge(r.URL.Query().Get("consent_challenge")).
                    Execute()
                if err != nil {
            Severity: Major
            Found in cmd/cmd_perform_authorization_code.go - About 40 mins to fix

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

              func (h *Handler) setOidcDynamicClient(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
                  if err := h.requireDynamicAuth(r); err != nil {
                      h.r.Writer().WriteError(w, r, err)
                      return
                  }
              Severity: Major
              Found in client/handler.go - About 40 mins to fix

                Method Persister.VerifyAndInvalidateConsentRequest has 6 return statements (exceeds 4 allowed).
                Open

                func (p *Persister) VerifyAndInvalidateConsentRequest(ctx context.Context, verifier string) (_ *flow.AcceptOAuth2ConsentRequest, err error) {
                    ctx, span := p.r.Tracer(ctx).Tracer().Start(ctx, "persistence.sql.VerifyAndInvalidateConsentRequest")
                    defer otelx.End(span, &err)
                
                    f, err := flowctx.Decode[flow.Flow](ctx, p.r.FlowCipher(), verifier, flowctx.AsConsentVerifier)
                Severity: Major
                Found in persistence/sql/persister_consent.go - About 40 mins to fix

                  Method RegistrySQL.HealthHandler has 6 return statements (exceeds 4 allowed).
                  Open

                  func (m *RegistrySQL) HealthHandler() *healthx.Handler {
                      if m.hh == nil {
                          m.hh = healthx.NewHandler(m.Writer(), m.buildVersion, healthx.ReadyCheckers{
                              "database": func(_ *http.Request) error {
                                  return m.Ping()
                  Severity: Major
                  Found in driver/registry_sql.go - About 40 mins to fix

                    Function NewUpdateClientCmd has 6 return statements (exceeds 4 allowed).
                    Open

                    func NewUpdateClientCmd() *cobra.Command {
                        cmd := &cobra.Command{
                            Use:     "oauth2-client [id]",
                            Aliases: []string{"client"},
                            Short:   "Update an OAuth 2.0 Client",
                    Severity: Major
                    Found in cmd/cmd_update_client.go - About 40 mins to fix

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

                      func (h *Handler) getOidcUserInfo(w http.ResponseWriter, r *http.Request) {
                          ctx := r.Context()
                          session := NewSessionWithCustomClaims(ctx, h.c, "")
                          tokenType, ar, err := h.r.OAuth2Provider().IntrospectToken(ctx, fosite.AccessTokenFromRequest(r), fosite.AccessToken, session)
                          if err != nil {
                      Severity: Major
                      Found in oauth2/handler.go - About 40 mins to fix

                        Function GetOrGenerateKeys has 6 return statements (exceeds 4 allowed).
                        Open

                        func GetOrGenerateKeys(ctx context.Context, r InternalRegistry, m Manager, set, kid, alg string) (private *jose.JSONWebKey, err error) {
                            getLock(set).Lock()
                            defer getLock(set).Unlock()
                        
                            keys, err := m.GetKeySet(ctx, set)
                        Severity: Major
                        Found in jwk/helper.go - About 40 mins to fix

                          Method GrantValidator.Validate has 6 return statements (exceeds 4 allowed).
                          Open

                          func (v *GrantValidator) Validate(request createGrantRequest) error {
                              if request.Issuer == "" {
                                  return errorsx.WithStack(ErrMissingRequiredParameter.WithHint("Field 'issuer' is required."))
                              }
                          
                          
                          Severity: Major
                          Found in oauth2/trust/validator.go - About 40 mins to fix

                            Method Persister.findSessionBySignature has 6 return statements (exceeds 4 allowed).
                            Open

                            func (p *Persister) findSessionBySignature(ctx context.Context, signature string, session fosite.Session, table tableName) (fosite.Requester, error) {
                                r := OAuth2RequestSQL{Table: table}
                                err := p.QueryWithNetwork(ctx).Where("signature = ?", signature).First(&r)
                                if errors.Is(err, sql.ErrNoRows) {
                                    return nil, errorsx.WithStack(fosite.ErrNotFound)
                            Severity: Major
                            Found in persistence/sql/persister_oauth2.go - About 40 mins to fix

                              Method DefaultStrategy.verifyAuthentication has 5 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                  ctx context.Context,
                                  w http.ResponseWriter,
                                  r *http.Request,
                                  req fosite.AuthorizeRequester,
                                  verifier string,
                              Severity: Minor
                              Found in consent/strategy_default.go - About 35 mins to fix

                                Function makeOAuth2Request has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                func makeOAuth2Request(t *testing.T, reg driver.Registry, hc *http.Client, oc *client.Client, values url.Values) (gjson.Result, *http.Response) {
                                Severity: Minor
                                Found in consent/strategy_default_test.go - About 35 mins to fix

                                  Method DefaultStrategy.requestConsent has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                      ctx context.Context,
                                      w http.ResponseWriter,
                                      r *http.Request,
                                      ar fosite.AuthorizeRequester,
                                      f *flow.Flow,
                                  Severity: Minor
                                  Found in consent/strategy_default.go - About 35 mins to fix

                                    Function ValidateCsrfSession has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                    Open

                                    func ValidateCsrfSession(r *http.Request, conf x.CookieConfigProvider, store sessions.Store, name, expectedCSRF string, f *flow.Flow) error {
                                    Severity: Minor
                                    Found in consent/csrf.go - About 35 mins to fix

                                      Function testRegistry has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                      Open

                                      func testRegistry(t *testing.T, ctx context.Context, k string, t1 driver.Registry, t2 driver.Registry) {
                                      Severity: Minor
                                      Found in persistence/sql/persister_test.go - About 35 mins to fix

                                        Function cleanupRun has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                        Open

                                        func cleanupRun(ctx context.Context, notAfter time.Time, limit int, batchSize int, routines ...cleanupRoutine) error {
                                        Severity: Minor
                                        Found in cmd/cli/handler_janitor.go - About 35 mins to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language