security.js 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /**
  2. * Security Settings
  3. * (sails.config.security)
  4. *
  5. * These settings affect aspects of your app's security, such
  6. * as how it deals with cross-origin requests (CORS) and which
  7. * routes require a CSRF token to be included with the request.
  8. *
  9. * For an overview of how Sails handles security, see:
  10. * https://sailsjs.com/documentation/concepts/security
  11. *
  12. * For additional options and more information, see:
  13. * https://sailsjs.com/config/security
  14. */
  15. module.exports.security = {
  16. /***************************************************************************
  17. * *
  18. * CORS is like a more modern version of JSONP-- it allows your application *
  19. * to circumvent browsers' same-origin policy, so that the responses from *
  20. * your Sails app hosted on one domain (e.g. example.com) can be received *
  21. * in the client-side JavaScript code from a page you trust hosted on _some *
  22. * other_ domain (e.g. trustedsite.net). *
  23. * *
  24. * For additional options and more information, see: *
  25. * https://sailsjs.com/docs/concepts/security/cors *
  26. * *
  27. ***************************************************************************/
  28. // cors: {
  29. // allRoutes: false,
  30. // allowOrigins: '*',
  31. // allowCredentials: false,
  32. // },
  33. /****************************************************************************
  34. * *
  35. * CSRF protection should be enabled for this application. *
  36. * *
  37. * For more information, see: *
  38. * https://sailsjs.com/docs/concepts/security/csrf *
  39. * *
  40. ****************************************************************************/
  41. csrf: true
  42. };