Skip to content

Commit

Permalink
LDAP simple server mock
Browse files Browse the repository at this point in the history
  • Loading branch information
maxime-beguin committed Oct 17, 2017
0 parents commit c794474
Show file tree
Hide file tree
Showing 15 changed files with 1,326 additions and 0 deletions.
248 changes: 248 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,248 @@
{

"parserOptions": {
"ecmaFeatures": {

// Give ESLint the ability to read let and const variables
"blockBindings": true

}
},

// Extends eslint recommended rules
"extends": "eslint:recommended",
"env": {

// Add node.js environment globals
"node": true,

// Enable ECMAScript 6 features
"es6": true

},
"rules": {

// Disallow unused vars but not unused arguments
"no-unused-vars": [2, {"vars": "local", "args": "none"}],

// Treat var as block scoped
"block-scoped-var": 2,

// Require default case in switch statements
"default-case": 2,

// Disallow use of alert
"no-alert": 2,

// Disallow use of caller/callee
"no-caller": 2,

// Disallow null comparisons
"no-eq-null": 2,

// Disallow eval()
"no-eval": 2,

// Disallow adding to native types
"no-extend-native": 2,

// Disallow unnecessary function binding
"no-extra-bind": 2,

// Disallow floating decimals
"no-floating-decimal": 2,

// Disallow the type conversion with shorter notations
"no-implicit-coercion": 2,

// Disallow implied eval
"no-implied-eval": 2,

// Disallow Iterator
"no-iterator": 2,

// Disallow labeled statements
"no-labels": 2,

// Disallow unnecessary nested blocks
"no-lone-blocks": 2,

// Disallow multiple spaces
"no-multi-spaces": 2,

// Disallow multiline strings
"no-multi-str": 2,

// Disallow assignment to native objects or read-only global variables
"no-global-assign": 2,

// Disallow function constructor
"no-new-func": 2,

// Disallow octal escapes
"no-octal-escape": 2,

// Disallow octal literals
"no-octal": 2,

// Disallow use of __proto__
"no-proto": 2,

// Disallow script URLs
"no-script-url": 2,

// Disallow self compare
"no-self-compare": 2,

// Restrict what can be thrown as an exception
"no-throw-literal": 2,

// Disallow unused expressions
"no-unused-expressions": [2, {"allowShortCircuit": true, "allowTernary": true}],

// Disallow unnecessary .call() and .apply()
"no-useless-call": 2,

// Disallow unncessary concatenation of strings
"no-useless-concat": 2,

// No with statements
"no-with": 2,

// Strict mode
"strict": [2, "global"],

// Disallow shadowing of variables inside of catch
"no-catch-shadow": 2,

// Disallow variables deletion
"no-delete-var": 2,

// Disallow shadowing of restricted names
"no-shadow-restricted-names": 2,

// Disallow early use
"no-use-before-define": 2,

// Disallow mixed requires
"no-mixed-requires": 2,

// Disallow new require
"no-new-require": 2,

// Disallow string concatenation when using _dirname and _filename
"no-path-concat": 2,

// Disallow process.exit()
"no-process-exit": 2,

// Disallow synchronous methods
"no-sync": 2,

// Disallow spaces inside of brackets
"array-bracket-spacing": 2,

// Disallow spaces inside of single line blocks
"block-spacing": [2, "always"],

// Require brace style
"brace-style": [2, "1tbs", { "allowSingleLine": false }],

// Require camelcase
"camelcase": [2, {"properties": "always"}],

// Enforces spacing around commas
"comma-spacing": [2, {"before": false, "after": true}],

// Comma style
"comma-style": [2, "last"],

// Disallow spaces inside of computed properties
"computed-property-spacing": [2, "never"],

// Require consistent this
"consistent-this": [2, "self"],

// Require file to end with single newline
"eol-last" : 2,

// Validate Indentation
"indent": [2, 2, {"SwitchCase": 1, "VariableDeclarator": { "var": 1, "let": 1, "const": 1}}],

// Enforce property spacing
"key-spacing": [2, {"beforeColon": false, "afterColon": true}],

// Enforce empty lines around comments
"lines-around-comment": [2, { "beforeBlockComment": true, "beforeLineComment": true, "allowBlockStart": true, "allowBlockEnd": true }],

// Require constructors to use initial caps
"new-cap": [2, {"newIsCap": true, "capIsNew": false}],

// Require parens for constructors
"new-parens": 2,

// Disallow if as the only statement in an else block
"no-lonely-if": 2,

// Disallow if as the only statement in an else block
"no-mixed-spaces-and-tabs": 2,

// Disallows multiple blank lines
"no-multiple-empty-lines": [2, {"max": 2}],

// Disallow spaces in function calls
"no-spaced-func": 2,

// Disallow trailing spaces at the end of lines
"no-trailing-spaces": 2,

// Disallow spaces inside of curly braces in objects.
"object-curly-spacing": 2,

// Operator linebreak
"operator-linebreak": [2, "after"],

// Quoting style for property names
"quote-props": [2, "as-needed"],

// Enforce quote style
"quotes": [2, "single"],

// Require JSDoc comment
"require-jsdoc": 2,

// Enforce spacing before and after semicolons
"semi-spacing": 2,

// Enforce semicolons
"semi": 2,

// Require spaces following keywords
"keyword-spacing": 2,

// Require or disallow space before blocks
"space-before-blocks": 2,

// Disallow a space before function parenthesis
"space-before-function-paren": [2, "never"],

// Disallow spaces inside of parentheses
"space-in-parens": 2,

// Require spaces around infix operators
"space-infix-ops": 2,

// Require or disallow spaces before/after unary operators
"space-unary-ops": [2, { "words": true, "nonwords": false }],

// Requires or disallows a whitespace (space or tab) beginning a comment
"spaced-comment": [2, "always"],

// Limit Maximum Length of Line
"max-len": [2, 120, 2, {"ignoreUrls": true}],

// Disallow trailing commas
"comma-dangle": 2

}
}
23 changes: 23 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Linux
.directory
*~
.*.swp

# OS X
.DS_Store*
Icon?
._*

# Windows
Thumbs.db
Desktop.ini
ehthumbs.db

# NPM dependencies
/node_modules

# IDE
nbproject

# Grunt
/.grunt
29 changes: 29 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Linux
# *.swp is already ignored by npm
.directory
*~

# OS X
# .DS_Store* and ._* are already ignored by npm
Icon?

# Windows
Thumbs.db
Desktop.ini
ehthumbs.db

# IDE
nbproject

# Git
.gitignore
.gitattributes

# NPM dependencies
/node_modules

# Grunt
/.grunt

# Eslint
.eslintrc
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# 1.0.0 /

## FEATURES

- Add a basic LDAP server mock to test authentication on applications using an LDAP server
27 changes: 27 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
'use strict';

require('./processRequire.js');

/**
* Initializes grunt, load extensions and register tasks.
*/
module.exports = function(grunt) {
const config = {
eslint: {
server: {
src: [
'server.js',
'Gruntfile.js',
'processRequire.js',
'lib/**/*.js'
]
}
}
};

grunt.initConfig(config);

// Load grunt tasks
grunt.loadNpmTasks('grunt-eslint');

};
Loading

0 comments on commit c794474

Please sign in to comment.