Skip to content
  • P
    Projects
  • G
    Groups
  • S
    Snippets
  • Help

PUBLIC / surfer-okd

  • This project
    • Loading...
  • Sign in
Go to a project
  • Project
  • Repository
  • Issues 0
  • Merge Requests 0
  • Pipelines
  • Wiki
  • Snippets
  • Settings
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Files
  • Commits
  • Branches
  • Tags
  • Contributors
  • Graph
  • Compare
  • Charts
Commit 3d716d9e authored 8 years ago by Johannes's avatar Johannes
Browse files
Options
  • Browse Files
  • Download
  • Email Patches
  • Plain Diff

Rename auth exports

1 parent f9f5c021
Show whitespace changes
Inline Side-by-side
Showing with 5 additions and 5 deletions
  • app.js
  • src/auth.js
app.js
View file @3d716d9
......@@ -22,9 +22,9 @@ var router = new express.Router();
var multipart = multipart({ maxFieldsSize: 2 * 1024, limit: '512mb', timeout: 3 * 60 * 1000 });
router.get ('/api/files/*', auth.ldap, files.get);
router.put ('/api/files/*', auth.ldap, multipart, files.put);
router.delete('/api/files/*', auth.ldap, files.del);
router.get ('/api/files/*', auth.verify, files.get);
router.put ('/api/files/*', auth.verify, multipart, files.put);
router.delete('/api/files/*', auth.verify, files.del);
router.get ('/api/healthcheck', function (req, res) { res.status(200).send(); });
// welcome screen in case / does not serve up any file yet
......
This diff is collapsed. Click to expand it.
src/auth.js
View file @3d716d9
......@@ -24,11 +24,11 @@ var LDAP_USERS_BASE_DN = process.env.LDAP_USERS_BASE_DN;
if (LDAP_URL && LDAP_USERS_BASE_DN) {
console.log('Enable ldap auth');
exports.ldap = passport.authenticate('ldap');
exports.verify = passport.authenticate('ldap');
} else {
console.log('Use local user file:', LOCAL_AUTH_FILE);
exports.ldap = function (req, res, next) {
exports.verify = function (req, res, next) {
var users = safe.JSON.parse(safe.fs.readFileSync(LOCAL_AUTH_FILE));
if (!users) return res.send(401);
if (!users[req.query.username]) return res.send(401);
......
This diff is collapsed. Click to expand it.
  • Write
  • Preview
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
  • Please register or sign in to post a comment