smaak 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +17 -1
- 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: 912bd5b1b240ebfa14e69bee351cebcff27121ed
|
4
|
+
data.tar.gz: c70d123d751d5880d2202cc404395290c6d7d3fc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c41876e698456b7622ba2bcd830d0ee028c79e5e7f3faea73a6f2d876a5fffdb168548af432657e77631bb6554c451bd4c939c3525c2d65e244a3ea40c9e9e6c
|
7
|
+
data.tar.gz: b868d6d8a52e3c5cad0785947551d3983de142b874b3e3df04f948bcbfbd479200fdf68256bb4e3663332f285c7fe9e2b8bb6d4d5ac7a977fd5da8bc237c56de
|
data/README.md
CHANGED
@@ -42,7 +42,23 @@ Though arbitrary data can be added for signature and an arbitrary validator prov
|
|
42
42
|
|
43
43
|
## Usage
|
44
44
|
|
45
|
-
|
45
|
+
Inject your certs and pre-shared keys from the environment, or configuration files or configuration service, etc. User your HTTP library of choice.
|
46
|
+
|
47
|
+
### Client
|
48
|
+
|
49
|
+
client = Smaak::Client.new
|
50
|
+
client.set_identity('service-provider-public')
|
51
|
+
client.set_private_key(File.read '/home/ubuntu/secure/service-provider-public.pem')
|
52
|
+
client.add_association('service-provider-internal', File.read('/home/ubuntu/secure/service-provider-internal-pub.pem'), 'pre-shared-key')
|
53
|
+
|
54
|
+
response = Unirest.get "http://service-provider-internal:9393/secure-service", headers:{ "Authorization" => client.build_auth_header('service-provider-internal') }, parameters:{ :identity => request.session['user'] }
|
55
|
+
|
56
|
+
### Server
|
57
|
+
|
58
|
+
server = Smaak::Server.new
|
59
|
+
server.set_public_key(File.read('/home/ubuntu/secure/service-provider-internal-pub.pem'))
|
60
|
+
server.add_association('service-provider-public', File.read('/home/ubuntu/secure/service-provider-public-pub.pem'), 'pre-shared-key')
|
61
|
+
requestor = server.verify_signed_request(request)
|
46
62
|
|
47
63
|
## Contributing
|
48
64
|
|
data/lib/smaak/version.rb
CHANGED