harcon-radiation
Advanced tools
Comparing version 1.1.0 to 1.2.0
@@ -179,3 +179,3 @@ var ES6 = require('./ES6Fixer'); | ||
security.options = true; | ||
path.protector = security.protector ? ( _.isFunction(security.protector) ? security.protector : security.protector[service] ) : null; | ||
path.protector = security.protector ? security.protector( service ) : null; | ||
self.restify.post( path, function( request, content, callback ){ | ||
@@ -231,3 +231,2 @@ var params = content.params || content.parameters || []; | ||
} | ||
//self.options.ioProtector | ||
} | ||
@@ -234,0 +233,0 @@ } |
{ | ||
"name": "harcon-radiation", | ||
"version": "1.1.0", | ||
"version": "1.2.0", | ||
"description": "REST and Websocket plugin for harcon", | ||
@@ -55,3 +55,3 @@ "keywords": [ | ||
}, | ||
"_id": "harcon-radiation@1.1.0" | ||
"_id": "harcon-radiation@1.2.0" | ||
} |
@@ -85,2 +85,26 @@ Harcon-Radiation - An extension to the [harcon](https://github.com/imrefazekas/harcon) library to automatically expose selected entities through REST and/or Websocket. | ||
## Security | ||
[harcon-radiation](https://github.com/imrefazekas/harcon-radiation) is using [connect-rest](https://github.com/imrefazekas/connect-rest) inside and allows you to use the security features of that REST lib. | ||
Your components might possess a __protector__ function which should retrieve [protector function](https://github.com/imrefazekas/connect-rest#protector) used by the [connect-rest](https://github.com/imrefazekas/connect-rest) when it is called. | ||
The service parameter can be used to differentiate the different security aspects your services cover. | ||
```javascript | ||
harcon.addicts( { | ||
name: 'julie', | ||
rest: true, | ||
security: { | ||
protector: function(service){ | ||
return function( req, res, pathname, path, callback ){ | ||
callback(); | ||
} | ||
} | ||
} | ||
} ); | ||
``` | ||
About the protector functions, please find the description [here](https://github.com/imrefazekas/connect-rest#protector). | ||
## License | ||
@@ -87,0 +111,0 @@ |
33311
143
512