ory-am/hydra

View on GitHub

Showing 402 of 849 total issues

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

func New(ctx context.Context, sl *servicelocatorx.Options, opts []OptionsModifier) (Registry, error) {
    o := newOptions()
    for _, f := range opts {
        f(o)
    }
Severity: Major
Found in driver/factory.go - About 40 mins to fix

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

    func (m *RegistryBase) HealthHandler() *healthx.Handler {
        if m.hh == nil {
            m.hh = healthx.NewHandler(m.Writer(), m.buildVersion, healthx.ReadyCheckers{
                "database": func(_ *http.Request) error {
                    return m.r.Ping()
    Severity: Major
    Found in driver/registry_base.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

        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

          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 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

              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

                  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 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.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

                        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 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 UpdateClientTokenLifespans has 5 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                            func UpdateClientTokenLifespans(t *testing.T, conf *oauth2.Config, clientID string, lifespans client.Lifespans, adminTS *httptest.Server) {
                            Severity: Minor
                            Found in internal/testhelpers/oauth2.go - About 35 mins to fix

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

                              func newRegistryDefault(t testing.TB, url string, c *config.DefaultProvider, migrate bool, ctxer contextx.Contextualizer) driver.Registry {
                              Severity: Minor
                              Found in internal/driver.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

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

                                  func NewOAuth2LoginRequest(challenge string, client OAuth2Client, requestUrl string, skip bool, subject string) *OAuth2LoginRequest {
                                  Severity: Minor
                                  Found in internal/httpclient/model_o_auth2_login_request.go - About 35 mins to fix

                                    Method Persister.sqlSchemaFromRequest has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                    Open

                                    func (p *Persister) sqlSchemaFromRequest(ctx context.Context, signature string, r fosite.Requester, table tableName, expiresAt time.Time) (*OAuth2RequestSQL, error) {
                                    Severity: Minor
                                    Found in persistence/sql/persister_oauth2.go - About 35 mins to fix

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

                                      func TestHelperManagerKeySet(m Manager, algo string, keys *jose.JSONWebKeySet, suffix string, parallel bool) func(t *testing.T) {
                                      Severity: Minor
                                      Found in jwk/manager_test_helpers.go - About 35 mins to fix

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

                                        func doTestCommit(m InternalRegistry, t *testing.T,
                                            createFn func(context.Context, string, fosite.Requester) error,
                                            getFn func(context.Context, string, fosite.Session) (fosite.Requester, error),
                                            revokeFn func(context.Context, string) error,
                                        Severity: Minor
                                        Found in oauth2/fosite_store_helpers.go - About 35 mins to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language