-
Notifications
You must be signed in to change notification settings - Fork 0
/
package.json
32 lines (32 loc) · 1.72 KB
/
package.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
{
"name": "modella-protection",
"version": "0.2.2",
"description": "Protection for mass-assignment vulnerabilities for modella.",
"main": "index.js",
"scripts": {
"test": "mocha"
},
"repository": {
"type": "git",
"url": "git://github.com/modella/protection"
},
"keywords": [
"mass-assignment",
"modella",
"protection"
],
"author": {
"name": "Ryan Schmukler",
"email": "[email protected]"
},
"license": "MIT",
"devDependencies": {
"expect.js": "~0.2.0",
"modella": "~0.1.0"
},
"readme": "# modella-protection\n\n Protection for mass-assignment vulnerabilities for\n [modella](http://github.com/modella/modella).\n\n## Installation\n\n $ component install modella/protection\n $ npm install modella-protection\n\n## API\n\n### Methods affected\n\nmodella-protection provides `model#protectedSet` to set attributes using\nprotection.\n\n### Protection mode\n\nProtection can be used in either a whitelist or blacklist mode. In white list mode,\nonly attributes with `protected: false` are able to be set by mass assignment.\nIn black list mode, only variables with `protected: true` will be filtered from\nmass-assignment. The default is blacklist mode.\n\n Model.whiteListProtection = true //Switch from the default to whitelist mode.\n\n### Defining Attributes\n\nTo protect a field, pass in the `protected: true` option.\n\n User.attr('username').attr('admin', { protected: true });\n\n### Setting Fields\n\n var user = new User();\n user.filteredSet({username: 'Bobby', admin: true});\n user.get('admin') == undefined // true\n\n\n## License\n\n MIT\n",
"readmeFilename": "Readme.md",
"bugs": {
"url": "https://github.com/modella/protection/issues"
}
}