Showing 412 of 865 total issues
Method Persister.GetLoginRequest
has 5 return statements (exceeds 4 allowed). Open
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)
Function NewListClientsCmd
has 5 return statements (exceeds 4 allowed). Open
Open
func NewListClientsCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "oauth2-clients",
Aliases: []string{"clients"},
Short: "List OAuth 2.0 Clients",
Function NewRevokeTokenCmd
has 5 return statements (exceeds 4 allowed). Open
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),
Method Persister.GetFlowByConsentChallenge
has 5 return statements (exceeds 4 allowed). Open
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.
Method JanitorHandler.Args
has 5 return statements (exceeds 4 allowed). Open
Open
func (*JanitorHandler) Args(cmd *cobra.Command, args []string) error {
if len(args) == 0 &&
!flagx.MustGetBool(cmd, ReadFromEnv) &&
len(flagx.MustGetStringSlice(cmd, Config)) == 0 {
Method Validator.ValidateDynamicRegistration
has 5 return statements (exceeds 4 allowed). Open
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`),
)
Method migrationGroup.generateSQL
has 5 return statements (exceeds 4 allowed). Open
Open
func (mg migrationGroup) generateSQL(sourceFS fs.FS, target string) error {
ms := mg.Children
if mg.fallbackDownMigration != nil {
ms = append(ms, mg.fallbackDownMigration)
}
Method Handler.ValidDynamicAuth
has 5 return statements (exceeds 4 allowed). Open
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).
Function NewPerformClientCredentialsCmd
has 5 return statements (exceeds 4 allowed). Open
Open
func NewPerformClientCredentialsCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "client-credentials",
Args: cobra.NoArgs,
Example: `{{ .CommandPath }} --client-id ... --client-secret`,
Method DefaultProvider.getHookConfig
has 5 return statements (exceeds 4 allowed). Open
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(),
}
Function NewCreateJWKSCmd
has 5 return statements (exceeds 4 allowed). Open
Open
func NewCreateJWKSCmd() *cobra.Command {
const alg = "alg"
const use = "use"
cmd := &cobra.Command{
Function NewGetJWKSCmd
has 5 return statements (exceeds 4 allowed). Open
Open
func NewGetJWKSCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "jwk set-1 [set-2] ...",
Aliases: []string{"jwks"},
Args: cobra.MinimumNArgs(1),
Method MigrateHandler.makePersister
has 5 return statements (exceeds 4 allowed). Open
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(
Function claimsFromVCResponse
has 5 return statements (exceeds 4 allowed). Open
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 {
Method Persister.VerifyAndInvalidateLogoutRequest
has 5 return statements (exceeds 4 allowed). Open
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
Method OAuth2RequestSQL.toRequest
has 5 return statements (exceeds 4 allowed). Open
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
Method Handler.oauth2TokenExchange
has 5 return statements (exceeds 4 allowed). 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)
Method Persister.deleteSessionByRequestID
has 5 return statements (exceeds 4 allowed). Open
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).
Function OnlyPublicSDKKeys
has 5 return statements (exceeds 4 allowed). Open
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 {
Method Handler.performOidcFrontOrBackChannelLogout
has 5 return statements (exceeds 4 allowed). Open
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) {