{"_id":"@vonage/acl-express","_rev":"153-f5b7f2019b62ca47c7aff25dc90cd348","name":"@vonage/acl-express","dist-tags":{"latest":"0.0.5"},"versions":{"0.0.3":{"name":"@vonage/acl-express","version":"0.0.3","keywords":["express"],"author":{"name":"Tomer Amir"},"license":"ISC","_id":"@vonage/acl-express@0.0.3","maintainers":[{"name":"tomer.amir","email":"tomer.amir@vonage.com"}],"homepage":"https://github.com/Vonage/acl-express#readme","bugs":{"url":"https://github.com/Vonage/acl-express/issues"},"dist":{"shasum":"3013781f52a1f52265ef2f08d8809cd93d187c51","tarball":"https://registry.npmjs.org/@vonage/acl-express/-/acl-express-0.0.3.tgz","integrity":"sha512-xv5ia3OtexYG3enQ+YfB3gBgNCADvY3QsZ7rMpyhXcku6qvQ+55AIcsyTK11VrZUDzRecVOcA4MMl8i0KAWfzQ==","signatures":[{"sig":"MEUCIB5L+TmzIw3qrMSoMhWs3IiXDmqeQ9Renlsbb9UQ6JN4AiEApR26Iv0TdI/t4KbpMVJ5wwvrMtU+j+gTheyQ02Oe+ss=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"lib/index.js","gitHead":"7b5795dba051ba465c0aefd4fb42014efd4a4517","scripts":{"lint":"eslint","test":"NODE_ENV=test mocha test/**/*.js","test-cover":"NODE_ENV=test istanbul cover _mocha test/**/*.js"},"_npmUser":{"name":"tomer.amir","email":"tomer.amir@vonage.com"},"repository":{"url":"git+https://github.com/Vonage/acl-express.git","type":"git"},"_npmVersion":"5.3.0","description":"An access control middleware for Express","directories":{},"_nodeVersion":"8.4.0","dependencies":{"debug":"^2.6.8"},"devDependencies":{"chai":"^4.1.1","mocha":"^3.5.0","sinon":"^3.0.0","eslint":"^4.4.0","rewire":"^2.5.2","istanbul":"^1.1.0-alpha.1","chai-spies":"^0.7.1","proxyquire":"^1.8.0","babel-eslint":"^7.2.3","eslint-plugin-node":"^5.1.1","eslint-plugin-mocha":"^4.11.0","eslint-plugin-import":"^2.7.0","eslint-plugin-promise":"^3.5.0","eslint-config-standard":"^10.2.1","eslint-plugin-standard":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/acl-express-0.0.3.tgz_1503908994613_0.6145878895185888","host":"s3://npm-registry-packages"}},"0.0.4":{"name":"@vonage/acl-express","version":"0.0.4","keywords":["express"],"author":{"name":"Tomer Amir"},"license":"ISC","_id":"@vonage/acl-express@0.0.4","maintainers":[{"name":"tomer.amir","email":"tomer.amir@vonage.com"}],"homepage":"https://github.com/Vonage/acl-express#readme","bugs":{"url":"https://github.com/Vonage/acl-express/issues"},"dist":{"shasum":"21a192f5ad30403cfcd7974e4245e1390fa4ecd6","tarball":"https://registry.npmjs.org/@vonage/acl-express/-/acl-express-0.0.4.tgz","integrity":"sha512-3w7RKq17Tcov1YcP+VD2CqrUMHEeHuPp2++N255JypTM0zyZtWnROP5rbJNEEhIo/y2Bs6ILYGB6tp7phVaWKw==","signatures":[{"sig":"MEQCIFzasWJdZe8K2EZ4TLjR/+Isyds7kEL75Qnewu5J0xtTAiATgrE+kUPD2srKaDdoelK5qfd+/A7QNgomTGG/pbPzxQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"lib/index.js","gitHead":"fbb2ce32871ddd12c805eda662ffe5caf095d5b5","scripts":{"lint":"eslint","test":"NODE_ENV=test mocha test/**/*.js","test-cover":"NODE_ENV=test istanbul cover _mocha test/**/*.js"},"_npmUser":{"name":"tomer.amir","email":"tomer.amir@vonage.com"},"repository":{"url":"git+https://github.com/Vonage/acl-express.git","type":"git"},"_npmVersion":"5.3.0","description":"An access control middleware for Express","directories":{},"_nodeVersion":"8.4.0","dependencies":{"debug":"^2.6.8"},"devDependencies":{"chai":"^4.1.1","mocha":"^3.5.0","sinon":"^3.0.0","eslint":"^4.4.0","rewire":"^2.5.2","istanbul":"^1.1.0-alpha.1","chai-spies":"^0.7.1","proxyquire":"^1.8.0","babel-eslint":"^7.2.3","eslint-plugin-node":"^5.1.1","eslint-plugin-mocha":"^4.11.0","eslint-plugin-import":"^2.7.0","eslint-plugin-promise":"^3.5.0","eslint-config-standard":"^10.2.1","eslint-plugin-standard":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/acl-express-0.0.4.tgz_1503910725526_0.7191506163217127","host":"s3://npm-registry-packages"}},"0.0.5":{"name":"@vonage/acl-express","version":"0.0.5","keywords":["express"],"author":{"name":"Tomer Amir"},"license":"ISC","_id":"@vonage/acl-express@0.0.5","maintainers":[{"name":"tomer.amir","email":"tomer.amir@vonage.com"}],"homepage":"https://github.com/Vonage/acl-express#readme","bugs":{"url":"https://github.com/Vonage/acl-express/issues"},"dist":{"shasum":"4d1101e64760a7e7b2b953af7d53b91680fc128d","tarball":"https://registry.npmjs.org/@vonage/acl-express/-/acl-express-0.0.5.tgz","integrity":"sha512-8ooVU2VAO3/+T4SO93b1N8Yqewxnq9fXE/ypNe3vJ531GFl9cCNFaHG3SVePsJHq/gfgJjS/6+G38iWTaB/RYQ==","signatures":[{"sig":"MEQCIB5c09RU6pVlu004qOq2x/8xeV31laeMCpP+feqwapj3AiAp0STmN7Se7GqhCdvArlODTmq0ou4arCHoOtMWNuXJtQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"lib/index.js","gitHead":"eb447866f6c21116b69746e125ec41a1b08f487f","scripts":{"lint":"eslint","test":"NODE_ENV=test mocha test/**/*.js","test-cover":"NODE_ENV=test istanbul cover _mocha test/**/*.js"},"_npmUser":{"name":"tomer.amir","email":"tomer.amir@vonage.com"},"repository":{"url":"git+https://github.com/Vonage/acl-express.git","type":"git"},"_npmVersion":"5.3.0","description":"An access control middleware for Express","directories":{},"_nodeVersion":"8.4.0","dependencies":{"debug":"^2.6.8"},"devDependencies":{"chai":"^4.1.1","mocha":"^3.5.0","sinon":"^3.0.0","eslint":"^4.4.0","rewire":"^2.5.2","istanbul":"^1.1.0-alpha.1","chai-spies":"^0.7.1","proxyquire":"^1.8.0","babel-eslint":"^7.2.3","eslint-plugin-node":"^5.1.1","eslint-plugin-mocha":"^4.11.0","eslint-plugin-import":"^2.7.0","eslint-plugin-promise":"^3.5.0","eslint-config-standard":"^10.2.1","eslint-plugin-standard":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/acl-express-0.0.5.tgz_1503911513259_0.8135619377717376","host":"s3://npm-registry-packages"}}},"time":{"created":"2017-08-07T09:48:54.390Z","modified":"2026-09-03T04:37:36.157Z","0.0.1":"2017-08-07T09:48:54.390Z","0.0.2":"2017-08-07T09:52:29.759Z","0.0.3":"2017-08-28T08:29:55.485Z","0.0.4":"2017-08-28T08:58:46.462Z","0.0.5":"2017-08-28T09:11:54.198Z"},"bugs":{"url":"https://github.com/Vonage/acl-express/issues"},"author":{"name":"Tomer Amir"},"license":"ISC","homepage":"https://github.com/Vonage/acl-express#readme","keywords":["express"],"repository":{"url":"git+https://github.com/Vonage/acl-express.git","type":"git"},"description":"An access control middleware for Express","maintainers":[{"email":"web-il@vonage.com","name":"web-il"},{"email":"icebergteam@vonage.com","name":"iceberg-team"},{"email":"unified_portal_dev@vonage.com","name":"unified_portal"},{"email":"vreporter-support@vonage.com","name":"vreporter-npm"},{"email":"vbc-be@vonage.com","name":"vbcbe"},{"email":"gullerya@gmail.com","name":"yuri.guller"},{"email":"idan.cohen@vonage.com","name":"idanvon"},{"email":"devrel@vonage.com","name":"nexmo-devrel"},{"email":"vivid@vonage.com","name":"vvd"},{"email":"VBC-Meetings@vonage.com","name":"vonagemeetings"},{"email":"video.api.ops@vonage.com","name":"vonage-jenkins"},{"email":"andreina.dasilvacabral@vonage.com","name":"adasilvacabral"},{"email":"sarvesh.bisht@vonage.com","name":"sarvesh.bisht"},{"email":"vgai-studio-developers@vonage.com","name":"vgai-dev"},{"email":"vcp_webrtc@vonage.com","name":"vonage_client_media_processing"},{"email":"or.abramovich@vonage.com","name":"or.cpc"},{"email":"lily.lihovodov@vonage.com","name":"llihovodov"},{"email":"daniel.sapir@vonage.com","name":"daniel-sapir"},{"email":"Aviad.Houri@vonage.com","name":"aviadhouri.va"},{"email":"ignacio.delacruz@vonage.com","name":"idelacruz"},{"email":"frontier@vonage.com","name":"vonage-frontier"},{"email":"hila.klein@vonage.com","name":"hilakl"},{"email":"Saurabh.Kulkarni@vonage.com","name":"saurabh.vonage"},{"email":"tamir.nahum@vonage.com","name":"leppelin"},{"email":"antoni.silvestrepadros@vonage.com","name":"asilvonage"},{"email":"Gayathri.Pojula@vonage.com","name":"gpojula"},{"email":"egor.limenko@vonage.com","name":"elimenko.vonage"},{"email":"kanav.bhatia@vonage.com","name":"kanav_vonage"},{"email":"omri.zilber@vonage.com","name":"omrizilber"},{"email":"marceli.olszewski@vonage.com","name":"molszewski_v"},{"email":"sailu.vejella@vonage.com","name":"sailusha"},{"email":"ragul.palanisamy@vonage.com","name":"rpalanisamy-vonage"},{"email":"Valentyn.Bohdan@vonage.com","name":"vbohdan_vonage"},{"email":"andrew.bolles@vonage.com","name":"abolles"},{"email":"gorka.revillafernandez@vonage.com","name":"gorka.vonage"},{"email":"bharath.ps@vonage.com","name":"bharath-vonage"},{"email":"mor.tubul@vonage.com","name":"morvonage"},{"email":"ilan.aradbilavsky@vonage.com","name":"ilan.aradbilavsky.at.vonage.com"},{"email":"chuck.reeves@vonage.com","name":"vonreeves"},{"email":"avi.dantes@vonage.com","name":"avi.dantes"},{"email":"michal.galin@vonage.com","name":"mgalin"},{"email":"jakub.hajduk@vonage.com","name":"jhajduk.vonage"},{"email":"Nitsan.unger@vonage.com","name":"nitsanungerfrontier"},{"email":"vladimir.quezada@vonage.com","name":"vquezada"},{"email":"alessio.didomenico@vonage.com","name":"adidomenico"},{"email":"sathish.r@vonage.com","name":"sathishr-vonage"},{"email":"pamu.pravallika@vonage.com","name":"pravallika-pamu"},{"email":"avijit.bagdi@vonage.com","name":"abagdi"},{"email":"anuradh.lankapalli@vonage.com","name":"anuradhlankapalli"},{"email":"hen.rosenberg@vonage.com","name":"hrosenberg"},{"email":"gokul.narayanan@vonage.com","name":"gokul-vonage"},{"email":"alistair.slowe@vonage.com","name":"aslowe-vcc"},{"email":"vbc-web-cicd@vonage.com","name":"vbc-web-cicd-bot"},{"email":"marina.serranomontes@vonage.com","name":"mserranomontes"},{"email":"Ariel.Bar@vonage.com","name":"ariel12955"},{"email":"Francisco.Becerra@vonage.com","name":"franbecerra"},{"email":"Uri.Haim@vonage.com","name":"urihaim"},{"email":"manuel.veranieto@vonage.com","name":"mvera_vonage"},{"email":"mike.zhylevych@vonage.com","name":"mike.zhylevych"},{"email":"mithun.prabhu@vonage.com","name":"mprabhuvonage"},{"email":"sharad.srivastava@vonage.com","name":"sharad-srivastava2"},{"email":"lukasz.pilarski@vonage.com","name":"lucas_pilarski"},{"email":"manish.ranjan@vonage.com","name":"manish-ranjan07"},{"email":"shubham.rajput@vonage.com","name":"srajput0909"},{"email":"pablo.villenamontes@vonage.com","name":"pvillenamontes"},{"email":"diogo.simoes@vonage.com","name":"dsimoes2"},{"email":"manel.jimeno@vonage.com","name":"manel_vonage"},{"email":"joseantonio.oliveraortega@vonage.com","name":"joliveraortega"}],"readme":"# ACL-Express\n\nA stateless access control middleware for Express servers\n\n## Installation\nInstall using `npm`:\n```bash\n$ npm install @vonage/acl-express\n```\n\nthen in your project require the package:\n```js\nconst acl = require('@vonage/acl-express');\n```\n\nlastly, you must configure the module for it to work:\n```js\nacl.config({...});\n```\n\n## Configuration\nYou must supply a configuration object to the module for it to work.<br/>\nYou can use the following configurations:\n\nProperty | Required | Type | Description\n| --- | --- | --- | --- |\n**path** | `true` | `string` | This is the path for your rules file \n**roleObjectKey** | `false` | `string` | The name of the user object on the express request object which holds the role field<br>**Default Value**: `user`\n**defaultRole** | `false` | `string` | This is the role that will be given to users which do not have a role set for them.\n\nExample:\n```js\nacl.config({\n  path: 'path/to/rule/list',\n  roleObjectKey: 'myUser',\n  defaultRole: 'guest'\n});\n```\n\n## Rule File\nYou have to supply a rule file to the module which is built in the following way:\n1. The file needs to be a **JSON** file\n2. The JSON keys will be the roles you want in your system\n3. Every role will hold an array of routes you want to allow or deny access to\n\n**Basic Example**:\n```json\n{\n  \"guest\": [\n      {\n        \"route\": \"/public\",\n        \"methods\": [\n          \"GET\"\n        ],\n        \"action\": \"allow\"\n      },\n      {\n        \"route\": \"/private\",\n        \"methods\": \"*\",\n        \"action\": \"deny\"\n      }\n    ],\n    \"admin\": [\n      {\n        \"route\": \"*\",\n        \"methods\": \"*\",\n        \"action\": \"allow\"\n      }\n    ]\n}\n```\n\nAs seen in the example above, every rule will hold the following fields:\n\nField | Type | Description\n| --- | --- | --- |\n**route** | `string` | The path for the rule to be applied on\n**methods** | `string or array` | An array of HTTP methods to apply this rule on, or `*` for all methods\n**action** | `string` | The action to apply for all requests this rule applies for. Values must be `allow` or `deny`\n\n## Advanced Features\n\n### URL Parameters\nYou can use the Express styled url parameters in your path, i.e.: `/path/with/:param`\n\n### Sub-routes\nEvery rule can have another field which is called `subroutes`. this is another array of rules which will allow you a more granular control over which routes to allow and deny access to according to your logic.<br/>\n**Example**:\n```js\n{\n  \"guest\": [\n    {\n      \"path\": \"/api\",\n      \"method\": \"*\",\n      \"action\": \"allow\",\n      \"subroutes\": [\n        {\n          \"path\": \"/public\", // Translates to /api/public\n          \"method\": [\"GET\"],\n          \"action\": \"allow\"\n        },\n        {\n          \"path\": \"/private\", // Translates to /api/private\n          \"method\": \"*\",\n          \"action\": \"deny\"\n        }\n      ]\n    }\n  ]\n}\n``` \n\n# License\n\nSee the [LICENSE](https://github.com/Vonage/acl-express/blob/master/LICENSE.txt) file for license rights and limitations (Apache License, Version 2.0)\n","readmeFilename":"README.md","users":{"tomer_a":true,"tomer.amir":true}}