smaak 0.0.7 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +17 -1
  3. data/lib/smaak/version.rb +1 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b1fa033c8f361f4af863c394544ffd64c8a9d9d0
4
- data.tar.gz: fcccba2f5edd21f6112754588e86f34fccc72871
3
+ metadata.gz: 912bd5b1b240ebfa14e69bee351cebcff27121ed
4
+ data.tar.gz: c70d123d751d5880d2202cc404395290c6d7d3fc
5
5
  SHA512:
6
- metadata.gz: 3e70ec242a2eb128ae0e63363b4828f7f35bec12057f5be3cd9110063b6fbcf16327c6554571044906ed35a6ca9c7e4145f29f1167c5b5a0893589ee9f374618
7
- data.tar.gz: 3a77ea6150c62382e5c01ebcb6e7362a5f8d926660cf212828f782d994aa51d316eaf7c337d683843c87a4efd1db50169c6bad65450953c975df425a63ea913e
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
- TODO: Write usage instructions here
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
@@ -1,3 +1,3 @@
1
1
  module Smaak
2
- VERSION = "0.0.7"
2
+ VERSION = "0.0.8"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smaak
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ernst van Graan