Skip to content

A VerneMQ plugin demonstrating the authentication and authorization hooks.

Notifications You must be signed in to change notification settings

vernemq/vernemq_demo_plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

VerneMQ Demo Plugin

This plugin demonstrates how you can develop an Authentication/Authorization plugin for VerneMQ. The important files are:

  • src/vernemq_demo_plugin.erl
  • src/vernemq_demo_plugin.app.src

The rest is the Erlang OTP application boilerplate.

You must have a recent version of Erlang installed (it's recommended to use the same one VerneMQ is compiled for, typically > 17). To compile do:

./rebar3 compile

Then enable the plugin using:

vmq-admin plugin enable --name vernemq_demo_plugin --path <PathToYourPlugin>/vernemq_demo_plugin/_build/default

Depending on how VerneMQ is started you might need sudo rights to access vmq-admin. Moreover the <PathToYourPlugin> should be accessible by VerneMQ (file permissions).

Since this demo plugin implements hooks which are already covered by vmq_passwd and vmq_acl you might want to disable these in order to see the effect of this plugin.

vmq-admin plugin disable --name vmq_passwd
vmq-admin plugin disable --name vmq_acl

That's it!

About

A VerneMQ plugin demonstrating the authentication and authorization hooks.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages