{"_id":"@borokero/borokero-auth","_rev":"1-dfa7cdab1bea8fb8a11f29d071b1b56d","name":"@borokero/borokero-auth","dist-tags":{"latest":"0.0.2-development"},"versions":{"0.0.2-development":{"name":"@borokero/borokero-auth","version":"0.0.2-development","description":"Authentication and Authorization module of HTTP/MQTT/CoAP Brokers based on NodeJS for IoT or Internet of Things.","main":"lib/authbroker.js","scripts":{"pretest":"bash ./scripts/start-server.sh","test":"mocha --exit --recursive --bail --reporter spec tests","start":"node ./example/broker","startmon":"DEBUG=* nodemon ./example/broker","clean-install":"sudo rm -rf node_modules && npm install"},"repository":{"type":"git","url":"git+https://github.com/borokero/borokero-auth.git"},"keywords":["moscajs","aedes","authentication","authorization","mqtt","http","credintial","access token"],"author":{"name":"Hadi Mahdavi"},"email":"kamerdack@gmail.com","license":"MIT","bugs":{"url":"https://github.com/borokero/borokero-auth/issues"},"dependencies":{"debug":"4.1.1","jsonwebtoken":"8.5.1","keycloak-connect":"13.0.1","qlobber":"3.1.0","request":"2.88.0"},"devDependencies":{"@authbroker/mongo-benchmark":"0.0.9","aedes":"0.46.0","chai":"4.2.0","expect.js":"^0.3.1","mocha":"6.2.0","mqtt":"^3.0.0","ponte":"0.0.16","supertest":"4.0.2"},"publishConfig":{"access":"public"},"gitHead":"c3e601d1acee5b79b668df5732ab87ced39ca89d","homepage":"https://github.com/borokero/borokero-auth#readme","_id":"@borokero/borokero-auth@0.0.2-development","_nodeVersion":"12.22.1","_npmVersion":"6.14.12","dist":{"integrity":"sha512-7uMFHbQKy2N50e1qOkgyPbtNp/1QgaSVvnanvs4BEq9K6JdRw3jqQzrp+OJV8YD4LQp3QjvJSD8pJ6hzc5mHUg==","shasum":"6c9182aa4d5df398cc24559a307ff1589aebf864","tarball":"https://registry.npmjs.org/@borokero/borokero-auth/-/borokero-auth-0.0.2-development.tgz","fileCount":25,"unpackedSize":597212,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgu1nxCRA9TVsSAnZWagAA+k4P/2vq9d5tdvbicXI876C5\nlaS1iR7hp6frPudqSSvrjBsQhmnttimBeOb+p2Rfe8k6gOTTyzM+1O7/x66E\nNw6bZKnQNMZvBMtbMz3hHorliZuEclOisfkDBuXK/doWwIL0vyoNL5KIhvYB\nDwJj0SoVS6zJjUILII6tVocBqYtKpfBPSlQaXYsGJ54/K9ih5CdNnATjMzx+\ny7TD0KlRTHDvB6vnkaxBEk6M2Nyo4ADCqqySKnWXZIOC3Je5PTeKrnOsGe8M\nLYJeaFrqCIrlqtXTSWF/dhqpr5t0SKtmbKxPbAfmUDUGOAleiRy9OP+Uay4f\nn6fU2POpjssL51Bom+fd3KABK6aF/nIhklU8J09VFbgIdfUfQheIt88xPu+m\n/+Fwvj6TR+AHcTDxKwFZdDG3zp60eaB8AclMLbXTjxBjIAVWU6DF2kUzCn+g\n96wcjlkMSR17xZ4+WauVCdUstwdxYWITJHGzGUvQEaH1CFzYyqN1m68cYf7O\nKowMC8ha5BvuY/w7QsrEf4sH6+pxzIEcPd+2zv/05kjcq6WnsabJbMq4gsOG\nZKFXBlMD+ZCNAkX6AusZdOSul4MSrzdYJa8CqEi6ClKfvNy3FAGt7hvfkkn5\n+F/c9jO3Z2/YOSDpXvZuOnJwlT66wyjs2H22ZQe+6Xh/s/ff8DvlJBl38s6+\n75My\r\n=CHUf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEh2ScwAj9C6DeQhLUM/+f9Tu5HS3Wqthr7qu95FLjeIAiB4q2V5Lcr9Ycc+gADboaVDfKJqmY2PfhZazaQtFiaHEg=="}]},"_npmUser":{"name":"iokloud.com","email":"iokloud.com@gmail.com"},"directories":{},"maintainers":[{"name":"iokloud.com","email":"iokloud.com@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/borokero-auth_0.0.2-development_1622890993542_0.981916533447712"},"_hasShrinkwrap":false}},"time":{"created":"2021-06-05T11:03:13.305Z","0.0.2-development":"2021-06-05T11:03:13.799Z","modified":"2022-04-04T20:13:13.604Z"},"maintainers":[{"name":"iokloud.com","email":"iokloud.com@gmail.com"}],"description":"Authentication and Authorization module of HTTP/MQTT/CoAP Brokers based on NodeJS for IoT or Internet of Things.","homepage":"https://github.com/borokero/borokero-auth#readme","keywords":["moscajs","aedes","authentication","authorization","mqtt","http","credintial","access token"],"repository":{"type":"git","url":"git+https://github.com/borokero/borokero-auth.git"},"author":{"name":"Hadi Mahdavi"},"bugs":{"url":"https://github.com/borokero/borokero-auth/issues"},"license":"MIT","readme":"# Authentication and Authorization Module for Brokers\n\n[![Build Status](https://travis-ci.com/borokero/borokero-auth.svg)](https://travis-ci.com/borokero/borokero-auth)\n\n<div align=\"center\">\n    <img src=\"https://raw.githubusercontent.com/borokero/borokero-auth/main/docs/asset/repository-open-graph.png\" width=\"500px\"</img> \n</div>\n\nAuthentication and Authorization module of HTTP/MQTT/CoAP Brokers based on NodeJS for IoT or Internet of Things. This repo is under development.\n\n\n##  Getting Started\n\n* \n* If you want to run a test locally, clone this repo.\n\n``` bash\ngit clone https://github.com/borokero/borokero-auth\ncd borokero-auth\nnpm install\nbash ./scripts/start-server.sh\nnpm run test\n```\nIt runs tests. You should attention broker needs to configure keycloak. Scripts start-server.sh and stop-server.sh help to start and stop [Keycloak](https://www.keycloak.org/) server with a demo realm. It configs keycloak by demo clients and users and needs docker command.\n\n\n### How Using it\nThis module use Node-style callback and it can be used with [Aedes](https://github.com/mcollina/aedes).\n\n``` js\n'use strict'\nvar aedes = require('aedes')\nvar authBroker = require('@borokero/borokero-auth')\n\n\nvar envAuth = {\n  auth: {\n    realm: \"tokenRealmTest\",\n    \"auth-server-url\": \"http://localhost:8080/auth\",\n    \"ssl-required\": \"external\",\n    resource: \"admin-cli\",\n    \"public-client\": true,\n    \"confidential-port\": 0\n  },\n  jwt: {\n    salt: 'salt', //salt by pbkdf2 method\n    digest: 'sha512',\n    // size of the generated hash\n    hashBytes: 64,\n    // larger salt means hashed passwords are more resistant to rainbow table, but\n    // you get diminishing returns pretty fast\n    saltBytes: 16,\n    // more iterations means an attacker has to take longer to brute force an\n    // individual password, so larger is better. however, larger also means longer\n    // to hash the password. tune so that hashing the password takes about a\n    // second\n    iterations: 10\n  },\n  wildCard: {\n    wildcardOne: '+',\n    wildcardSome: '#',\n    separator: '/'\n  },\n  adapters: {\n    mqtt: {\n      limitW: 50,\n      limitMPM: 10\n    }\n  }\n}\n\nvar authbroker = new authBroker(envAuth)\n\naedes.authenticate = authbroker.authenticateWithCredentials()\naedes.authorizeSubscribe = authbroker.authorizeSubscribe()\naedes.authorizePublish = authbroker.authorizePublish()\n\nconst server = require('net').createServer(aedes.handle)\nconst port = 1883\n\nserver.listen(port, function () {\n  console.log('server listening on port', port)\n})\n```\n\n\n\n## Contributing\n\n[![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](https://github.com/dwyl/esta/issues)\n\nAnyone with interest in or experience with the following technologies are encouraged to join the project.\n\n## Authors / Contributors\n\n* [Hadi Mahdavi](https://twitter.com/kamerdack)\n\n\n\n## Credits / Inspiration\n\n* Matteo Collina for Mosca, Aedes, Ponte (https://github.com/mcollina/mosca)\n* Eugenio Pace for Auth0 Mosca inspiration (https://github.com/eugeniop/auth0mosca)\n\n\n## Copyright\n\nMIT - Copyright (c) 2019 ioKloud\n","readmeFilename":"README.md"}