smaak 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/smaak/smaak_service.rb +2 -2
- data/lib/smaak/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 39327bf4044936bb06e935ec7e1d35dd2c67a1fe
|
4
|
+
data.tar.gz: 18adcc536adf29a44a3267303943e94d9f9a9226
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dbd9d13568b816a111e91e01be82a7c1fa714f72bc5bbbcc27e1a6df1eab928936b5a40fe266aea49abe024117d021d302c94081fdb182fd8950f357a7d96f7e
|
7
|
+
data.tar.gz: e94dd4e70f3635042f315876a456d594c3ac9bcc0ba17ea89fb5f4487e483e32fc4659407698b4986683cc44b2895bab27be137445b8cc631a235ed1206a05ec
|
data/README.md
CHANGED
@@ -16,12 +16,12 @@ Smaak verifies an AuthMessage signed in the Authorization header by looking at n
|
|
16
16
|
|
17
17
|
A Smaak::Server operates on an instance of an HTTP request received. The Smaak module can be told about different request technology implementations by providing an adaptor to a request technology (Smaak::add_request_adaptor). The gem ships with a Rack::Request adaptor. Call Smaak::create_adaptor with your request to get an instance of an adaptor.
|
18
18
|
|
19
|
-
A Smaak::Server needs to keep track of nonces received in the fresh-ness interval of requests. To make this easy, you can extend Smaak::SmaakService. Override the
|
19
|
+
A Smaak::Server needs to keep track of nonces received in the fresh-ness interval of requests. To make this easy, you can extend Smaak::SmaakService. Override the configure_services method to provide your server's public key, private key and associations. Smaak::SmaakService provides a cache of received nonces checked against the freshness interval.
|
20
20
|
|
21
21
|
When setting up a Smaak::Server, tell the server of your SmaakService and verify incoming request, so:
|
22
22
|
|
23
23
|
class SecureServer < Smaak::SmaakService
|
24
|
-
def configure_services
|
24
|
+
def configure_services(configuration = nil)
|
25
25
|
@smaak_server.set_public_key(File.read '/secure/server_public.pem')
|
26
26
|
@smaak_server.set_private_key(File.read '/secure/server_private.pem') # only required when encryption is specified
|
27
27
|
@smaak_server.add_association('client-facing-service-needing-back-end-data', File.read '/secure/client_public.pem', 'client-pre-shared-key')
|
data/lib/smaak/smaak_service.rb
CHANGED
@@ -18,10 +18,10 @@ module Smaak
|
|
18
18
|
|
19
19
|
def initialize(configuration = nil)
|
20
20
|
@smaak_server = Smaak::Server.new
|
21
|
-
|
21
|
+
configure_services(configuration)
|
22
22
|
end
|
23
23
|
|
24
|
-
def
|
24
|
+
def configure_services(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