Skip to content

Instantly share code, notes, and snippets.

@jakul
Created January 16, 2013 17:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jakul/4549166 to your computer and use it in GitHub Desktop.
Save jakul/4549166 to your computer and use it in GitHub Desktop.
function validate_auth_urls(req, path, httpMethod) {
/*
* Ensure that only client API keys can access the auth urls
*/
if (!path.startswith('/auth/')) {
return true
}
//req.is_client is (correctly) set by a middleware
return req.is_client
}
swagger.addValidator(validate_auth_urls)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment