madec-project / ezvis

A dashboard to visualize a synthesis on a structured corpus, using several charts (pies, histograms, ...)
https://ezvis.readthedocs.org/
17 stars 5 forks source link

Add a basic auth login/password #17

Closed parmentf closed 9 years ago

parmentf commented 9 years ago

Add a unique login/password in the settings of ezvis, and use a basic auth middleware to limit the access.

For example, see: http://www.danielstjules.com/2014/08/03/basic-auth-with-express-4/

parmentf commented 9 years ago

All the local protocol urls will be prevented from accessing results. :| Maybe modify the local protocol? Or the basicAuth middleware? Or simply say that modifying the url, including login and sha1 (or plain password)?

parmentf commented 9 years ago

Modifying castorjs/castor-core/loaders/document.js adding this:

  // This maybe better in a hook of ezVIS?
  if (self.options.access && self.options.access.login) {
    urlObj.auth = self.options.access.login + ':';
    if (self.options.access.plain) {
      urlObj.auth += self.options.access.plain;
    }
    else if (self.options.access.sha1) {
      urlObj.auth += self.options.access.sha1;
    }
  }
  console.info('local', urlObj);

does not seem to work

parmentf commented 9 years ago

I modified the basicAuth.js middleware so that every client on the local machine (ip 127.0.0.1) of the server is allowed to access the server. 06ad03d44e7e97098d193f2268b152ae8dd1f4de