z0mt3c / node-restify-swagger

Swagger generation for REST-Services built with node-restify and node.js based on validation schemas of node-restify-validation.
MIT License
29 stars 16 forks source link

Hide API Methods until API Key is provided and/or validated #11

Open metasection opened 10 years ago

metasection commented 10 years ago

I need to hide "protected" API methods from the Swagger UI until the API Key is provided. It would be great if there was some meta data defined on each route that said whether the route was public or protected. Public meaning "No API Key". Protected meaning "API Key present and validated".

It would be awesome if "protected" could be tied to a callback function. This would allow our application to define specific behavior based on the API Key configuration. We may offer Pro features of the application and don't want to show these API methods to Standard users.

metasection commented 10 years ago

Any feedback on this issue and the Pull Request?

metasection commented 10 years ago

Could you please comment on this issue and Pull Request?

If you don't like the changes, we can create a separate module.

If you want something more, we can add.

If you are just too busy, please let us know.

Best regards.

z0mt3c commented 10 years ago

Sorry for the delay. Find my answer in the pull request.

metasection commented 10 years ago

New Pull Request submitted. Per your request, I have removed the inline require and added tests. The remaining tests require an actual http GET. Do you have a preference for how this is done inside the tests?

metasection commented 10 years ago

Any feedback on pull request #16?

metasection commented 10 years ago

Any feedback? Need anything else before you can Pull?

metasection commented 9 years ago

Any feedback on pull request #16?

metasection commented 9 years ago

Completely reworked my updates based on your feedback. The changes to the module are minimal. I have added support for the 'authorizations' property of the route and the ability to call a third party authorizations plug-in which I will upload to Github shortly.