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

security configuration in openapi spec #528

Open
seth9009 opened this issue Apr 9, 2019 · 7 comments
Open

security configuration in openapi spec #528

seth9009 opened this issue Apr 9, 2019 · 7 comments
Assignees

Comments

@seth9009
Copy link

seth9009 commented Apr 9, 2019

I want to have the API docs open and visible for everyone, but some endpoints i want to be protected and should show a lock next to it like here https://petstore.swagger.io is this possible in current implementation?

@mevdschee
Copy link
Owner

mevdschee commented Apr 9, 2019

It requires a 'security' specification in the openapi json. In the current implementation this is not possible as you need to somehow specify that exposing the existence is not a security breach. Such fine grained control is not implemented. It is either allowed (in which case it is shown) or not, in which case it is hidden. I hope you understand the reasoning.

You can use the 'openApiBase' config parameter to add default configuration to the openapi spec.

@mevdschee mevdschee self-assigned this Apr 9, 2019
@seth9009
Copy link
Author

seth9009 commented Apr 9, 2019

The way I would envision this was, if auth is setup then all routes are with a lock and can't be tested without keys, rather than hidden them, but I understand that isn't working like that, thanks again for your reply really appreciate it!!

@mevdschee
Copy link
Owner

mevdschee commented Apr 9, 2019

I understand your reasoning and it can be implemented.

But with the current implementation it would expose the existence all non-visible tables and columns as there is only a boolean defining whether or not a table or column should be exposed during a session.

@mevdschee
Copy link
Owner

I'll convert this to a feature request for future reference.

@mevdschee mevdschee changed the title authorize lock on openapi docs security configuration in openapi spec Apr 12, 2019
@Niek
Copy link

Niek commented Dec 10, 2019

Piggying back on this... would it be possible to make the /openapi endpoint world-readable when authorization middleware is used?

@mevdschee
Copy link
Owner

@Niek: allow the 'document' permission, see:

@Niek
Copy link

Niek commented Dec 10, 2019

@mevdschee correct me if I'm wrong, but that is to hide certain tables from the documentation, right? As far as I see it can't be used to make the /openapi endpoint accessible without being logged in.

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

No branches or pull requests

3 participants