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

[RFC] Ability to disable entrypoint /api/docs #1568

Closed
Nek- opened this issue Dec 18, 2017 · 9 comments
Closed

[RFC] Ability to disable entrypoint /api/docs #1568

Nek- opened this issue Dec 18, 2017 · 9 comments

Comments

@Nek-
Copy link
Contributor

Nek- commented Dec 18, 2017

Problem

  • I don't want the documentation on /api/docs in production environment
  • I don't want either the documentation endpoint to transform into api entry point

Partial solution

  1. If I don't want documentation on the api entry point, then I should disable format HTML in production environment (cool)
  2. The documentation is replaced by jsonld list of accessible endpoints

I don't want that.

Final suggestion of fix

Add a new option that definitely disable this page and replace it by a 404 error.

Please tell me what do you think about and I can handle the PR about.

@dunglas
Copy link
Member

dunglas commented Dec 18, 2017

For Swagger UI, it's already possible:

# app/config/config_prod.yml
api_platform:
    enable_swagger_ui: false

@dunglas
Copy link
Member

dunglas commented Dec 18, 2017

Add a new option that definitely disable this page and replace it by a 404 error.

It will not be a valid Hydra API (then, client-side tools will not work anymore). I suggest to add a proper authentication layer instead of disabling the entrypoint.

@Nek-
Copy link
Contributor Author

Nek- commented Dec 18, 2017

enable_swagger_ui: false does not disable the entrypoint.

You mean allowing only super-admin users to see the list of entrypoint? In that case the entrypoint will still not be available for tools (so what's the win here?).

Actually in my case we don't really care because the only client (for now) is the frontend of the app. I assume this may be the case for many people.

Hydra provide features. Shouldn't be able to enable/disable features ?

@dunglas
Copy link
Member

dunglas commented Dec 18, 2017

You mean allowing only super-admin users to see the list of entrypoint? In that case the entrypoint will still not be available for tools (so what's the win here?).

Tools can authenticate.

But why not an option to disable the entrypoint and the docs:

api_platform:
    entrypoint: false
    docs: false

@Nek-
Copy link
Contributor Author

Nek- commented Dec 18, 2017

Tools can authenticate but it's about not showing endpoints to everybody. So only super-admin authentication would make it work.

For the option, that's what the issue is about :) .

Add a new option that definitely disable this page and replace it by a 404 error.

@soyuka
Copy link
Member

soyuka commented Dec 18, 2017

Indeed @Nek- feel free to contribute to add these options :).

@Nek- Nek- changed the title [RFC] Ability to disable entry point /api/docs [RFC] Ability to disable entrypoint /api/docs Dec 18, 2017
athos7933 pushed a commit to athos7933/core that referenced this issue Dec 20, 2017
athos7933 pushed a commit to athos7933/core that referenced this issue Dec 20, 2017
@Nek-
Copy link
Contributor Author

Nek- commented Mar 19, 2018

Related to #1731

@Nek-
Copy link
Contributor Author

Nek- commented Apr 5, 2018

\o/

@Nek- Nek- closed this as completed Apr 5, 2018
@trsteel88
Copy link
Contributor

Is it possible to disable all docs except the swagger html version?

jsonld has a link header which comes back whenever docs is enabled. However, I only want docs for html.

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

4 participants