ory-am/hydra

View on GitHub

Showing 412 of 865 total issues

Function NewImportClientCmd has 8 return statements (exceeds 4 allowed).
Open

func NewImportClientCmd() *cobra.Command {
    cmd := &cobra.Command{
        Use:     "oauth2-client <file-1.json> [<file-2.json> ...]",
        Aliases: []string{"client", "clients", "oauth2-clients"},
        Short:   "Import one or more OAuth 2.0 Clients from files or STDIN",
Severity: Major
Found in cmd/cmd_import_client.go - About 50 mins to fix

    Function NewPerformAuthorizationCodeCmd has 8 return statements (exceeds 4 allowed).
    Open

    func NewPerformAuthorizationCodeCmd() *cobra.Command {
        cmd := &cobra.Command{
            Use:     "authorization-code",
            Example: "{{ .CommandPath }} --client-id ... --client-secret ...",
            Short:   "Example OAuth 2.0 Client performing the OAuth 2.0 Authorize Code Flow",
    Severity: Major
    Found in cmd/cmd_perform_authorization_code.go - About 50 mins to fix

      Method KeyManager.GenerateAndPersistKeySet has 8 return statements (exceeds 4 allowed).
      Open

      func (m *KeyManager) GenerateAndPersistKeySet(ctx context.Context, set, kid, alg, use string) (_ *jose.JSONWebKeySet, err error) {
          ctx, span := otel.GetTracerProvider().Tracer(tracingComponent).Start(ctx, "hsm.GenerateAndPersistKeySet",
              trace.WithAttributes(
                  attribute.String("set", set),
                  attribute.String("kid", kid),
      Severity: Major
      Found in hsm/manager_hsm.go - About 50 mins to fix

        Function ManagerTests has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        func ManagerTests(deps Deps, m consent.Manager, clientManager client.Manager, fositeManager x.FositeStorer, network string, parallel bool) func(t *testing.T) {
        Severity: Minor
        Found in consent/test/manager_test_helpers.go - About 45 mins to fix

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

          func (h *Handler) acceptOAuth2ConsentRequest(w http.ResponseWriter, r *http.Request, _ httprouter.Params) {
              ctx := r.Context()
          
              challenge := stringsx.Coalesce(
                  r.URL.Query().Get("consent_challenge"),
          Severity: Major
          Found in consent/handler.go - About 45 mins to fix

            Method DefaultStrategy.executeBackChannelLogout has 7 return statements (exceeds 4 allowed).
            Open

            func (s *DefaultStrategy) executeBackChannelLogout(r *http.Request, subject, sid string) error {
                ctx := r.Context()
                clients, err := s.r.ConsentManager().ListUserAuthenticatedClientsWithBackChannelLogout(ctx, subject, sid)
                if err != nil {
                    return err
            Severity: Major
            Found in consent/strategy_default.go - About 45 mins to fix

              Method OidcAPIService.DeleteOidcDynamicClientExecute has 7 return statements (exceeds 4 allowed).
              Open

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

                Method OAuth2APIService.DeleteOAuth2ClientExecute has 7 return statements (exceeds 4 allowed).
                Open

                func (a *OAuth2APIService) DeleteOAuth2ClientExecute(r ApiDeleteOAuth2ClientRequest) (*http.Response, error) {
                    var (
                        localVarHTTPMethod = http.MethodDelete
                        localVarPostBody   interface{}
                        formFiles          []formFile
                Severity: Major
                Found in internal/httpclient/api_o_auth2.go - About 45 mins to fix

                  Method DefaultStrategy.forwardConsentRequest has 6 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 45 mins to fix

                    Method DefaultStrategy.forwardConsentRequest has 7 return statements (exceeds 4 allowed).
                    Open

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

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

                      func (h *Handler) rejectOAuth2LoginRequest(w http.ResponseWriter, r *http.Request, _ httprouter.Params) {
                          ctx := r.Context()
                      
                          challenge := stringsx.Coalesce(
                              r.URL.Query().Get("login_challenge"),
                      Severity: Major
                      Found in consent/handler.go - About 45 mins to fix

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

                        func (h *Handler) rejectOAuth2ConsentRequest(w http.ResponseWriter, r *http.Request, _ httprouter.Params) {
                            ctx := r.Context()
                        
                            challenge := stringsx.Coalesce(
                                r.URL.Query().Get("consent_challenge"),
                        Severity: Major
                        Found in consent/handler.go - About 45 mins to fix

                          Method OAuth2APIService.RevokeOAuth2LoginSessionsExecute has 7 return statements (exceeds 4 allowed).
                          Open

                          func (a *OAuth2APIService) RevokeOAuth2LoginSessionsExecute(r ApiRevokeOAuth2LoginSessionsRequest) (*http.Response, error) {
                              var (
                                  localVarHTTPMethod = http.MethodDelete
                                  localVarPostBody   interface{}
                                  formFiles          []formFile
                          Severity: Major
                          Found in internal/httpclient/api_o_auth2.go - About 45 mins to fix

                            Method OAuth2APIService.DeleteTrustedOAuth2JwtGrantIssuerExecute has 7 return statements (exceeds 4 allowed).
                            Open

                            func (a *OAuth2APIService) DeleteTrustedOAuth2JwtGrantIssuerExecute(r ApiDeleteTrustedOAuth2JwtGrantIssuerRequest) (*http.Response, error) {
                                var (
                                    localVarHTTPMethod = http.MethodDelete
                                    localVarPostBody   interface{}
                                    formFiles          []formFile
                            Severity: Major
                            Found in internal/httpclient/api_o_auth2.go - About 45 mins to fix

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

                              func New(ctx context.Context, sl *servicelocatorx.Options, opts []OptionsModifier) (Registry, error) {
                                  o := NewOptions(opts)
                              
                                  l := sl.Logger()
                                  if l == nil {
                              Severity: Major
                              Found in driver/factory.go - About 45 mins to fix

                                Method Persister.migrateOldMigrationTables has 7 return statements (exceeds 4 allowed).
                                Open

                                func (p *Persister) migrateOldMigrationTables() error {
                                    if err := p.conn.RawQuery(fmt.Sprintf("SELECT * FROM %s", clientMigrationTableName)).Exec(); err != nil {
                                        // assume there are no old migration tables => done
                                        return nil
                                    }
                                Severity: Major
                                Found in persistence/sql/persister_migration.go - About 45 mins to fix

                                  Avoid deeply nested control flow statements.
                                  Open

                                      } else if s, ok := body.(*string); ok {
                                          _, err = bodyBuf.WriteString(*s)
                                      } else if JsonCheck.MatchString(contentType) {
                                          err = json.NewEncoder(bodyBuf).Encode(body)
                                      } else if XmlCheck.MatchString(contentType) {
                                  Severity: Major
                                  Found in internal/httpclient/client.go - About 45 mins to fix

                                    Function NewRegistryFromDSN has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                    Open

                                    func NewRegistryFromDSN(ctx context.Context, c *config.DefaultProvider, l *logrusx.Logger, skipNetworkInit bool, migrate bool, ctxer contextx.Contextualizer) (Registry, error) {
                                    Severity: Minor
                                    Found in driver/registry.go - About 45 mins to fix

                                      Method JwkAPIService.DeleteJsonWebKeySetExecute has 7 return statements (exceeds 4 allowed).
                                      Open

                                      func (a *JwkAPIService) DeleteJsonWebKeySetExecute(r ApiDeleteJsonWebKeySetRequest) (*http.Response, error) {
                                          var (
                                              localVarHTTPMethod = http.MethodDelete
                                              localVarPostBody   interface{}
                                              formFiles          []formFile
                                      Severity: Major
                                      Found in internal/httpclient/api_jwk.go - About 45 mins to fix

                                        Avoid deeply nested control flow statements.
                                        Open

                                                } else if tt == fosite.IDToken && c.ImplicitGrantIDTokenLifespan.Valid {
                                                    cl = &c.ImplicitGrantIDTokenLifespan.Duration
                                                }
                                        Severity: Major
                                        Found in client/client.go - About 45 mins to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language