eventq_base 1.11.0 → 1.11.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/eventq_base/queue_message.rb +9 -0
- data/lib/eventq_base/serialization_providers/json_serialization_provider.rb +8 -3
- data/lib/eventq_base/signature_providers/sha256_signature_provider.rb +7 -2
- data/lib/eventq_base/version.rb +1 -1
- data/lib/eventq_base.rb +3 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6a3d376ae2e2fdc9f58fa988b19ad2561783525f
|
4
|
+
data.tar.gz: 4e7ebfe60ebbead6cc03571a6572e47bfa10acf1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b9891d45f66b897e69b8e6fbf33b25e77d1c0ac50bc4ac4206aad0dd990b3a8128b0769ffcae69a255f7282e60e0adb652673695ab48902421d94f41ef458a95
|
7
|
+
data.tar.gz: b4f10cbd713aa9432389cefd9bd87a69d23dedc1e2c0ee9824c50fb7f05b685509054fac064be718953c44fd5928482e8643438bc0133440cdfd353df596bb1f
|
@@ -15,5 +15,14 @@ module EventQ
|
|
15
15
|
@id = SecureRandom.uuid
|
16
16
|
end
|
17
17
|
|
18
|
+
# Creates a signature for the message
|
19
|
+
#
|
20
|
+
# @param provider [EventQ::SignatureProviders::Sha256SignatureProvider] Signature provider that implements
|
21
|
+
# a write method
|
22
|
+
def sign(provider)
|
23
|
+
return unless EventQ::Configuration.signature_secret
|
24
|
+
|
25
|
+
self.signature = provider.write(message: self, secret: EventQ::Configuration.signature_secret)
|
26
|
+
end
|
18
27
|
end
|
19
28
|
end
|
@@ -8,14 +8,19 @@ module EventQ
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def serialize(object)
|
11
|
-
|
12
|
-
return JSON.dump(hash)
|
11
|
+
JSON.dump(object_to_hash(object))
|
13
12
|
end
|
14
13
|
|
15
14
|
def deserialize(json)
|
16
15
|
return @class_kit_helper.from_json(json: json, klass: EventQ::QueueMessage)
|
17
16
|
end
|
18
17
|
|
18
|
+
private
|
19
|
+
|
20
|
+
def object_to_hash(object)
|
21
|
+
return object if object.is_a?(Hash)
|
22
|
+
@hash_helper.to_hash(object)
|
23
|
+
end
|
19
24
|
end
|
20
25
|
end
|
21
|
-
end
|
26
|
+
end
|
@@ -6,7 +6,7 @@ module EventQ
|
|
6
6
|
class Sha256SignatureProvider
|
7
7
|
|
8
8
|
def initialize
|
9
|
-
@serializer = EventQ::
|
9
|
+
@serializer = serialization_provider_manager.get_provider(EventQ::Configuration.serialization_provider)
|
10
10
|
end
|
11
11
|
|
12
12
|
#This method is called to create a signature for a message
|
@@ -22,6 +22,11 @@ module EventQ
|
|
22
22
|
message.signature == signature
|
23
23
|
end
|
24
24
|
|
25
|
+
private
|
26
|
+
|
27
|
+
def serialization_provider_manager
|
28
|
+
EventQ::SerializationProviders::Manager.new
|
29
|
+
end
|
25
30
|
end
|
26
31
|
end
|
27
|
-
end
|
32
|
+
end
|
data/lib/eventq_base/version.rb
CHANGED
data/lib/eventq_base.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eventq_base
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.11.
|
4
|
+
version: 1.11.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- vaughanbrittonsage
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-03-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|