Lomkit / laravel-rest-api

Generate Api in seconds
https://laravel-rest-api.lomkit.com/
MIT License
297 stars 18 forks source link

How to specify security schemes globally? #117

Open CS76 opened 2 months ago

CS76 commented 2 months ago

Description

Hello, I would like to enable Bearer token based authentication across various endpoings (resources). How do we define security schemes globally? to generate the following in the open-api.json

"components": {
        "securitySchemes": {
            "sanctum": {
                "type": "apiKey",
                "description": "Enter token in format (Bearer <token>)",
                "name": "Authorization",
                "in": "header"
            }
        }
    }

and then be able to register endpoints to use the schemes?

Thanks in advance

GautierDele commented 1 month ago

Hello, Its not currently available but will be a nice feature to have 😄 For now youll need to replicate the code when necessary