chore(package): various updates

This commit is contained in:
Julien Fontanet 2016-10-28 13:45:43 +02:00
parent a8340c24c3
commit 7e2f2f6102
5 changed files with 32 additions and 22 deletions

View File

@ -3,3 +3,5 @@
npm-debug.log
npm-debug.log.*
pnpm-debug.log
pnpm-debug.log.*

View File

@ -1,6 +1,7 @@
language: node_js
node_js:
- 'stable'
- '6'
- '4'
# Use containers.

View File

@ -30,24 +30,21 @@ the web iterface, see [the plugin documentation](https://xen-orchestra.com/docs/
## Development
### Installing dependencies
```
# Install dependencies
> npm install
```
### Compilation
# Run the tests
> npm test
The sources files are watched and automatically recompiled on changes.
```
# Continuously compile
> npm run dev
```
### Tests
# Continuously run the tests
> npm run dev-test
```
> npm run test-dev
# Build for production (automatically called by npm install)
> npm run build
```
## Contributions

View File

@ -4,10 +4,13 @@
"license": "AGPL-3.0",
"description": "SAML authentication plugin for XO-Server",
"keywords": [
"xo-server",
"xo-server",
"authentication",
"saml"
"orchestra",
"plugin",
"saml",
"xen",
"xen-orchestra",
"xo-server"
],
"homepage": "https://github.com/vatesfr/xo-server-auth-saml",
"bugs": "https://github.com/vatesfr/xo-server-auth-saml/issues",
@ -34,20 +37,25 @@
},
"devDependencies": {
"babel-cli": "^6.14.0",
"babel-eslint": "^6.1.2",
"babel-eslint": "^7.1.0",
"babel-plugin-transform-runtime": "^6.15.0",
"babel-preset-es2015": "^6.14.0",
"babel-preset-latest": "^6.16.0",
"babel-preset-stage-0": "^6.5.0",
"cross-env": "^3.1.3",
"dependency-check": "^2.6.0",
"ghooks": "^1.3.2",
"rimraf": "^2.5.4",
"standard": "^8.2.0"
},
"scripts": {
"build": "NODE_ENV=production babel --source-maps --out-dir=dist/ src/",
"build": "cross-env NODE_ENV=production babel --source-maps --out-dir=dist/ src/",
"clean": "rimraf dist/",
"depcheck": "dependency-check ./package.json",
"dev": "NODE_DEV=development babel --watch --source-maps --out-dir=dist/ src/",
"dev": "cross-env NODE_ENV=development babel --watch --source-maps --out-dir=dist/ src/",
"lint": "standard",
"posttest": "npm run lint && npm run depcheck",
"prebuild": "npm run clean",
"predev": "npm run clean",
"prepublish": "npm run build"
},
"babel": {
@ -55,7 +63,7 @@
"transform-runtime"
],
"presets": [
"es2015",
"latest",
"stage-0"
]
},

View File

@ -24,7 +24,9 @@ export const configurationSchema = {
// ===================================================================
class AuthSamlXoPlugin {
constructor (xo) {
constructor ({ xo }) {
this._conf = null
this._usernameField = null
this._xo = xo
}
@ -34,7 +36,7 @@ class AuthSamlXoPlugin {
}
load () {
const {_xo: xo} = this
const xo = this._xo
xo.registerPassportStrategy(new Strategy(this._conf, async (profile, done) => {
const name = profile[this._usernameField]
@ -54,4 +56,4 @@ class AuthSamlXoPlugin {
// ===================================================================
export default ({xo}) => new AuthSamlXoPlugin(xo)
export default opts => new AuthSamlXoPlugin(opts)