soar_smaak 0.1.6 → 0.1.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 +1 -1
- data/lib/soar_smaak/secure_service.rb +16 -4
- data/lib/soar_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: a0d2005902a0f993117f7d732223dffdd78e2606
|
4
|
+
data.tar.gz: d2a8b34f9ee6f9fc36354e0e48f7bfa38199ed52
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 774d5d5ec9f6840c3e366eaefa1196314ceb437f6d7350cc9c3380252aab04bb17f9af27b7651b5f9f058f2b722ace045c4bbf91bcfabc41f674b2bb2a6822d2
|
7
|
+
data.tar.gz: ea138fc88436347864e7a93d03e556f28569f7ffff972e4fc911427f884fb8a8f98e131cd7644987f0eed0754f9803b1f8f57aa8d80a64d8e0af3f11d53e9a0a
|
data/README.md
CHANGED
@@ -43,7 +43,7 @@ A dictionary of paths and an indication whether the route is signed. If no route
|
|
43
43
|
|
44
44
|
### auditing: optional
|
45
45
|
|
46
|
-
An auditing provider that adheres to the API specified here: https://rubygems.org/gems/soar_auditor_api. If an auditing provider is not present,
|
46
|
+
An auditing provider that adheres to the API specified here: https://rubygems.org/gems/soar_auditor_api. If an auditing provider is not present, STDOUT will be used.
|
47
47
|
|
48
48
|
## Installation
|
49
49
|
|
@@ -8,6 +8,10 @@ module SoarSmaak
|
|
8
8
|
@@auditing = auditing
|
9
9
|
end
|
10
10
|
|
11
|
+
def self.auditing
|
12
|
+
@@auditing
|
13
|
+
end
|
14
|
+
|
11
15
|
def self.smaak_configured?(configuration)
|
12
16
|
(not configuration['public_key'].nil?) and
|
13
17
|
(not configuration['private_key'].nil?) and
|
@@ -18,6 +22,14 @@ module SoarSmaak
|
|
18
22
|
configuration['smaak'] and (configuration['smaak'].downcase.strip == 'dynamic')
|
19
23
|
end
|
20
24
|
|
25
|
+
def debug(message)
|
26
|
+
if SoarSmaak::SecureService::auditing.nil?
|
27
|
+
SoarSmaak::SecureService::auditing.debug(message)
|
28
|
+
else
|
29
|
+
puts message
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
21
33
|
def configure_services(configuration)
|
22
34
|
if (not SoarSmaak::SecureService::smaak_configured?(configuration) and
|
23
35
|
SoarSmaak::SecureService::smaak_dynamic?(configuration))
|
@@ -25,19 +37,19 @@ module SoarSmaak
|
|
25
37
|
elsif (SoarSmaak::SecureService::smaak_configured?(configuration))
|
26
38
|
configure_smaak(configuration)
|
27
39
|
else
|
28
|
-
|
40
|
+
debug "SMAAK is neither dynamic nor configured. SMAAK support disabled"
|
29
41
|
end
|
30
42
|
end
|
31
43
|
|
32
44
|
def seed_dynamic_smaak
|
33
|
-
|
45
|
+
debug "SMAAK credentials not provided."
|
34
46
|
load_smaak_trust_store
|
35
47
|
randomize_smaak
|
36
48
|
end
|
37
49
|
|
38
50
|
def randomize_smaak
|
39
51
|
@dynamic = @trust_store.associations.keys[rand(@trust_store.associations.keys.size) + 1]
|
40
|
-
|
52
|
+
debug "Seeding random key-pair and identifier"
|
41
53
|
@smaak_server.set_public_key(@trust_store.associations[@dynamic]['public_key'])
|
42
54
|
@smaak_server.set_private_key(@trust_store.associations[@dynamic]['private_key'])
|
43
55
|
@smaak_server.verify_recipient = false
|
@@ -56,7 +68,7 @@ module SoarSmaak
|
|
56
68
|
configuration['associations'].each do |identifier, config|
|
57
69
|
@smaak_server.add_association(identifier, config['public_key'], config['psk'], config['encrypt'])
|
58
70
|
end
|
59
|
-
|
71
|
+
debug "SMAAK credentials provided. SMAAK configured"
|
60
72
|
end
|
61
73
|
end
|
62
74
|
end
|
data/lib/soar_smaak/version.rb
CHANGED