Comments (12)
FWIW Lua also supports https out-of-the-box (not suggesting it is a better option than the webhooks plugin
http.ensure_pool({pool_id = "test"})
ret = http.post("test", "https://www.google.com", "", {x_post_header = "X-POST-HEADER"})
print(ret.status)
body = http.body(ret.ref)
print(body)
from vernemq.
@SameerTi In case you're looking to integrate into a HTTP backend, I think you're better off using the WebHooks plugin. (which also supports HTTPS).
👉 Thank you for supporting VerneMQ: https://github.com/sponsors/vernemq
👉 Using the binary VerneMQ packages commercially (.deb/.rpm/Docker) requires a paid subscription.
from vernemq.
Thanks @ioolkos for Quick response.
Requirement is to be able to connect with Oracle via Lua plugin, however, I guess, that's not supported, please correct me If I'm wrong..!!
Hence started to look into "https" direction for Authentication purposes.
If above is not supported, and like you said, to use WebHooks plugin, could you please share some examples of that for "https" ?
from vernemq.
@SameerTi I just noticed that some edits on the doc for 1.12.3 were not merged downstream, so some options regarding HTTPS are missing in the WebHooks docs for newer releases.
Find the basic HTTPS options here: https://docs.vernemq.com/v/1.12.3/plugin-development/webhookplugins#configuring-webhooks
I'll have to merge this forward into docs for newer releases and main branch. Apologies!
👉 Thank you for supporting VerneMQ: https://github.com/sponsors/vernemq
👉 Using the binary VerneMQ packages commercially (.deb/.rpm/Docker) requires a paid subscription.
from vernemq.
FWIW Lua also supports https out-of-the-box (not suggesting it is a better option than the webhooks plugin
http.ensure_pool({pool_id = "test"}) ret = http.post("test", "https://www.google.com", "", {x_post_header = "X-POST-HEADER"}) print(ret.status) body = http.body(ret.ref) print(body)
Hi @mths1
Thanks for your response.
Do you have any examples of "https" usage inside Lua plugin script , where its required to configure certificates, keyStore etc.?
That would be very helpful
Thanks,
Sameer
from vernemq.
@SameerTi I just noticed that some edits on the doc for 1.12.3 were not merged downstream, so some options regarding HTTPS are missing in the WebHooks docs for newer releases. Find the basic HTTPS options here: https://docs.vernemq.com/v/1.12.3/plugin-development/webhookplugins#configuring-webhooks I'll have to merge this forward into docs for newer releases and main branch. Apologies!
👉 Thank you for supporting VerneMQ: https://github.com/sponsors/vernemq 👉 Using the binary VerneMQ packages commercially (.deb/.rpm/Docker) requires a paid subscription.
Hi @ioolkos
Could you please confirm, if both of the below can be turned ON at the same time and be working seamlessly?
plugins.vmq_diversity = on
plugins.vmq_webhooks = on
from vernemq.
@SameerTi you can run vmq_webhooks
and vmq_diversity
in parallel (or rather: in a chain). The way this works is that the first auth plugin will be called and if it returns "next", then the next plugin will be called to authenticate that client.
So, there's 2 things you need to do:
- have a load order, defined by the config order in
vernemq.conf
, or by explicitly configuring a priority:
plugins.vmq_webhooks.priority = 1
plugins.vmq_diversity.priority = 2
- Make the first plugin in your chain return "next" (instead of "false") when it cannot auth the client.
Here's the doc forauth_on_register
in the WebHooks plugin:
https://docs.vernemq.com/plugin-development/webhookplugins#auth_on_register
👉 Thank you for supporting VerneMQ: https://github.com/sponsors/vernemq
👉 Using the binary VerneMQ packages commercially (.deb/.rpm/Docker) requires a paid subscription.
from vernemq.
Hi @ioolkos
If we don't define a Priority on webhooks and diversity, would they still work fine in parallel?
Also, as @mths1 mentioned earlier, that "Lua also supports https out-of-the-box...."
Could you please share any examples of "https" usage inside Lua plugin script where it's required to configure certificates, keyStore etc.? That would be very helpful".
Lua gives us options of receiving a response and apply some custom logic using Lua scripts.
However with Webhooks, it's all configured in vernemq.conf file and then we can't apply our custom logic there, can we?
from vernemq.
@SameerTi as mentioned before, the load order of plugins should be determined by the order you have them in the vernemq.conf
. You can also check this with vmq-admin plugin show
👉 Thank you for supporting VerneMQ: https://github.com/sponsors/vernemq
👉 Using the binary VerneMQ packages commercially (.deb/.rpm/Docker) requires a paid subscription.
from vernemq.
FWIW Lua also supports https out-of-the-box (not suggesting it is a better option than the webhooks plugin
http.ensure_pool({pool_id = "test"}) ret = http.post("test", "https://www.google.com", "", {x_post_header = "X-POST-HEADER"}) print(ret.status) body = http.body(ret.ref) print(body)
Hi @mths1 Thanks for your response. Do you have any examples of "https" usage inside Lua plugin script , where its required to configure certificates, keyStore etc.? That would be very helpful
Thanks, Sameer
Hi @mths1 ,
Appreciate if you could please share any example where certificates are used for "https" calls in lua scripts.
from vernemq.
@SameerTi : As far as I can tell, it is currently not possible to add a ca or somethine to the diversity plugin. Webhook has support. I can see two use cases: certificate pinning and self-signed certificates. Adding a configuration option to both plugins to specify a ca wouldn't be too hard.
@ioolkos : What do you think?
from vernemq.
Regarding vmq_diversity
, I'm open to any extensions (or experiments). Or regarding Luerl, I should actually say. We've always kept it close to the use case of hook implementations.
👉 Thank you for supporting VerneMQ: https://github.com/sponsors/vernemq
👉 Using the binary VerneMQ packages commercially (.deb/.rpm/Docker) requires a paid subscription.
from vernemq.
Related Issues (20)
- Environment variables for erlang configuration HOT 3
- Multiple connections using same client_id and username HOT 9
- Changes in mysql.lua file to not match client_id from myql HOT 3
- Using username in a TLS context is inappropriate HOT 3
- Need help with ECONNRESET using mqtt.js and VerneMQ HOT 5
- Add api Key using environment variables HOT 10
- [Bug]: Caching for auth_on_xxx_m5 hooks is not working HOT 8
- max_request_line_length config has no effect for HTTP sessions
- [Question]: Does VerneMQ support RocksDB in 1.13.0? HOT 12
- [Bug]: Issues with the correct CPU quota detection on k8s v1.26 HOT 12
- [Bug]: Outgoing QoS upgrades not affecting storage of offline messages HOT 5
- [Bug]: vmq_http_pub plugins apis not restricted by api key and bounded to default http listener HOT 7
- Enhancement: MQTT TLS listeners with multiple TLS versions.
- [Bug]: Loss of retained QoS 1 messages across cluster nodes HOT 1
- [Bug]: <title>HIGH CPU for VerneMQ (beam.smp) HOT 3
- Support Alternative TCP listener with proxy protocol enabled by default HOT 6
- [Bug]: Websockets upgrade request: HTTP 431: Request Header Fields Too Large with big cookies HOT 11
- [Bug]: CRASH REPORT Process with 0 neighbours crashed with reason: bad argument in vmq_cluster_com:process_bytes/3 line 171 HOT 1
- Seeing various messages in the logs when under load HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vernemq.