Skip to content

Commit

Permalink
Merge pull request #919 from RickCarlino/mqtt_updates
Browse files Browse the repository at this point in the history
Update allowed MQTT channel regex
  • Loading branch information
RickCarlino committed Jul 19, 2018
2 parents 60111d0 + ec58467 commit 95350ac
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/controllers/api/rmq_utils_controller.rb
Expand Up @@ -7,7 +7,8 @@ module Api
class RmqUtilsController < Api::AbstractController
# The only valid format for AMQP / MQTT topics.
# Prevents a whole host of abuse / security issues.
TOPIC_REGEX = /(bot\.device_)\d*\.(from_clients|from_device|logs|status|sync|resources_v0|from_api)\.?.*/
TOPIC_REGEX = \
/(bot\.device_)\d*\.(from_clients|from_device|logs|status|sync|resources_v0|from_api)\.?.*/
MALFORMED_TOPIC = "malformed topic. Must match #{TOPIC_REGEX.inspect}"
ALL = [:user, :vhost, :resource, :topic]
VHOST = ENV.fetch("MQTT_VHOST") { "/" }
Expand Down

0 comments on commit 95350ac

Please sign in to comment.