node-restify-swagger icon indicating copy to clipboard operation
node-restify-swagger copied to clipboard

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

Open metasection opened this issue 11 years ago • 8 comments

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 avatar Oct 06 '14 13:10 metasection

Any feedback on this issue and the Pull Request?

metasection avatar Nov 13 '14 11:11 metasection

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.

metasection avatar Nov 14 '14 11:11 metasection

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

z0mt3c avatar Nov 14 '14 21:11 z0mt3c

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 avatar Nov 16 '14 18:11 metasection

Any feedback on pull request #16?

metasection avatar Nov 22 '14 20:11 metasection

Any feedback? Need anything else before you can Pull?

metasection avatar Nov 24 '14 21:11 metasection

Any feedback on pull request #16?

metasection avatar Nov 30 '14 13:11 metasection

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.

metasection avatar Dec 06 '14 19:12 metasection