smaak 0.1.2 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/README.md +1 -1
- data/lib/smaak/smaak_service.rb +5 -5
- data/lib/smaak/version.rb +1 -1
- data/spec/lib/smaak/smaak_service_spec.rb +1 -1
- 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: c625b2faec8089ccc1b1a3ffc3472237e9c05dc5
|
4
|
+
data.tar.gz: 917a6df39f7c236f875d86be62ff7e5508f1f156
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 766fcdfe4c88209c0575d56fef859e7d5a5b025666421dc025345bd194f20c6b83fd25f5b0848682657c8ba98d917455fd9723765b603091374537efaa8a1f76
|
7
|
+
data.tar.gz: fb1d32ac19be19b94e7dc0c2bd93a02703db3690d0b65e544d92b117a489a5a1ab2cde109c46c5dbda4e71d96dbdbb98bc9bac4ea776d0a398a453345dd93a93
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -4,7 +4,7 @@ This gems caters for both client and server sides of a signed message interactio
|
|
4
4
|
|
5
5
|
## Smaak mechanism
|
6
6
|
|
7
|
-
When provisioning a Smaak::Server and a Smaak::Client, all associations these services should be aware of are provisioned by calling add_association. The associations are indexed by identifier (e.g. FQDN of the associate,) and remember the associate's public key, a pre-shared key and a boolean indicating whether the association expects data to encrypted.
|
7
|
+
When provisioning a Smaak::Server and a Smaak::Client, all associations these services should be aware of are provisioned by calling add_association. The associations are indexed by identifier (e.g. FQDN of the associate,) and remember the associate's public key, a pre-shared key and a boolean indicating whether the association expects data to be encrypted.
|
8
8
|
|
9
9
|
Smaak appends 'x-smaak' headers to the HTTP request to convey a generated nonce, expiry, the requestor's identifier, the pre-shared key (obfuscated) and a digest of the request body. The headers are signed using the requestor (Smaak::Client)'s private key. If encryption is requested, the message body is encrypted using the receiver (Smaak::Server)'s public key. The message body for the response from the Smaak::Server to the Smaak::Client is also encrypted. RSA 4096 bit keys are recommended.
|
10
10
|
|
data/lib/smaak/smaak_service.rb
CHANGED
@@ -7,21 +7,21 @@ module Smaak
|
|
7
7
|
@@instance = nil
|
8
8
|
attr_reader :smaak_server
|
9
9
|
|
10
|
-
def self.get_instance
|
10
|
+
def self.get_instance(configuration = nil)
|
11
11
|
@@mutex.synchronize do
|
12
12
|
if (@@instance.nil?)
|
13
|
-
@@instance = self.new
|
13
|
+
@@instance = self.new(configuration)
|
14
14
|
end
|
15
15
|
@@instance
|
16
16
|
end
|
17
17
|
end
|
18
18
|
|
19
|
-
def initialize
|
19
|
+
def initialize(configuration = nil)
|
20
20
|
@smaak_server = Smaak::Server.new
|
21
|
-
configure_service
|
21
|
+
configure_service(configuration)
|
22
22
|
end
|
23
23
|
|
24
|
-
def configure_service
|
24
|
+
def configure_service(configuration = nil)
|
25
25
|
# @smaak_server.set_public_key(File.read('/service-provider-pub.pem'))
|
26
26
|
# @smaak_server.add_association('service-client-01', File.read('service-client-01-public.pem'), 'pre-shared-key')
|
27
27
|
end
|
data/lib/smaak/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: smaak
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ernst van Graan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-07-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: persistent-cache
|