ory-am/hydra

View on GitHub

Showing 412 of 865 total issues

Function MockConsentRequest has 68 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func MockConsentRequest(key string, remember bool, rememberFor int, hasError bool, skip bool, authAt bool, loginChallengeBase string, network string) (c *flow.OAuth2ConsentRequest, h *flow.AcceptOAuth2ConsentRequest, f *flow.Flow) {
    c = &flow.OAuth2ConsentRequest{
        ID:                makeID("challenge", network, key),
        RequestedScope:    []string{"scopea" + key, "scopeb" + key},
        RequestedAudience: []string{"auda" + key, "audb" + key},
Severity: Minor
Found in consent/test/manager_test_helpers.go - About 1 hr to fix

    Method Handler.getOidcUserInfo has 68 lines of code (exceeds 50 allowed). Consider refactoring.
    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: Minor
    Found in oauth2/handler.go - About 1 hr to fix

      Method JwkAPIService.CreateJsonWebKeySetExecute has 67 lines of code (exceeds 50 allowed). Consider refactoring.
      Open

      func (a *JwkAPIService) CreateJsonWebKeySetExecute(r ApiCreateJsonWebKeySetRequest) (*JsonWebKeySet, *http.Response, error) {
          var (
              localVarHTTPMethod  = http.MethodPost
              localVarPostBody    interface{}
              formFiles           []formFile
      Severity: Minor
      Found in internal/httpclient/api_jwk.go - About 1 hr to fix

        Method OAuth2APIService.AcceptOAuth2ConsentRequestExecute has 67 lines of code (exceeds 50 allowed). Consider refactoring.
        Open

        func (a *OAuth2APIService) AcceptOAuth2ConsentRequestExecute(r ApiAcceptOAuth2ConsentRequestRequest) (*OAuth2RedirectTo, *http.Response, error) {
            var (
                localVarHTTPMethod  = http.MethodPut
                localVarPostBody    interface{}
                formFiles           []formFile
        Severity: Minor
        Found in internal/httpclient/api_o_auth2.go - About 1 hr to fix

          Method OAuth2APIService.AcceptOAuth2LoginRequestExecute has 67 lines of code (exceeds 50 allowed). Consider refactoring.
          Open

          func (a *OAuth2APIService) AcceptOAuth2LoginRequestExecute(r ApiAcceptOAuth2LoginRequestRequest) (*OAuth2RedirectTo, *http.Response, error) {
              var (
                  localVarHTTPMethod  = http.MethodPut
                  localVarPostBody    interface{}
                  formFiles           []formFile
          Severity: Minor
          Found in internal/httpclient/api_o_auth2.go - About 1 hr to fix

            Method OAuth2APIService.RejectOAuth2LoginRequestExecute has 67 lines of code (exceeds 50 allowed). Consider refactoring.
            Open

            func (a *OAuth2APIService) RejectOAuth2LoginRequestExecute(r ApiRejectOAuth2LoginRequestRequest) (*OAuth2RedirectTo, *http.Response, error) {
                var (
                    localVarHTTPMethod  = http.MethodPut
                    localVarPostBody    interface{}
                    formFiles           []formFile
            Severity: Minor
            Found in internal/httpclient/api_o_auth2.go - About 1 hr to fix

              Method OAuth2APIService.RejectOAuth2ConsentRequestExecute has 67 lines of code (exceeds 50 allowed). Consider refactoring.
              Open

              func (a *OAuth2APIService) RejectOAuth2ConsentRequestExecute(r ApiRejectOAuth2ConsentRequestRequest) (*OAuth2RedirectTo, *http.Response, error) {
                  var (
                      localVarHTTPMethod  = http.MethodPut
                      localVarPostBody    interface{}
                      formFiles           []formFile
              Severity: Minor
              Found in internal/httpclient/api_o_auth2.go - About 1 hr to fix

                Function testRegistry has 67 lines of code (exceeds 50 allowed). Consider refactoring.
                Open

                func testRegistry(t *testing.T, ctx context.Context, k string, t1 driver.Registry, t2 driver.Registry) {
                    t.Run("package=client/manager="+k, func(t *testing.T) {
                        t.Run("case=create-get-update-delete", client.TestHelperCreateGetUpdateDeleteClient(k, t1.Persister().Connection(context.Background()), t1.ClientManager(), t2.ClientManager()))
                
                        t.Run("case=autogenerate-key", client.TestHelperClientAutoGenerateKey(k, t1.ClientManager()))
                Severity: Minor
                Found in persistence/sql/persister_test.go - About 1 hr to fix

                  Method Handler.createVerifiableCredential has 18 return statements (exceeds 4 allowed).
                  Open

                  func (h *Handler) createVerifiableCredential(w http.ResponseWriter, r *http.Request) {
                      ctx := r.Context()
                      session := NewSessionWithCustomClaims(ctx, h.c, "")
                      accessToken := fosite.AccessTokenFromRequest(r)
                      tokenType, _, err := h.r.OAuth2Provider().IntrospectToken(ctx, accessToken, fosite.AccessToken, session)
                  Severity: Major
                  Found in oauth2/handler.go - About 1 hr to fix

                    Method OAuth2APIService.AcceptOAuth2LogoutRequestExecute has 66 lines of code (exceeds 50 allowed). Consider refactoring.
                    Open

                    func (a *OAuth2APIService) AcceptOAuth2LogoutRequestExecute(r ApiAcceptOAuth2LogoutRequestRequest) (*OAuth2RedirectTo, *http.Response, error) {
                        var (
                            localVarHTTPMethod  = http.MethodPut
                            localVarPostBody    interface{}
                            formFiles           []formFile
                    Severity: Minor
                    Found in internal/httpclient/api_o_auth2.go - About 1 hr to fix

                      Function TestValidateDynamicRegistration has 66 lines of code (exceeds 50 allowed). Consider refactoring.
                      Open

                      func TestValidateDynamicRegistration(t *testing.T) {
                          ctx := context.Background()
                          c := internal.NewConfigurationWithDefaults()
                          c.MustSet(ctx, config.KeySubjectTypesSupported, []string{"pairwise", "public"})
                          c.MustSet(ctx, config.KeyDefaultClientScope, []string{"openid"})
                      Severity: Minor
                      Found in client/validator_test.go - About 1 hr to fix

                        Method JwkAPIService.SetJsonWebKeyExecute has 65 lines of code (exceeds 50 allowed). Consider refactoring.
                        Open

                        func (a *JwkAPIService) SetJsonWebKeyExecute(r ApiSetJsonWebKeyRequest) (*JsonWebKey, *http.Response, error) {
                            var (
                                localVarHTTPMethod  = http.MethodPut
                                localVarPostBody    interface{}
                                formFiles           []formFile
                        Severity: Minor
                        Found in internal/httpclient/api_jwk.go - About 1 hr to fix

                          Method Handler.oauth2TokenExchange has 65 lines of code (exceeds 50 allowed). Consider refactoring.
                          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: Minor
                          Found in oauth2/handler.go - About 1 hr to fix

                            Function TestAuthCodeWithMockStrategy has 17 return statements (exceeds 4 allowed).
                            Open

                            func TestAuthCodeWithMockStrategy(t *testing.T) {
                                ctx := context.Background()
                                for _, strat := range []struct{ d string }{{d: "opaque"}, {d: "jwt"}} {
                                    t.Run("strategy="+strat.d, func(t *testing.T) {
                                        conf := internal.NewConfigurationWithDefaults()
                            Severity: Major
                            Found in oauth2/oauth2_auth_code_test.go - About 1 hr to fix

                              Method OAuth2APIService.SetOAuth2ClientLifespansExecute has 64 lines of code (exceeds 50 allowed). Consider refactoring.
                              Open

                              func (a *OAuth2APIService) SetOAuth2ClientLifespansExecute(r ApiSetOAuth2ClientLifespansRequest) (*OAuth2Client, *http.Response, error) {
                                  var (
                                      localVarHTTPMethod  = http.MethodPut
                                      localVarPostBody    interface{}
                                      formFiles           []formFile
                              Severity: Minor
                              Found in internal/httpclient/api_o_auth2.go - About 1 hr to fix

                                Method JwkAPIService.GetJsonWebKeyExecute has 64 lines of code (exceeds 50 allowed). Consider refactoring.
                                Open

                                func (a *JwkAPIService) GetJsonWebKeyExecute(r ApiGetJsonWebKeyRequest) (*JsonWebKeySet, *http.Response, error) {
                                    var (
                                        localVarHTTPMethod  = http.MethodGet
                                        localVarPostBody    interface{}
                                        formFiles           []formFile
                                Severity: Minor
                                Found in internal/httpclient/api_jwk.go - About 1 hr to fix

                                  Method MetadataAPIService.IsReadyExecute has 64 lines of code (exceeds 50 allowed). Consider refactoring.
                                  Open

                                  func (a *MetadataAPIService) IsReadyExecute(r ApiIsReadyRequest) (*IsReady200Response, *http.Response, error) {
                                      var (
                                          localVarHTTPMethod  = http.MethodGet
                                          localVarPostBody    interface{}
                                          formFiles           []formFile
                                  Severity: Minor
                                  Found in internal/httpclient/api_metadata.go - About 1 hr to fix

                                    Method MetadataAPIService.IsAliveExecute has 64 lines of code (exceeds 50 allowed). Consider refactoring.
                                    Open

                                    func (a *MetadataAPIService) IsAliveExecute(r ApiIsAliveRequest) (*HealthStatus, *http.Response, error) {
                                        var (
                                            localVarHTTPMethod  = http.MethodGet
                                            localVarPostBody    interface{}
                                            formFiles           []formFile
                                    Severity: Minor
                                    Found in internal/httpclient/api_metadata.go - About 1 hr to fix

                                      Method JwkAPIService.SetJsonWebKeySetExecute has 64 lines of code (exceeds 50 allowed). Consider refactoring.
                                      Open

                                      func (a *JwkAPIService) SetJsonWebKeySetExecute(r ApiSetJsonWebKeySetRequest) (*JsonWebKeySet, *http.Response, error) {
                                          var (
                                              localVarHTTPMethod  = http.MethodPut
                                              localVarPostBody    interface{}
                                              formFiles           []formFile
                                      Severity: Minor
                                      Found in internal/httpclient/api_jwk.go - About 1 hr to fix

                                        Function checkTokenResponse has 64 lines of code (exceeds 50 allowed). Consider refactoring.
                                        Open

                                        func checkTokenResponse(token oauth2token) {
                                            if token.RefreshToken == "" {
                                                log.Fatalf("Expected a refresh token but none received: %+v", token)
                                            }
                                        
                                        
                                        Severity: Minor
                                        Found in test/mock-client/main.go - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language