Showing 412 of 865 total issues
Function TestHelperNID
has 52 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func TestHelperNID(r interface {
client.ManagerProvider
FlowCipher() *aead.XChaCha20Poly1305
}, t1ValidNID consent.Manager, t2InvalidNID consent.Manager) func(t *testing.T) {
testClient := client.Client{ID: "2022-03-11-client-nid-test-1"}
Method Handler.rejectOAuth2ConsentRequest
has 52 lines of code (exceeds 50 allowed). Consider refactoring. Open
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"),
Function TestGetLoginRequestWithDuplicateAccept
has 52 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func TestGetLoginRequestWithDuplicateAccept(t *testing.T) {
t.Run("Test get login request with duplicate accept", func(t *testing.T) {
ctx := context.Background()
challenge := "challenge"
requestURL := "http://192.0.2.1"
Method APIClient.decode
has 52 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) {
if len(b) == 0 {
return nil
}
if s, ok := v.(*string); ok {
Function TestGetOrGenerateKeys
has 52 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func TestGetOrGenerateKeys(t *testing.T) {
t.Parallel()
reg := internal.NewMockedRegistry(t, &contextx.Default{})
setId := uuid.NewUUID().String()
Method Handler.rejectOAuth2LoginRequest
has 51 lines of code (exceeds 50 allowed). Consider refactoring. Open
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"),
Function purge
has 51 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func purge(cmd *cobra.Command, args []string, sl *servicelocatorx.Options, dOpts []driver.OptionsModifier) error {
ctx := cmd.Context()
var d driver.Registry
co := []configx.OptionModifier{
Method router.callback
has 51 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (rt *router) callback(w http.ResponseWriter, r *http.Request, _ httprouter.Params) {
if len(r.URL.Query().Get("error")) > 0 {
_, _ = fmt.Fprintf(rt.cmd.ErrOrStderr(), "Got error: %s\n", r.URL.Query().Get("error_description"))
w.WriteHeader(http.StatusInternalServerError)
Function getRefreshRequests
has 51 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func getRefreshRequests(uniqueName string, lifespan time.Duration) []*fosite.AccessRequest {
var tokenSignature = "4c7c7e8b3a77ad0c3ec846a21653c48b45dbfa31" //nolint:gosec
return []*fosite.AccessRequest{
{
GrantTypes: []string{
Function Test_toSDKFriendlyJSONWebKey
has 51 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func Test_toSDKFriendlyJSONWebKey(t *testing.T) {
publicJWK := []byte(`{
"kty": "RSA",
"e": "AQAB",
"use": "sig",
Method Handler.acceptOAuth2LoginRequest
has 10 return statements (exceeds 4 allowed). Open
Open
func (h *Handler) acceptOAuth2LoginRequest(w http.ResponseWriter, r *http.Request, _ httprouter.Params) {
ctx := r.Context()
challenge := stringsx.Coalesce(
r.URL.Query().Get("login_challenge"),
Method OidcAPIService.CreateVerifiableCredentialExecute
has 10 return statements (exceeds 4 allowed). Open
Open
func (a *OidcAPIService) CreateVerifiableCredentialExecute(r ApiCreateVerifiableCredentialRequest) (*VerifiableCredentialResponse, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodPost
localVarPostBody interface{}
formFiles []formFile
Method DefaultStrategy.requestAuthentication
has 10 return statements (exceeds 4 allowed). Open
Open
func (s *DefaultStrategy) requestAuthentication(ctx context.Context, w http.ResponseWriter, r *http.Request, ar fosite.AuthorizeRequester) (err error) {
ctx, span := trace.SpanFromContext(ctx).TracerProvider().Tracer("").Start(ctx, "DefaultStrategy.requestAuthentication")
defer otelx.End(span, &err)
prompt := stringsx.Splitx(ar.GetRequestForm().Get("prompt"), " ")
Function MockConsentRequest
has 8 arguments (exceeds 4 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) {
Function SaneMockHandleConsentRequest
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
func SaneMockHandleConsentRequest(t *testing.T, m consent.Manager, f *flow.Flow, c *flow.OAuth2ConsentRequest, authAt time.Time, rememberFor int, remember bool, hasError bool) *flow.AcceptOAuth2ConsentRequest {
Method APIClient.prepareRequest
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
ctx context.Context,
path string, method string,
postBody interface{},
headerParams map[string]string,
queryParams url.Values,
Function NewKeysImportCmd
has 10 return statements (exceeds 4 allowed). Open
Open
func NewKeysImportCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "jwk set-id file-1 [file-2] [file-n]",
Args: cobra.MinimumNArgs(1),
Example: `{{ .CommandPath }} my-set ./path/to/jwk.json ./path/to/jwk-2.json --format json
Function GetOrCreateTLSCertificate
has 10 return statements (exceeds 4 allowed). Open
Open
func GetOrCreateTLSCertificate(ctx context.Context, d driver.Registry, iface config.ServeInterface, stopReload <-chan struct{}) func(*tls.ClientHelloInfo) (*tls.Certificate, error) {
lock.Lock()
defer lock.Unlock()
// check if certificates are configured
Function serve
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
ctx context.Context,
d driver.Registry,
cmd *cobra.Command,
wg *sync.WaitGroup,
iface config.ServeInterface,
Method Handler.oAuth2Authorize
has 10 return statements (exceeds 4 allowed). Open
Open
func (h *Handler) oAuth2Authorize(w http.ResponseWriter, r *http.Request, _ httprouter.Params) {
ctx := r.Context()
authorizeRequest, err := h.r.OAuth2Provider().NewAuthorizeRequest(ctx, r)
if err != nil {