{"_id":"@biscuit-auth/express-biscuit","name":"@biscuit-auth/express-biscuit","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@biscuit-auth/express-biscuit","version":"0.1.0","description":"express authorization middleware for Biscuit tokens","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/biscuit-auth/biscuit-node-express.git"},"keywords":["authorization","express","biscuit"],"author":"","license":"Apache-2.0","bugs":{"url":"https://github.com/biscuit-auth/biscuit-node-express/issues"},"homepage":"https://github.com/biscuit-auth/biscuit-node-express#readme","dependencies":{"@biscuit-auth/biscuit-wasm":"0.3.0"},"gitHead":"a169cefd6aab15f059d90124c2cbb5e09a5af0ea","_id":"@biscuit-auth/express-biscuit@0.1.0","_nodeVersion":"17.8.0","_npmVersion":"8.3.0","dist":{"integrity":"sha512-IgnNMf+nWNPc4MaCztzLQvNOxCYZBCCpumrdO7gQogH/hz9MyqgD/sMEAXLWsoixTjDZkBCOVqlLJfIjvy5r0g==","shasum":"938062630d16846092fcf42528e59bde572f0e2f","tarball":"https://registry.npmjs.org/@biscuit-auth/express-biscuit/-/express-biscuit-0.1.0.tgz","fileCount":327,"unpackedSize":1712240,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHBvqImtz0iXU1WhVG9yED7dQaoKvwvvuEJ9lGR0iT6XAiEAvDSKoffd9DwrDsspY9p9/ijpSHPvDZ+uC1YlG8jvdFM="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiTKtjACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqx3Q//er02QRTSe08AeChON+SVSwE0rXf80wPEJnPVX8X/Jnh9ooAN\r\nM30OSSXgyrD3nShTvh9yAiwLGSRrehmjuKnF7enQ6qIK+XJ1ihYKEzYRKffw\r\nKlKhY+R/slaAwjIv9x2c/Fc6HsSG0yPu5KpAbkM7fl6LxMPBt8Gns7rGJhmZ\r\n2Ftwts0Y7s7k795n/mF/oiocE5tpe5zwCYSDowqg4gS3RWGrWqCRigpB4C1V\r\nPbQ2LoKinILPzU1QLc7Gr0tCl1sh+IDsFaUb2uzXrvc9c2J7ncDyPRLzDbgG\r\nSA2ybwrBYv8mRF508/kMqxANxOaXNHDgFqulRbwsr2N5ajw/Jd7R4t+Q9yuI\r\nByeUK2/q/9nn05XLCuP/LWENyOSz7QGzl+qiqlKBZvMtBcnkPjIZLsfjRmxc\r\n/vRbN2ulIWjtDvb+uhX+0l2vFRVuCw6LwmUhXiyAlbggLORaJ7YhnahAE5Sm\r\nWewfhiux8czdmS/qbBzxFMeAvr68/rEW5ANcj3cOL2QeN0Khuf6n9MwYfvlC\r\n3yzLU1aLWHmSRmT70WmczZ57G754kAiopniunBAkro+zKE4iA7nOtKQv/pIn\r\nDAQZIoSgUV3thTNG1rgQEat1Pyxss0CvviS/j3QTiaIZusQiLY5+H4Td03g2\r\nfpzFyYIZJ6YLdvXIvg4e20xAh6IWaLRXhY8=\r\n=kk7h\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"geal","email":"geo.couprie@gmail.com"},"directories":{},"maintainers":[{"name":"geal","email":"geo.couprie@gmail.com"},{"name":"clementd","email":"clement+npm@delafargue.name"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/express-biscuit_0.1.0_1649191779494_0.8935876832707601"},"_hasShrinkwrap":false}},"time":{"created":"2022-04-05T20:49:39.425Z","0.1.0":"2022-04-05T20:49:39.660Z","modified":"2022-04-05T20:49:39.794Z"},"maintainers":[{"name":"geal","email":"geo.couprie@gmail.com"},{"name":"clementd","email":"clement+npm@delafargue.name"}],"description":"express authorization middleware for Biscuit tokens","homepage":"https://github.com/biscuit-auth/biscuit-node-express#readme","keywords":["authorization","express","biscuit"],"repository":{"type":"git","url":"git+https://github.com/biscuit-auth/biscuit-node-express.git"},"bugs":{"url":"https://github.com/biscuit-auth/biscuit-node-express/issues"},"license":"Apache-2.0","readme":"# express-biscuit\n\nExpress authorization middleware using Biscuit tokens and policies\n\nExample usage:\n\n```javascript\nconst express = require('express')\nconst express_biscuit = require('@biscuit-auth/express-biscuit')\nconst {fact} = require('@biscuit-auth/express-biscuit')\nconst app = express()\n\nconst pubKey = \"dfd559075dcf56c8c6777fbd3c553827dd51645bb8ee87a975a172980f8f16e5\"\n\napp.get('/user/:user_id',\n  express_biscuit({\n    // the root public key used to verify the signature\n    publicKey: pubKey,\n    // a list of static authorizer policies\n    policies: \"check if user(1); allow if true;\",\n    // the extractor method is used to get data from the request and\n    // create authorizer facts from it\n    extractor: function(req, authorizer) {\n      authorizer.add_fact(\n        // you can use template strings to create the facts, this prevents\n        // injection issues when integrating user controlled data\n        fact`user(${parseInt(req.params.user_id)})`\n      )\n    }\n  }),\n  function (req, res) {\n    res.send('Hello '+req.params.user_id+\"\\n\")\n})\n```","readmeFilename":"README.md"}