Sha256: 83849420ae978a6065dc49890b86b87996c1fba89fbde440319de2d0cdc351ec
Contents?: true
Size: 1.61 KB
Versions: 40
Compression:
Stored size: 1.61 KB
Contents
# frozen_string_literal: true module RubyRabbitmqJanus module Tools module Replaces # Format message request with good data to HASH format for Admin request. # Manage level, debug and admin_secret # # @author VAILLANT Jeremy <jeremy.vaillant@dazzl.tv> class Admin < Handle private KEY_ACCEPTED = %w[colors debug level filename folder max_nack_queue no_media_timer timestamps token truncate timeout].freeze def replace_element_classic super replace_admins if request.key?('admin_secret') add_secret if opts.key?('add') end def add_secret values = opts['add'] request.merge!(values) end def replace_admins replace_admin KEY_ACCEPTED.each do |key| replace_component(key) if request.key?(key) end end def replace_component(key) request[key] = type.convert(key, opts) rescue => exception ::Log.warn "Error replace #{key} : #{exception}" end def replace_admin request['admin_secret'] = admin_pass rescue => exception ::Log.warn "Error replace admin_secret : #{exception}" end def admin_pass Tools::Config.instance.options['rabbit']['admin_pass'] end end end end end
Version data entries
40 entries across 40 versions & 1 rubygems