Class: Legion::Transport::Messages::RequestClusterSecret

Inherits:
Legion::Transport::Message show all
Defined in:
lib/legion/transport/messages/request_cluster_secret.rb

Constant Summary

Constants inherited from Legion::Transport::Message

Legion::Transport::Message::ENVELOPE_KEYS

Constants included from Common

Common::NAMESPACE_BOUNDARIES

Instance Method Summary collapse

Methods inherited from Legion::Transport::Message

#app_id, #channel, #content_encoding, #content_type, #correlation_id, #encode_message, #encrypt_message, #exchange_name, #expiration, #headers, #initialize, max_payload_bytes, #message_id, #persistent, #priority, #publish, #reply_to, #timestamp, #user_id

Methods included from Common

#channel, #channel_open?, #close, #close!, #deep_merge, #generate_consumer_tag, #open_channel, #options_builder

Constructor Details

This class inherits a constructor from Legion::Transport::Message

Instance Method Details

#encrypt?Boolean

Returns:

  • (Boolean)


23
24
25
# File 'lib/legion/transport/messages/request_cluster_secret.rb', line 23

def encrypt?
  false
end

#exchangeObject



18
19
20
21
# File 'lib/legion/transport/messages/request_cluster_secret.rb', line 18

def exchange
  require 'legion/transport/exchanges/node'
  Legion::Transport::Exchanges::Node
end

#messageObject



9
10
11
12
13
14
15
16
# File 'lib/legion/transport/messages/request_cluster_secret.rb', line 9

def message
  { function:     'push_cluster_secret',
    node_name:    Legion::Settings[:client][:name],
    queue_name:   "node.#{Legion::Settings[:client][:name]}",
    runner_class: 'Legion::Extensions::Node::Runners::Crypt',
    # public_key: Base64.encode64(Legion::Crypt.public_key) }
    public_key:   Legion::Crypt.public_key }
end

#routing_keyObject



5
6
7
# File 'lib/legion/transport/messages/request_cluster_secret.rb', line 5

def routing_key
  'node.crypt.push_cluster_secret'
end

#typeObject



27
28
29
# File 'lib/legion/transport/messages/request_cluster_secret.rb', line 27

def type
  'task'
end

#validateObject



31
32
33
# File 'lib/legion/transport/messages/request_cluster_secret.rb', line 31

def validate
  @valid = true
end