chore(package): various updates
This commit is contained in:
parent
a8340c24c3
commit
7e2f2f6102
2
packages/xo-server-auth-saml/.gitignore
vendored
2
packages/xo-server-auth-saml/.gitignore
vendored
@ -3,3 +3,5 @@
|
|||||||
|
|
||||||
npm-debug.log
|
npm-debug.log
|
||||||
npm-debug.log.*
|
npm-debug.log.*
|
||||||
|
pnpm-debug.log
|
||||||
|
pnpm-debug.log.*
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
language: node_js
|
language: node_js
|
||||||
node_js:
|
node_js:
|
||||||
- 'stable'
|
- 'stable'
|
||||||
|
- '6'
|
||||||
- '4'
|
- '4'
|
||||||
|
|
||||||
# Use containers.
|
# Use containers.
|
||||||
|
@ -30,24 +30,21 @@ the web iterface, see [the plugin documentation](https://xen-orchestra.com/docs/
|
|||||||
|
|
||||||
## Development
|
## Development
|
||||||
|
|
||||||
### Installing dependencies
|
|
||||||
|
|
||||||
```
|
```
|
||||||
|
# Install dependencies
|
||||||
> npm install
|
> npm install
|
||||||
```
|
|
||||||
|
|
||||||
### Compilation
|
# Run the tests
|
||||||
|
> npm test
|
||||||
|
|
||||||
The sources files are watched and automatically recompiled on changes.
|
# Continuously compile
|
||||||
|
|
||||||
```
|
|
||||||
> npm run dev
|
> npm run dev
|
||||||
```
|
|
||||||
|
|
||||||
### Tests
|
# Continuously run the tests
|
||||||
|
> npm run dev-test
|
||||||
|
|
||||||
```
|
# Build for production (automatically called by npm install)
|
||||||
> npm run test-dev
|
> npm run build
|
||||||
```
|
```
|
||||||
|
|
||||||
## Contributions
|
## Contributions
|
||||||
|
@ -4,10 +4,13 @@
|
|||||||
"license": "AGPL-3.0",
|
"license": "AGPL-3.0",
|
||||||
"description": "SAML authentication plugin for XO-Server",
|
"description": "SAML authentication plugin for XO-Server",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"xo-server",
|
|
||||||
"xo-server",
|
|
||||||
"authentication",
|
"authentication",
|
||||||
"saml"
|
"orchestra",
|
||||||
|
"plugin",
|
||||||
|
"saml",
|
||||||
|
"xen",
|
||||||
|
"xen-orchestra",
|
||||||
|
"xo-server"
|
||||||
],
|
],
|
||||||
"homepage": "https://github.com/vatesfr/xo-server-auth-saml",
|
"homepage": "https://github.com/vatesfr/xo-server-auth-saml",
|
||||||
"bugs": "https://github.com/vatesfr/xo-server-auth-saml/issues",
|
"bugs": "https://github.com/vatesfr/xo-server-auth-saml/issues",
|
||||||
@ -34,20 +37,25 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"babel-cli": "^6.14.0",
|
"babel-cli": "^6.14.0",
|
||||||
"babel-eslint": "^6.1.2",
|
"babel-eslint": "^7.1.0",
|
||||||
"babel-plugin-transform-runtime": "^6.15.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",
|
"babel-preset-stage-0": "^6.5.0",
|
||||||
|
"cross-env": "^3.1.3",
|
||||||
"dependency-check": "^2.6.0",
|
"dependency-check": "^2.6.0",
|
||||||
"ghooks": "^1.3.2",
|
"ghooks": "^1.3.2",
|
||||||
|
"rimraf": "^2.5.4",
|
||||||
"standard": "^8.2.0"
|
"standard": "^8.2.0"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"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",
|
"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",
|
"lint": "standard",
|
||||||
"posttest": "npm run lint && npm run depcheck",
|
"posttest": "npm run lint && npm run depcheck",
|
||||||
|
"prebuild": "npm run clean",
|
||||||
|
"predev": "npm run clean",
|
||||||
"prepublish": "npm run build"
|
"prepublish": "npm run build"
|
||||||
},
|
},
|
||||||
"babel": {
|
"babel": {
|
||||||
@ -55,7 +63,7 @@
|
|||||||
"transform-runtime"
|
"transform-runtime"
|
||||||
],
|
],
|
||||||
"presets": [
|
"presets": [
|
||||||
"es2015",
|
"latest",
|
||||||
"stage-0"
|
"stage-0"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -24,7 +24,9 @@ export const configurationSchema = {
|
|||||||
// ===================================================================
|
// ===================================================================
|
||||||
|
|
||||||
class AuthSamlXoPlugin {
|
class AuthSamlXoPlugin {
|
||||||
constructor (xo) {
|
constructor ({ xo }) {
|
||||||
|
this._conf = null
|
||||||
|
this._usernameField = null
|
||||||
this._xo = xo
|
this._xo = xo
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -34,7 +36,7 @@ class AuthSamlXoPlugin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
load () {
|
load () {
|
||||||
const {_xo: xo} = this
|
const xo = this._xo
|
||||||
|
|
||||||
xo.registerPassportStrategy(new Strategy(this._conf, async (profile, done) => {
|
xo.registerPassportStrategy(new Strategy(this._conf, async (profile, done) => {
|
||||||
const name = profile[this._usernameField]
|
const name = profile[this._usernameField]
|
||||||
@ -54,4 +56,4 @@ class AuthSamlXoPlugin {
|
|||||||
|
|
||||||
// ===================================================================
|
// ===================================================================
|
||||||
|
|
||||||
export default ({xo}) => new AuthSamlXoPlugin(xo)
|
export default opts => new AuthSamlXoPlugin(opts)
|
||||||
|
Loading…
Reference in New Issue
Block a user