Skip to content

Unquoted 'OidcScopes' key when using OpenID Connect #836

Description

@kuzznya

Hi all,

I have a problem with codegen when OpenID Connect security scheme is defined in spec:

security:
  - oidc:
      - openid
components:
  securitySchemes:
    oidc:
      type: openIdConnect
      openIdConnectUrl: <url>

The codegen generates such wrappers for all endpoints:

func (siw *ServerInterfaceWrapper) CreateResourceX(c *gin.Context) {

	c.Set(OidcScopes, []string{"openid"})

	for _, middleware := range siw.HandlerMiddlewares {
		middleware(c)
	}

	siw.Handler.CreateResourceX(c)
}

context.Set accepts only strings as keys (and OidcScopes is an unknown thing for the compiler), so I suppose that it should be quoted.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions