ory-am/hydra

View on GitHub

Showing 412 of 865 total issues

Method Persister.GetLoginRequest has 5 return statements (exceeds 4 allowed).
Open

func (p *Persister) GetLoginRequest(ctx context.Context, loginChallenge string) (_ *flow.LoginRequest, err error) {
    ctx, span := p.r.Tracer(ctx).Tracer().Start(ctx, "persistence.sql.GetLoginRequest")
    defer otelx.End(span, &err)

    f, err := flowctx.Decode[flow.Flow](ctx, p.r.FlowCipher(), loginChallenge, flowctx.AsLoginChallenge)
Severity: Major
Found in persistence/sql/persister_consent.go - About 35 mins to fix

    Function NewListClientsCmd has 5 return statements (exceeds 4 allowed).
    Open

    func NewListClientsCmd() *cobra.Command {
        cmd := &cobra.Command{
            Use:     "oauth2-clients",
            Aliases: []string{"clients"},
            Short:   "List OAuth 2.0 Clients",
    Severity: Major
    Found in cmd/cmd_list_clients.go - About 35 mins to fix

      Function NewRevokeTokenCmd has 5 return statements (exceeds 4 allowed).
      Open

      func NewRevokeTokenCmd() *cobra.Command {
          cmd := &cobra.Command{
              Use:     "token the-token",
              Example: `{{ .CommandPath }} --client-id a0184d6c-b313-4e70-a0b9-905b581e9218 --client-secret Hh1BjioNNm ciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNT`,
              Args:    cobra.ExactArgs(1),
      Severity: Major
      Found in cmd/cmd_revoke_token.go - About 35 mins to fix

        Method Persister.GetFlowByConsentChallenge has 5 return statements (exceeds 4 allowed).
        Open

        func (p *Persister) GetFlowByConsentChallenge(ctx context.Context, challenge string) (_ *flow.Flow, err error) {
            ctx, span := p.r.Tracer(ctx).Tracer().Start(ctx, "persistence.sql.GetFlowByConsentChallenge")
            defer otelx.End(span, &err)
        
            // challenge contains the flow.
        Severity: Major
        Found in persistence/sql/persister_consent.go - About 35 mins to fix

          Method JanitorHandler.Args has 5 return statements (exceeds 4 allowed).
          Open

          func (*JanitorHandler) Args(cmd *cobra.Command, args []string) error {
              if len(args) == 0 &&
                  !flagx.MustGetBool(cmd, ReadFromEnv) &&
                  len(flagx.MustGetStringSlice(cmd, Config)) == 0 {
          
          
          Severity: Major
          Found in cmd/cli/handler_janitor.go - About 35 mins to fix

            Method Validator.ValidateDynamicRegistration has 5 return statements (exceeds 4 allowed).
            Open

            func (v *Validator) ValidateDynamicRegistration(ctx context.Context, c *Client) error {
                if c.Metadata != nil {
                    return errorsx.WithStack(ErrInvalidClientMetadata.
                        WithHint(`"metadata" cannot be set for dynamic client registration`),
                    )
            Severity: Major
            Found in client/validator.go - About 35 mins to fix

              Method migrationGroup.generateSQL has 5 return statements (exceeds 4 allowed).
              Open

              func (mg migrationGroup) generateSQL(sourceFS fs.FS, target string) error {
                  ms := mg.Children
                  if mg.fallbackDownMigration != nil {
                      ms = append(ms, mg.fallbackDownMigration)
                  }
              Severity: Major
              Found in cmd/cli/handler_migrate.go - About 35 mins to fix

                Method Handler.ValidDynamicAuth has 5 return statements (exceeds 4 allowed).
                Open

                func (h *Handler) ValidDynamicAuth(r *http.Request, ps httprouter.Params) (fosite.Client, error) {
                    c, err := h.r.ClientManager().GetConcreteClient(r.Context(), ps.ByName("id"))
                    if err != nil {
                        return nil, herodot.ErrUnauthorized.
                            WithTrace(err).
                Severity: Major
                Found in client/handler.go - About 35 mins to fix

                  Function NewPerformClientCredentialsCmd has 5 return statements (exceeds 4 allowed).
                  Open

                  func NewPerformClientCredentialsCmd() *cobra.Command {
                      cmd := &cobra.Command{
                          Use:     "client-credentials",
                          Args:    cobra.NoArgs,
                          Example: `{{ .CommandPath }} --client-id ... --client-secret`,
                  Severity: Major
                  Found in cmd/cmd_perform_client_credentials.go - About 35 mins to fix

                    Method DefaultProvider.getHookConfig has 5 return statements (exceeds 4 allowed).
                    Open

                    func (p *DefaultProvider) getHookConfig(ctx context.Context, key string) *HookConfig {
                        if hookURL := p.getProvider(ctx).RequestURIF(key, nil); hookURL != nil {
                            return &HookConfig{
                                URL: hookURL.String(),
                            }
                    Severity: Major
                    Found in driver/config/provider.go - About 35 mins to fix

                      Function NewCreateJWKSCmd has 5 return statements (exceeds 4 allowed).
                      Open

                      func NewCreateJWKSCmd() *cobra.Command {
                          const alg = "alg"
                          const use = "use"
                      
                          cmd := &cobra.Command{
                      Severity: Major
                      Found in cmd/cmd_create_jwks.go - About 35 mins to fix

                        Function NewGetJWKSCmd has 5 return statements (exceeds 4 allowed).
                        Open

                        func NewGetJWKSCmd() *cobra.Command {
                            cmd := &cobra.Command{
                                Use:     "jwk set-1 [set-2] ...",
                                Aliases: []string{"jwks"},
                                Args:    cobra.MinimumNArgs(1),
                        Severity: Major
                        Found in cmd/cmd_get_jwks.go - About 35 mins to fix

                          Method MigrateHandler.makePersister has 5 return statements (exceeds 4 allowed).
                          Open

                          func (h *MigrateHandler) makePersister(cmd *cobra.Command, args []string) (p persistence.Persister, err error) {
                              var d driver.Registry
                          
                              if flagx.MustGetBool(cmd, "read-from-env") {
                                  d, err = driver.New(
                          Severity: Major
                          Found in cmd/cli/handler_migrate.go - About 35 mins to fix

                            Function claimsFromVCResponse has 5 return statements (exceeds 4 allowed).
                            Open

                            func claimsFromVCResponse(t *testing.T, reg driver.Registry, vc *hydraoauth2.VerifiableCredentialResponse) (*jwt.Token, *hydraoauth2.VerifableCredentialClaims) {
                                ctx := context.Background()
                                token, err := jwt.ParseWithClaims(vc.Credential, new(hydraoauth2.VerifableCredentialClaims), func(token *jwt.Token) (interface{}, error) {
                                    kid, found := token.Header["kid"]
                                    if !found {
                            Severity: Major
                            Found in oauth2/oauth2_auth_code_test.go - About 35 mins to fix

                              Method Persister.VerifyAndInvalidateLogoutRequest has 5 return statements (exceeds 4 allowed).
                              Open

                              func (p *Persister) VerifyAndInvalidateLogoutRequest(ctx context.Context, verifier string) (_ *flow.LogoutRequest, err error) {
                                  ctx, span := p.r.Tracer(ctx).Tracer().Start(ctx, "persistence.sql.VerifyAndInvalidateLogoutRequest")
                                  defer otelx.End(span, &err)
                              
                                  var lr flow.LogoutRequest
                              Severity: Major
                              Found in persistence/sql/persister_consent.go - About 35 mins to fix

                                Method OAuth2RequestSQL.toRequest has 5 return statements (exceeds 4 allowed).
                                Open

                                func (r *OAuth2RequestSQL) toRequest(ctx context.Context, session fosite.Session, p *Persister) (_ *fosite.Request, err error) {
                                    ctx, span := p.r.Tracer(ctx).Tracer().Start(ctx, "persistence.sql.toRequest")
                                    defer otelx.End(span, &err)
                                
                                    sess := r.Session
                                Severity: Major
                                Found in persistence/sql/persister_oauth2.go - About 35 mins to fix

                                  Method Handler.oauth2TokenExchange has 5 return statements (exceeds 4 allowed).
                                  Open

                                  func (h *Handler) oauth2TokenExchange(w http.ResponseWriter, r *http.Request) {
                                      ctx := r.Context()
                                      session := NewSessionWithCustomClaims(ctx, h.c, "")
                                  
                                      accessRequest, err := h.r.OAuth2Provider().NewAccessRequest(ctx, r, session)
                                  Severity: Major
                                  Found in oauth2/handler.go - About 35 mins to fix

                                    Method Persister.deleteSessionByRequestID has 5 return statements (exceeds 4 allowed).
                                    Open

                                    func (p *Persister) deleteSessionByRequestID(ctx context.Context, id string, table tableName) (err error) {
                                        ctx, span := p.r.Tracer(ctx).Tracer().Start(ctx, "persistence.sql.deleteSessionByRequestID")
                                        defer otelx.End(span, &err)
                                    
                                        err = p.QueryWithNetwork(ctx).
                                    Severity: Major
                                    Found in persistence/sql/persister_oauth2.go - About 35 mins to fix

                                      Function OnlyPublicSDKKeys has 5 return statements (exceeds 4 allowed).
                                      Open

                                      func OnlyPublicSDKKeys(in []hydra.JsonWebKey) (out []hydra.JsonWebKey, _ error) {
                                          var interim []jose.JSONWebKey
                                          var b bytes.Buffer
                                      
                                          if err := json.NewEncoder(&b).Encode(&in); err != nil {
                                      Severity: Major
                                      Found in jwk/helper.go - About 35 mins to fix

                                        Method Handler.performOidcFrontOrBackChannelLogout has 5 return statements (exceeds 4 allowed).
                                        Open

                                        func (h *Handler) performOidcFrontOrBackChannelLogout(w http.ResponseWriter, r *http.Request, _ httprouter.Params) {
                                            ctx := r.Context()
                                        
                                            handled, err := h.r.ConsentStrategy().HandleOpenIDConnectLogout(ctx, w, r)
                                            if errors.Is(err, consent.ErrAbortOAuth2Request) {
                                        Severity: Major
                                        Found in oauth2/handler.go - About 35 mins to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language