herbsjs / herbsshelf

Dynamically generated documentation for your domain
Other
8 stars 16 forks source link

Disable shelf in production or protect with password #19

Open jhomarolo opened 2 years ago

jhomarolo commented 2 years ago

Does it make sense to lock the shelf route in some native way?

Optionally display it only when the environment is not production or put some password to display it?

italojs commented 2 years ago

It is a infraestructure responsability, I'm not sure if we need to bring it for herbs2shelf buuut it is a super short feature, so we colud to add an env like "LOCKIN_ENV" when I set the LOCKIN_ENV=production, we could to generate the HTML onlyif(process.env.NODE_ENV!==process.env.LOCKIN_ENV) else it we could to return an herbs error page HTML

italojs commented 2 years ago

Another option is to create some auth system like swagger https://swagger.io/docs/specification/authentication/