pushyd 0.28.0 → 0.29.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b8612e269821eb37ef38091bcabda952f9f4ee11
4
- data.tar.gz: ff67ec148ccc6cf1013a4b9e5ef4ba544e506233
3
+ metadata.gz: a749a292924095ab9fec8a08f289af5fa6a16b53
4
+ data.tar.gz: ed181381859547eb6912b00bb52cf8cf36661247
5
5
  SHA512:
6
- metadata.gz: 2d5c581d5206ffb6a418138093ff481f909dcef8d85d0aa136586f7d8806232a548aaf95a1c7db30d68301f3f1dc1442593429b68d18cf286b9597cd027b4575
7
- data.tar.gz: 591bd2d61df03280d3ea98d8c9d3b68e7c26e302960467625ce59b3614da18f28bb1b15654e3a559b4171ad66288f37010b65731f1bd3adfb3f5cfad7ae327d3
6
+ metadata.gz: 0f7d19606c8bac6f49177b03d7ac978ca957131008eb31cdbddcdb8cfdf77475dcb42efdb2755f0a4ea47dddb9bd5890461915ba48bc09aa2a29e8f30a117fcd
7
+ data.tar.gz: 35d995274060434296d2a4bdd298129b999eba4de30b8d3f18d7aeab77ef649e1e3fcaca18bc25ded0ea6675043f32654d02b4593a47e99b7bb2d12884d55b58
@@ -1,4 +1,6 @@
1
1
  # common defaults
2
+ daemonize: true
3
+
2
4
  broker: amqp://guest:guest@localhost:5672/%2F
3
5
 
4
6
  logs:
@@ -36,12 +38,20 @@ rollbar:
36
38
  # topic: proxy
37
39
  # keys: proxy.#
38
40
  # keys: proxy.key1, proxy.key2, proxy.key3
39
- # keys:
40
- # - proxy.key1
41
- # - proxy.key2
42
- # - proxy.key3
43
- # keys: "proxy.#"
44
- # keys: "proxy.#"
41
+ # keys:
42
+ # - proxy.key1
43
+ # - proxy.key2
44
+ # - proxy.key3
45
45
  # subscribe: false
46
- # #relay: http://requestb.in/1clzv7v1
46
+ # relay: http://target-host.com/url
47
+ # sign:
48
+ # method: hmac-kong
49
+ # user: brice+2@wildmoka.com
50
+ # secret: g9WoMkz0cp4C
51
+ # headers:
52
+ # - date
53
+ # - content-md5
54
+ # headers:
55
+ # Authorization: none
56
+ # SampleHeader: header-value
47
57
 
@@ -86,6 +86,12 @@ module PushyDaemon
86
86
  user_agent: BmcDaemonLib::Conf.generate_user_agent,
87
87
  }
88
88
 
89
+ # Set custom headers if provided
90
+ @rule[:headers].each do |header_name, header_value|
91
+ log_debug "set header [#{header_name}] to [#{header_value}]"
92
+ headers[header_name] = header_value.to_s
93
+ end if @rule[:headers].is_a? Enumerable
94
+
89
95
  # Compute: payload MD5, HMAC signature
90
96
  headers_md5 headers, request_body
91
97
  headers_sign headers, @rule[:sign]
@@ -106,8 +106,8 @@ module PushyDaemon
106
106
  end
107
107
 
108
108
  # Check we have a topic and at least one routing key
109
- fail BmcDaemonLib::MqConsumerError, "rule [#{rule_name}] lacking topic" unless rule_topic
110
- fail BmcDaemonLib::MqConsumerError, "rule [#{rule_name}] lacking keys" if rule_keys.empty?
109
+ fail BmcDaemonLib::MqConsumerError, "rule [#{rule_name}]: missing topic" unless rule_topic
110
+ fail BmcDaemonLib::MqConsumerError, "rule [#{rule_name}]: missing keys" if rule_keys.empty?
111
111
 
112
112
  # Build a new consumer on its own channel
113
113
  channel = @conn.create_channel
@@ -82,6 +82,7 @@ module PushyDaemon
82
82
  # Prepare routing_key
83
83
  keys = []
84
84
  keys << @shouter_topic
85
+ keys << "ping"
85
86
  keys << SecureRandom.hex
86
87
  keys << @shouter_keys.sample if (@shouter_keys.is_a?(Array) && @shouter_keys.any?)
87
88
  routing_key = keys.join('.')
@@ -1,7 +1,7 @@
1
1
  # coding: utf-8
2
2
  Gem::Specification.new do |spec|
3
3
  # Project version
4
- spec.version = "0.28.0"
4
+ spec.version = "0.29.0"
5
5
 
6
6
  # Project description
7
7
  spec.name = "pushyd"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pushyd
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.28.0
4
+ version: 0.29.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bruno MEDICI
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-05-29 00:00:00.000000000 Z
11
+ date: 2017-10-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler