{"_id":"@beetle/fastify-auth-jwt-mongo","_rev":"3-67b5a39714f7b470a480a20438c97c32","name":"@beetle/fastify-auth-jwt-mongo","dist-tags":{"latest":"0.2.0"},"versions":{"0.1.0":{"name":"@beetle/fastify-auth-jwt-mongo","version":"0.1.0","description":"Sample user-management (signup, login) with Fastify and JWT","main":"index.js","scripts":{"mongo":"docker run -p 27017:27017 mongo:4.0.3","test":"standard --fix && tap test.js"},"repository":{"type":"git","url":"git+https://github.com/davidedantonio/fastify-auth-jwt-mongo.git"},"keywords":["fastify","mongo","jwt","auth","signup","login"],"author":{"name":"Davide D'Antonio","email":"davide.dantonio@webeetle.com"},"license":"MIT","bugs":{"url":"https://github.com/davidedantonio/fastify-auth-jwt-mongo/issues"},"homepage":"https://github.com/davidedantonio/fastify-auth-jwt-mongo#readme","devDependencies":{"fastify":"^1.12.1","fastify-plugin":"^1.2.1","mongo-clean":"^2.0.0","standard":"^12.0.1","tap":"^12.0.1"},"dependencies":{"fastify-jwt":"^0.5.0","fastify-mongodb":"^0.9.0","secure-password":"^3.1.0"},"gitHead":"a0397454b825f79426def58142f44bd4abf1176e","_id":"@beetle/fastify-auth-jwt-mongo@0.1.0","_npmVersion":"6.4.1","_nodeVersion":"10.13.0","_npmUser":{"name":"davide.dantonio","email":"davide.dantonio@webeetle.com"},"dist":{"integrity":"sha512-ZPuG0vnbOckQYPvDhQsKLChr/jv+hgS2AlGgS3QMKLziDtl+HJFkx94pflg76522tXEy10O0bEVY3ihTozM77A==","shasum":"0c5a86eaec7e1a46d1b3d35e92b3ace31e38fe80","tarball":"https://registry.npmjs.org/@beetle/fastify-auth-jwt-mongo/-/fastify-auth-jwt-mongo-0.1.0.tgz","fileCount":7,"unpackedSize":13616,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb6FWeCRA9TVsSAnZWagAAcGMP/19UWbzlpEu/QHUhNEC6\nkahBZA5ULq8wOJVU9jMIXz65jGpyZbPIGa1UOqDWMS0LfWSkbh71NaI3/fLu\nU+UOtpOFNoNx1I5I/QU8aUEdygeGqCqXxCeOmW4n+7K8OwhkydEfNlu5UB0S\nJ/C7yQl1fKuUJLJRI9n2k8WAAvVIcBk8fYzzqz0EoVyTwhCabWrlsVny9vBl\nuyGi8uCur5SYxvaLX2Sf1mw2jkjV8btullb13Rmf+yOxbQW1X9lE8BDZUtFJ\nF8gWdaXTZn7Wv8rurr0LxSuXbQHi+qZfG8NMu6CMU+RD7PTT8Oeo1ermLD8s\n0Digy6hu3w3OcdS1tzkvCDjDZcbf4otGRkHKRZg0CmQtUz1QDyjukrnGHw7p\nPA/IbGeCGDoSgpkmJa5pxsxw55X1xjmKdjyut4zaCdwq8YgmsSWox6a0rwOm\ny1/M6sjLeptVD9UcK9saOipsLLa8DB2TF/QV97e8FRlC8sHoJfTnFz2UQuND\nu0qdzd+kNeFr/yfEA34Mbral/1g/wS4lS3Gcil43mrsKg9Y2ZUZZ7mtzUktU\n9fPFIUCqFrAMndUkaCs5gyUsHAVh1voohVB3JcMMeMd/WDA6qJoyd6NBwKXd\n73akDBKuccOi1gWFfwTMuac47BbHws7oHHsQxfp+ddcnuyg8unrIDuO2YFP7\n9k0r\r\n=hYyv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDyE/W6PnJ8v8EW5pQA/oJqOvd38n4mTm5QcZHYeWV/SwIhANIEyfKrn4lmNLk6AUJvvDQF8s2fcQx1FGoGIGf6OdZE"}]},"maintainers":[{"name":"davide.dantonio","email":"davide.dantonio@webeetle.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fastify-auth-jwt-mongo_0.1.0_1541952926051_0.4714990294154584"},"_hasShrinkwrap":false},"0.1.1":{"name":"@beetle/fastify-auth-jwt-mongo","version":"0.1.1","description":"Sample user-management (signup, login) with Fastify and JWT","main":"index.js","scripts":{"mongo":"docker run -p 27017:27017 mongo:4.0.3","test":"standard --fix && tap test.js"},"repository":{"type":"git","url":"git+https://github.com/davidedantonio/fastify-auth-jwt-mongo.git"},"keywords":["fastify","mongo","jwt","auth","signup","login"],"author":{"name":"Davide D'Antonio","email":"davide.dantonio@webeetle.com"},"license":"MIT","bugs":{"url":"https://github.com/davidedantonio/fastify-auth-jwt-mongo/issues"},"homepage":"https://github.com/davidedantonio/fastify-auth-jwt-mongo#readme","devDependencies":{"fastify":"^1.12.1","fastify-plugin":"^1.2.1","mongo-clean":"^2.0.0","standard":"^12.0.1","tap":"^12.0.1"},"dependencies":{"fastify-jwt":"^0.5.0","fastify-mongodb":"^0.9.0","secure-password":"^3.1.0"},"gitHead":"d8528092135623045bd3697a29ac5a3ea7f86510","_id":"@beetle/fastify-auth-jwt-mongo@0.1.1","_npmVersion":"6.4.1","_nodeVersion":"10.13.0","_npmUser":{"name":"davide.dantonio","email":"davide.dantonio@webeetle.com"},"dist":{"integrity":"sha512-tqgcVmtNyykxnP/V2u9cRskbGClsBNmrHLVBkwbcjDzfBDsJxfrxptPr3+Mxbpo5j55/OGRy8mfqIHbe3S5GZA==","shasum":"ab3ec82ba26db86328822d73338f13f166f9b997","tarball":"https://registry.npmjs.org/@beetle/fastify-auth-jwt-mongo/-/fastify-auth-jwt-mongo-0.1.1.tgz","fileCount":7,"unpackedSize":15261,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb6FZJCRA9TVsSAnZWagAAvXkP/0sij9V0+NL4aTbZQCQO\n7/V7gK5F9AFLU//+rrBhPptWuiXAhdIE241S86bcmKWtQSeG2BVXnQGNrrcg\nUj6T2gWBF1nV8zattEGAkRPZiax229S6W3ubpTgYI4MDdPJeM810lh6UjPgR\nAxf1Kpi/ylF+sobeGWRn39bLKigVryR9v8gFN8tFCT3Zrj8AvVA+r6V+TQiT\ng/rmalDxpsv5O3S7vc3K3OTl+Rm7TxbgjGxr+n6QOv9usFUoSWaPHc5fubgX\nKtmliDVByfU3jiDnhTMxtYHbcSR6m8V3reco3jSXNnfZka3lIGDepctrahdb\nJJt6/mlR/zbgsorFWC0omgPgOd9Ahka2jFexMiSWuzXXJOYQMa7ndb5LUl2t\nzlTRBLLCV9ECqXpvHfgoBuYtUbBleejsFAgM+A6FMishsdokfRSDn1TXlZCU\npNIqLp8S4q4/09Rk3Kh8cZiFSq8cRviL8Vjx80CpulnsM2jbdROzVy4XERy8\nVwW7u8f64ssjMxfzffx4HGiS1BXUJpvjh+guqj3v+AP/kySwpBaC/hHDraZM\nsrtoC17/KBB/TVya5MsQiW1o1IysXIeuMavlkIgo+8cmK2HwD/dxUFcZW8fc\n32mlvbO/11978dyy9Yx1eLYbyA4KbkkNhfTS+GDGkELjjn9i6B1OTpXB1mSR\n587J\r\n=JiU/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG1UKIWAYhQMfrB9vTziv9isQzr0CyMJ2Fgb/P2esev8AiArMqfGQG/hf33jKb//IbYCisoPua3SYTAXKfzBFGVF6A=="}]},"maintainers":[{"name":"davide.dantonio","email":"davide.dantonio@webeetle.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fastify-auth-jwt-mongo_0.1.1_1541953096896_0.16890999291052222"},"_hasShrinkwrap":false},"0.2.0":{"name":"@beetle/fastify-auth-jwt-mongo","version":"0.2.0","description":"Sample user-management (signup, login) with Fastify and JWT","main":"index.js","scripts":{"mongo":"docker run -p 27017:27017 mongo:4.0.3","test":"standard --fix && tap test.js"},"repository":{"type":"git","url":"git+https://github.com/davidedantonio/fastify-auth-jwt-mongo.git"},"keywords":["fastify","mongo","jwt","auth","signup","login"],"author":{"name":"Davide D'Antonio","email":"davide.dantonio@webeetle.com"},"license":"MIT","bugs":{"url":"https://github.com/davidedantonio/fastify-auth-jwt-mongo/issues"},"homepage":"https://github.com/davidedantonio/fastify-auth-jwt-mongo#readme","devDependencies":{"fastify":"^2.1.0","fastify-plugin":"^1.5.0","mongo-clean":"^2.0.0","standard":"^12.0.1","tap":"^12.6.0"},"dependencies":{"fastify-jwt":"^0.9.4","fastify-mongodb":"^1.0.1","secure-password":"^3.1.0"},"gitHead":"d8528092135623045bd3697a29ac5a3ea7f86510","_id":"@beetle/fastify-auth-jwt-mongo@0.2.0","_npmVersion":"6.4.1","_nodeVersion":"10.13.0","_npmUser":{"name":"davide.dantonio","email":"davide.dantonio@webeetle.com"},"dist":{"integrity":"sha512-lQba+4gkr80nTPY2mIvrrjwmO1kt12sVZw4vqRkl0xmoGiQWM3xn4opJrPPfEsxAIfNnZUOJq5vPPg7VBYKNcw==","shasum":"26b4fbf80aa089efbcc87cc022ea33c1a6ab7447","tarball":"https://registry.npmjs.org/@beetle/fastify-auth-jwt-mongo/-/fastify-auth-jwt-mongo-0.2.0.tgz","fileCount":7,"unpackedSize":15257,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcj5wdCRA9TVsSAnZWagAAoT0P/jMe6KpQ9zz/MtGEgaGN\nJEhbkyp4+fnil/8pU+NsJMbGyyY8iN+d0mZ+c5RJhta/qmj+5+Gf6FzwC1Mr\nHDPhHb9DhPSlqAhDw/Er0xIBDyApwqCQ0nIb7hSt7uYG2DQdIDnTx25hIUQZ\n8xmpysAeRLaCqSgLJ+Uc+DtR3zCp5449tElQxHYEt6W/PqBCE+L6JgrwJpri\n4WzI5cx2nfp0AD3t7YK59zWtADAfiU5g8Pm6Y3oKbA978RjjggAxH/Jku4qK\nla5hg6UDqIH8Z1z5NHGnO6+ibVoRHDiQRp0ikQFWPktihbCPdRV/moJRwiXN\nX8L1TQuZuLiEymKeCCLbGdjVNBgPHFt6JEyXl16fNFoxbusu74nxU3prgc3S\nY/whNVG7hen/4vCXPeu3J+3UgW7lhswFX2UL6B2ZgFHTOmt6gPCD2y7mZPzP\nZj6zWTCt5D0jar4qjJuGxHFoj4C3wjaUYydpeeMmDe9AYbZXaN+Zm27PsMzZ\npkdJwq+eHr1E6VEo+LJn2PH6k86Vw3NksiKE1hmcYqNZupmnqWCHPnAzq3WK\nmyfmfg0uu8U/oxvFbfILE4j7A5XZMJ/Cr+gyj1IlVfu7zJjaxkuBfy6+YONi\nqpS9SxuVBGfqDwSpqzTNs0lDnTyizPBFWPlR8GI2dfONkYzsWm4bo4b6di9i\nTida\r\n=3ZvE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCWYMY+4q3fBBLMwkJCw4RDv6JQNfv/Noled273Vjp48gIgG/pYdwEeeqMJANyph+hV8wxx/La7NLoVSxS78N4/GOQ="}]},"maintainers":[{"name":"davide.dantonio","email":"davide.dantonio@webeetle.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fastify-auth-jwt-mongo_0.2.0_1552915485321_0.7096513804736782"},"_hasShrinkwrap":false}},"time":{"created":"2018-11-11T16:15:25.989Z","0.1.0":"2018-11-11T16:15:26.175Z","modified":"2022-04-04T18:10:57.535Z","0.1.1":"2018-11-11T16:18:17.076Z","0.2.0":"2019-03-18T13:24:45.475Z"},"maintainers":[{"name":"davide.dantonio","email":"davide.dantonio@webeetle.com"}],"description":"Sample user-management (signup, login) with Fastify and JWT","homepage":"https://github.com/davidedantonio/fastify-auth-jwt-mongo#readme","keywords":["fastify","mongo","jwt","auth","signup","login"],"repository":{"type":"git","url":"git+https://github.com/davidedantonio/fastify-auth-jwt-mongo.git"},"author":{"name":"Davide D'Antonio","email":"davide.dantonio@webeetle.com"},"bugs":{"url":"https://github.com/davidedantonio/fastify-auth-jwt-mongo/issues"},"license":"MIT","readme":"# fastify-auth-jwt-mongo\n\n# fastify-auth-mongo-jwt\n\nSample user-management (signup, login) with Fastify and JWT, on top of\n[MongoDB](https://www.mongodb.com).\n\nThis plugin sends credentials in plain text, and it implies that\nHTTPS is used to protect the application.\n\n## Install\n\n```\nnpm intall @beetle/fastify-auth-jwt-mongo\n```\n\n## Usage\n\n```js\n'use strict'\n\nconst Fastify = require('fastify')\nconst AuthMongoJwt = require('@beetle/fastify-auth-jwt-mongo')\n\nconst app = Fastify()\n\napp.register(AuthMongoJwt, {\n  auth: {\n    secret: 'thisisalongsecretjustfortests'\n  },\n  mongodb: {\n    url: 'mongodb://mongo/mydb',\n    w: 1,\n    useNewUrlParser: true\n  }\n})\n\napp.register(async function (app, opts) {\n  app.addHook('preHandler', function (req, reply) {\n    return req.jwtVerify()\n  })\n\n  app.get('/username', async function (req, reply) {\n    return req.user.username\n  })\n}, { prefix: '/protected' })\n```\n\n## REST routes\n\nThis fastify plugin offers the following routes.\n\n### POST /signup\n\nAccepts the following body:\n\n```json\n{\n  \"username\": 'a unique thing',\n  \"password\": 'a long password'\n}\n```\n\nIt will return a JWT token, encapsulated with an object:\n\n```json\n{\n  \"status\": 'ok',\n  \"token\": 'a jwt token'\n}\n```\n\n### GET /me\n\nRequires the `Authorization: Bearer TOKEN` header.\nReturns the current user if the token is valid\n\n```json\n{\n  \"username\": 'a unique thing'\n}\n```\n\n### POST LOGIN\n\nAccepts the following body:\n\n```json\n{\n  \"username\": 'a unique thing',\n  \"password\": 'a long password'\n}\n```\n\nIt will return a JWT token, encapsulated with an object:\n\n```json\n{\n  \"status\": 'ok',\n  \"token\": 'a jwt token'\n}\n```\n\n## API\n\nIt adds the same decorators of\n[fastify-jwt](https://github.com/fastify/fastify-jwt).\n\n## License\n\nMIT","readmeFilename":"README.md"}