Showing 412 of 865 total issues
Function MockConsentRequest
has 68 lines of code (exceeds 50 allowed). Consider refactoring. Open
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},
Method Handler.getOidcUserInfo
has 68 lines of code (exceeds 50 allowed). Consider refactoring. Open
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 {
Method JwkAPIService.CreateJsonWebKeySetExecute
has 67 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (a *JwkAPIService) CreateJsonWebKeySetExecute(r ApiCreateJsonWebKeySetRequest) (*JsonWebKeySet, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodPost
localVarPostBody interface{}
formFiles []formFile
Method OAuth2APIService.AcceptOAuth2ConsentRequestExecute
has 67 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (a *OAuth2APIService) AcceptOAuth2ConsentRequestExecute(r ApiAcceptOAuth2ConsentRequestRequest) (*OAuth2RedirectTo, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodPut
localVarPostBody interface{}
formFiles []formFile
Method OAuth2APIService.AcceptOAuth2LoginRequestExecute
has 67 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (a *OAuth2APIService) AcceptOAuth2LoginRequestExecute(r ApiAcceptOAuth2LoginRequestRequest) (*OAuth2RedirectTo, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodPut
localVarPostBody interface{}
formFiles []formFile
Method OAuth2APIService.RejectOAuth2LoginRequestExecute
has 67 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (a *OAuth2APIService) RejectOAuth2LoginRequestExecute(r ApiRejectOAuth2LoginRequestRequest) (*OAuth2RedirectTo, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodPut
localVarPostBody interface{}
formFiles []formFile
Method OAuth2APIService.RejectOAuth2ConsentRequestExecute
has 67 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (a *OAuth2APIService) RejectOAuth2ConsentRequestExecute(r ApiRejectOAuth2ConsentRequestRequest) (*OAuth2RedirectTo, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodPut
localVarPostBody interface{}
formFiles []formFile
Function testRegistry
has 67 lines of code (exceeds 50 allowed). Consider refactoring. Open
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()))
Method Handler.createVerifiableCredential
has 18 return statements (exceeds 4 allowed). Open
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)
Method OAuth2APIService.AcceptOAuth2LogoutRequestExecute
has 66 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (a *OAuth2APIService) AcceptOAuth2LogoutRequestExecute(r ApiAcceptOAuth2LogoutRequestRequest) (*OAuth2RedirectTo, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodPut
localVarPostBody interface{}
formFiles []formFile
Function TestValidateDynamicRegistration
has 66 lines of code (exceeds 50 allowed). Consider refactoring. Open
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"})
Method JwkAPIService.SetJsonWebKeyExecute
has 65 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (a *JwkAPIService) SetJsonWebKeyExecute(r ApiSetJsonWebKeyRequest) (*JsonWebKey, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodPut
localVarPostBody interface{}
formFiles []formFile
Method Handler.oauth2TokenExchange
has 65 lines of code (exceeds 50 allowed). Consider refactoring. Open
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)
Function TestAuthCodeWithMockStrategy
has 17 return statements (exceeds 4 allowed). Open
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()
Method OAuth2APIService.SetOAuth2ClientLifespansExecute
has 64 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (a *OAuth2APIService) SetOAuth2ClientLifespansExecute(r ApiSetOAuth2ClientLifespansRequest) (*OAuth2Client, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodPut
localVarPostBody interface{}
formFiles []formFile
Method JwkAPIService.GetJsonWebKeyExecute
has 64 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (a *JwkAPIService) GetJsonWebKeyExecute(r ApiGetJsonWebKeyRequest) (*JsonWebKeySet, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
Method MetadataAPIService.IsReadyExecute
has 64 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (a *MetadataAPIService) IsReadyExecute(r ApiIsReadyRequest) (*IsReady200Response, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
Method MetadataAPIService.IsAliveExecute
has 64 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (a *MetadataAPIService) IsAliveExecute(r ApiIsAliveRequest) (*HealthStatus, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
Method JwkAPIService.SetJsonWebKeySetExecute
has 64 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (a *JwkAPIService) SetJsonWebKeySetExecute(r ApiSetJsonWebKeySetRequest) (*JsonWebKeySet, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodPut
localVarPostBody interface{}
formFiles []formFile
Function checkTokenResponse
has 64 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func checkTokenResponse(token oauth2token) {
if token.RefreshToken == "" {
log.Fatalf("Expected a refresh token but none received: %+v", token)
}