npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@borokero/borokero-auth

v0.0.2-development

Published

Authentication and Authorization module of HTTP/MQTT/CoAP Brokers based on NodeJS for IoT or Internet of Things.

Downloads

8

Readme

Authentication and Authorization Module for Brokers

Build Status

Authentication and Authorization module of HTTP/MQTT/CoAP Brokers based on NodeJS for IoT or Internet of Things. This repo is under development.

Getting Started

  • If you want to run a test locally, clone this repo.
git clone https://github.com/borokero/borokero-auth
cd borokero-auth
npm install
bash ./scripts/start-server.sh
npm run test

It runs tests. You should attention broker needs to configure keycloak. Scripts start-server.sh and stop-server.sh help to start and stop Keycloak server with a demo realm. It configs keycloak by demo clients and users and needs docker command.

How Using it

This module use Node-style callback and it can be used with Aedes.

'use strict'
var aedes = require('aedes')
var authBroker = require('@borokero/borokero-auth')


var envAuth = {
  auth: {
    realm: "tokenRealmTest",
    "auth-server-url": "http://localhost:8080/auth",
    "ssl-required": "external",
    resource: "admin-cli",
    "public-client": true,
    "confidential-port": 0
  },
  jwt: {
    salt: 'salt', //salt by pbkdf2 method
    digest: 'sha512',
    // size of the generated hash
    hashBytes: 64,
    // larger salt means hashed passwords are more resistant to rainbow table, but
    // you get diminishing returns pretty fast
    saltBytes: 16,
    // more iterations means an attacker has to take longer to brute force an
    // individual password, so larger is better. however, larger also means longer
    // to hash the password. tune so that hashing the password takes about a
    // second
    iterations: 10
  },
  wildCard: {
    wildcardOne: '+',
    wildcardSome: '#',
    separator: '/'
  },
  adapters: {
    mqtt: {
      limitW: 50,
      limitMPM: 10
    }
  }
}

var authbroker = new authBroker(envAuth)

aedes.authenticate = authbroker.authenticateWithCredentials()
aedes.authorizeSubscribe = authbroker.authorizeSubscribe()
aedes.authorizePublish = authbroker.authorizePublish()

const server = require('net').createServer(aedes.handle)
const port = 1883

server.listen(port, function () {
  console.log('server listening on port', port)
})

Contributing

contributions welcome

Anyone with interest in or experience with the following technologies are encouraged to join the project.

Authors / Contributors

Credits / Inspiration

  • Matteo Collina for Mosca, Aedes, Ponte (https://github.com/mcollina/mosca)
  • Eugenio Pace for Auth0 Mosca inspiration (https://github.com/eugeniop/auth0mosca)

Copyright

MIT - Copyright (c) 2019 ioKloud