Comparing version 0.0.1 to 0.1.0
@@ -11,2 +11,4 @@ 'use strict'; | ||
options.report = options.report || function () {}; | ||
// auth succeeds, we just need credentials object with client Id for the filter later | ||
@@ -16,2 +18,3 @@ server.auth.scheme('custom', Auth); | ||
server.auth.default('default'); | ||
server.bind(options); | ||
@@ -18,0 +21,0 @@ server.route(Routes); |
@@ -20,2 +20,3 @@ 'use strict'; | ||
handler: function (request, reply) { | ||
const info = request.payload.info; | ||
registered[request.auth.credentials.clientId] = { | ||
@@ -26,2 +27,5 @@ info: request.payload.info, | ||
const source = (info && (info.hostname + '-' + info.pid)) || 'unknown'; | ||
this.report(source, 'register', info); | ||
reply({ clientId: request.connection.clientId }); | ||
@@ -37,7 +41,11 @@ } | ||
handler: function (request, reply) { | ||
// TODO: Process client data in request.payload | ||
if (request.payload.type !== 'stats') { | ||
console.log(request.payload); | ||
} | ||
const payload = request.payload.payload || request.payload; | ||
const client = registered[request.auth.credentials.clientId] || {}; | ||
const source = (client.info && (client.info.hostname + '-' + client.info.pid)) || 'unknown'; | ||
const types = Object.keys(payload); | ||
types.forEach((type) => { | ||
this.report(source, type, payload[type]); | ||
}); | ||
reply(); | ||
@@ -44,0 +52,0 @@ } |
{ | ||
"name": "borland", | ||
"version": "0.0.1", | ||
"version": "0.1.0", | ||
"description": "hapi plugin for working with toolbox", | ||
"author": "", | ||
"main": "lib/index.js", | ||
"scripts": { | ||
"test": "lab" | ||
}, | ||
"homepage": "https://github.com/continuationlabs/borland", | ||
"repository": { | ||
@@ -13,23 +12,32 @@ "type": "git", | ||
}, | ||
"keywords": [ | ||
"hapi", | ||
"plugin" | ||
], | ||
"author": "", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/continuationlabs/borland/issues" | ||
}, | ||
"homepage": "https://github.com/continuationlabs/borland#readme", | ||
"license": "MIT", | ||
"scripts": { | ||
"start": "node -r ./node_modules/toolbag dev/server.js", | ||
"test": "belly-button && lab" | ||
}, | ||
"engines": { | ||
"node": ">=4.0.0" | ||
}, | ||
"dependencies": { | ||
"joi": "7.2.2", | ||
"joi": "8.0.4", | ||
"node-uuid": "1.4.7" | ||
}, | ||
"devDependencies": { | ||
"belly-button": "1.0.0", | ||
"code": "2.1.0", | ||
"hapi": "12.1.0", | ||
"lab": "8.1.0", | ||
"nes": "2.2.0" | ||
} | ||
"belly-button": "2.x.x", | ||
"code": "2.x.x", | ||
"hapi": "13.x.x", | ||
"inert": "3.x.x", | ||
"influx": "4.1.0", | ||
"lab": "10.x.x", | ||
"nes": "4.x.x", | ||
"toolbag": "1.x.x" | ||
}, | ||
"keywords": [ | ||
"hapi", | ||
"plugin", | ||
"toolbag" | ||
] | ||
} |
# borland | ||
hapi plugin for working with toolbag | ||
[![Current Version](https://img.shields.io/npm/v/borland.svg)](https://www.npmjs.org/package/borland) | ||
[![Build Status via Travis CI](https://travis-ci.org/continuationlabs/borland.svg?branch=master)](https://travis-ci.org/continuationlabs/borland) | ||
![Dependencies](http://img.shields.io/david/continuationlabs/borland.svg) | ||
hapi plugin for working with [toolbag](https://www.npmjs.com/package/toolbag). | ||
<img src="https://raw.github.com/continuationlabs/borland/master/images/al-borland.png" /> | ||
## Usage | ||
**To be added** |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
479431
17
872
14
8
3