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

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

Instance Method Summary collapse

Methods inherited from Legion::Transport::Message

#content_encoding, #content_type, #encode_message, #encrypt_message, #exchange_name, #expiration, #headers, #initialize, #priority, #publish, #timestamp

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)


21
22
23
# File 'lib/legion/transport/messages/request_cluster_secret.rb', line 21

def encrypt?
  false
end

#exchangeObject



16
17
18
19
# File 'lib/legion/transport/messages/request_cluster_secret.rb', line 16

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

#messageObject



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

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



3
4
5
# File 'lib/legion/transport/messages/request_cluster_secret.rb', line 3

def routing_key
  'node.crypt.push_cluster_secret'
end

#typeObject



25
26
27
# File 'lib/legion/transport/messages/request_cluster_secret.rb', line 25

def type
  'task'
end

#validateObject



29
30
31
# File 'lib/legion/transport/messages/request_cluster_secret.rb', line 29

def validate
  @valid = true
end