Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow Swagger security configuration #56

Open
MinDBreaK opened this issue Jul 10, 2023 · 0 comments
Open

Allow Swagger security configuration #56

MinDBreaK opened this issue Jul 10, 2023 · 0 comments

Comments

@MinDBreaK
Copy link

The current configuration of swagger does not allow the specification of the authentication methods.

Would it be possible to have a key to add the configuration. Maybe with the possibility to set regex to path that are affected by the authentication mechanism ? We have multiples endpoints that have different authentications (Oauth, JWT, Bearer)

The reference is here https://swagger.io/docs/specification/authentication/

I think something like :

{
    "name": {
        "options": [Options],
        "path": /Regex/
   } 
}

would translate to

components:
      securitySchemes:
          [name]:
              ...Options
security:
  [...names]

This would allow to use any authentication mechanism on all endpoints. However we would lose flexibility provided OpenApi.

A solution to avoid this would be to add a type-hinted callback that enforce the OpenApi schema (maybe with https://www.npmjs.com/package/openapi-types ?) but allows the mutation of the generated schema ?

I would be more in favor of a flexible way to do it, but might be a little bit more complicated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant