vault-tree 0.3.4 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (190) hide show
  1. data/.gitignore +3 -0
  2. data/.rspec +1 -0
  3. data/CHANGE_LOG.md +27 -0
  4. data/README.md +15 -73
  5. data/features/contracts/asymmetric_vault.feature +69 -2
  6. data/features/contracts/block_chain_key_transfer.feature +59 -0
  7. data/features/contracts/one_two_three.feature +109 -1
  8. data/features/contracts/readme.md +5 -6
  9. data/features/contracts_and_vaults.md +19 -24
  10. data/features/decision_tree.md +1 -1
  11. data/features/exceptions.feature +54 -43
  12. data/features/install_and_usage.md +38 -33
  13. data/features/keywords/assembled_shamir_key.feature +17 -17
  14. data/features/keywords/dh_key.feature +5 -5
  15. data/features/keywords/external_input.feature +35 -0
  16. data/features/keywords/external_key.feature +24 -0
  17. data/features/keywords/key.feature +3 -3
  18. data/features/keywords/random_number.feature +3 -3
  19. data/features/keywords/shamir_key_shares.feature +29 -0
  20. data/features/keywords/shamir_share.feature +40 -0
  21. data/features/keywords/split_key.feature +10 -9
  22. data/features/keywords/unlocked.feature +3 -3
  23. data/features/readme.md +1 -1
  24. data/features/steps/asymmetric_vault.steps.rb +14 -21
  25. data/features/steps/block_chain_key_transfer.steps.rb +17 -22
  26. data/features/steps/core.steps.rb +60 -71
  27. data/features/steps/exceptions.steps.rb +27 -64
  28. data/features/steps/external_input.steps.rb +17 -0
  29. data/features/steps/one_two_three.steps.rb +21 -27
  30. data/features/steps/secret_sharing.steps.rb +36 -19
  31. data/lib/vault-tree.rb +1 -1
  32. data/lib/vault-tree/contract/content_ciphertext.rb +33 -0
  33. data/lib/vault-tree/contract/content_plaintext.rb +33 -0
  34. data/lib/vault-tree/contract/contract.rb +15 -72
  35. data/lib/vault-tree/contract/contract_header.rb +11 -0
  36. data/lib/vault-tree/contract/vault.rb +24 -74
  37. data/lib/vault-tree/contract/vault_key.rb +21 -0
  38. data/lib/vault-tree/contract/vault_list.rb +56 -0
  39. data/lib/vault-tree/exceptions/empty_vault.rb +18 -3
  40. data/lib/vault-tree/exceptions/failed_lock_attempt.rb +18 -0
  41. data/lib/vault-tree/exceptions/failed_unlock_attempt.rb +23 -1
  42. data/lib/vault-tree/exceptions/invalid_external_input.rb +16 -0
  43. data/lib/vault-tree/exceptions/{missing_passphrase.rb → invalid_shamir_split.rb} +2 -1
  44. data/lib/vault-tree/exceptions/library_exception.rb +64 -0
  45. data/lib/vault-tree/exceptions/missing_partner_decryption_key.rb +11 -1
  46. data/lib/vault-tree/exceptions/unsupported_keyword.rb +17 -1
  47. data/lib/vault-tree/exceptions/vault_does_not_exist.rb +8 -1
  48. data/lib/vault-tree/keywords/assembled_shamir_key.rb +1 -1
  49. data/lib/vault-tree/keywords/contents.rb +1 -1
  50. data/lib/vault-tree/keywords/dh_key.rb +2 -2
  51. data/lib/vault-tree/keywords/external_input.rb +58 -0
  52. data/lib/vault-tree/keywords/external_key.rb +20 -0
  53. data/lib/vault-tree/keywords/key.rb +7 -1
  54. data/lib/vault-tree/keywords/keyword_interpreter.rb +5 -3
  55. data/lib/vault-tree/keywords/public_encryption_key.rb +1 -5
  56. data/lib/vault-tree/keywords/shamir_key_shares.rb +18 -0
  57. data/lib/vault-tree/keywords/shamir_share.rb +18 -0
  58. data/lib/vault-tree/keywords/split_key.rb +1 -1
  59. data/lib/vault-tree/lock_smith.rb +7 -8
  60. data/lib/vault-tree/lock_smith/{generated_shamir_key.rb → shamir_key_shares.rb} +22 -21
  61. data/lib/vault-tree/lock_smith/{split_key.rb → split_key_crypto.rb} +0 -0
  62. data/lib/vault-tree/version.rb +1 -1
  63. data/spec/assembled_shamir_key_spec.rb +0 -1
  64. data/spec/custom_exception_spec.rb +81 -0
  65. data/spec/lock_smith_spec.rb +0 -48
  66. data/spec/secret_sharing_spec.rb +0 -1
  67. data/spec/shamir_key_shares_spec.rb +27 -0
  68. data/vault-tree.gemspec +1 -1
  69. metadata +33 -139
  70. data/Gemfile.lock +0 -53
  71. data/VagrantFile +0 -30
  72. data/features/keywords/external_data.feature +0 -11
  73. data/features/keywords/generated_shamir_key.feature +0 -55
  74. data/features/keywords/master_passphrase.feature +0 -68
  75. data/features/manipulating_contracts.md +0 -84
  76. data/features/support/contract_fixtures/asymmetric_vault.0.1.0.json +0 -69
  77. data/features/support/contract_fixtures/blank_simple_test_contract.json +0 -14
  78. data/features/support/contract_fixtures/block_chain_key_transfer.0.1.0.json +0 -59
  79. data/features/support/contract_fixtures/broken_contract.json +0 -55
  80. data/features/support/contract_fixtures/one_two_three.0.7.0.json +0 -108
  81. data/features/support/contract_fixtures/simple_test_contract.json +0 -14
  82. data/features/support/contract_fixtures/template.json +0 -33
  83. data/lib/vault-tree/contract/close_validator.rb +0 -28
  84. data/lib/vault-tree/contract/doorman.rb +0 -113
  85. data/lib/vault-tree/contract/open_validator.rb +0 -20
  86. data/lib/vault-tree/exceptions/exception_template.erb +0 -0
  87. data/lib/vault-tree/exceptions/fill_attempt_master_password.rb +0 -6
  88. data/lib/vault-tree/exceptions/missing_external_data.rb +0 -6
  89. data/lib/vault-tree/exceptions/vault_tree_exception.rb +0 -25
  90. data/lib/vault-tree/keywords/external_data.rb +0 -32
  91. data/lib/vault-tree/keywords/generated_shamir_key.rb +0 -57
  92. data/lib/vault-tree/keywords/master_passphrase.rb +0 -9
  93. data/spec/generated_shamir_key_spec.rb +0 -52
  94. data/support/cookbooks/ark/.gitignore +0 -12
  95. data/support/cookbooks/ark/.kitchen.yml +0 -34
  96. data/support/cookbooks/ark/.travis.yml +0 -6
  97. data/support/cookbooks/ark/Berksfile +0 -9
  98. data/support/cookbooks/ark/CHANGELOG.md +0 -87
  99. data/support/cookbooks/ark/CONTRIBUTING.md +0 -257
  100. data/support/cookbooks/ark/README.md +0 -301
  101. data/support/cookbooks/ark/Rakefile +0 -36
  102. data/support/cookbooks/ark/TESTING.md +0 -25
  103. data/support/cookbooks/ark/Toftfile +0 -15
  104. data/support/cookbooks/ark/attributes/default.rb +0 -6
  105. data/support/cookbooks/ark/chefignore +0 -96
  106. data/support/cookbooks/ark/files/default/foo.tar.gz +0 -0
  107. data/support/cookbooks/ark/files/default/foo.tbz +0 -0
  108. data/support/cookbooks/ark/files/default/foo.tgz +0 -0
  109. data/support/cookbooks/ark/files/default/foo.zip +0 -0
  110. data/support/cookbooks/ark/files/default/tests/minitest/default_test.rb +0 -0
  111. data/support/cookbooks/ark/files/default/tests/minitest/support/helpers.rb +0 -0
  112. data/support/cookbooks/ark/files/default/tests/minitest/test_test.rb +0 -94
  113. data/support/cookbooks/ark/libraries/default.rb +0 -167
  114. data/support/cookbooks/ark/metadata.rb +0 -13
  115. data/support/cookbooks/ark/providers/default.rb +0 -370
  116. data/support/cookbooks/ark/recipes/default.rb +0 -31
  117. data/support/cookbooks/ark/recipes/test.rb +0 -138
  118. data/support/cookbooks/ark/resources/default.rb +0 -54
  119. data/support/cookbooks/ark/templates/default/add_to_path.sh.erb +0 -1
  120. data/support/cookbooks/ark/test/support/Gemfile +0 -4
  121. data/support/cookbooks/build-essential/README.md +0 -24
  122. data/support/cookbooks/build-essential/metadata.rb +0 -10
  123. data/support/cookbooks/build-essential/recipes/default.rb +0 -45
  124. data/support/cookbooks/chruby/.gitignore +0 -15
  125. data/support/cookbooks/chruby/.kitchen.yml +0 -26
  126. data/support/cookbooks/chruby/.ruby_version +0 -1
  127. data/support/cookbooks/chruby/Berksfile +0 -3
  128. data/support/cookbooks/chruby/Gemfile +0 -7
  129. data/support/cookbooks/chruby/LICENSE +0 -14
  130. data/support/cookbooks/chruby/README.md +0 -92
  131. data/support/cookbooks/chruby/Rakefile +0 -7
  132. data/support/cookbooks/chruby/Thorfile +0 -6
  133. data/support/cookbooks/chruby/Vagrantfile +0 -86
  134. data/support/cookbooks/chruby/attributes/default.rb +0 -10
  135. data/support/cookbooks/chruby/chefignore +0 -96
  136. data/support/cookbooks/chruby/metadata.rb +0 -11
  137. data/support/cookbooks/chruby/recipes/default.rb +0 -43
  138. data/support/cookbooks/chruby/recipes/system.rb +0 -25
  139. data/support/cookbooks/chruby/templates/default/chruby.sh.erb +0 -22
  140. data/support/cookbooks/chruby/test/integration/default/bash/embedded_test.sh +0 -1
  141. data/support/cookbooks/git/.gitignore +0 -14
  142. data/support/cookbooks/git/.kitchen.yml +0 -46
  143. data/support/cookbooks/git/Berksfile +0 -8
  144. data/support/cookbooks/git/CHANGELOG.md +0 -87
  145. data/support/cookbooks/git/CONTRIBUTING +0 -29
  146. data/support/cookbooks/git/Gemfile +0 -3
  147. data/support/cookbooks/git/LICENSE +0 -201
  148. data/support/cookbooks/git/README.md +0 -115
  149. data/support/cookbooks/git/TESTING.md +0 -25
  150. data/support/cookbooks/git/attributes/default.rb +0 -40
  151. data/support/cookbooks/git/metadata.rb +0 -35
  152. data/support/cookbooks/git/recipes/default.rb +0 -53
  153. data/support/cookbooks/git/recipes/server.rb +0 -58
  154. data/support/cookbooks/git/recipes/source.rb +0 -49
  155. data/support/cookbooks/git/recipes/windows.rb +0 -37
  156. data/support/cookbooks/git/templates/default/git-xinetd.d.erb +0 -10
  157. data/support/cookbooks/git/templates/default/sv-git-daemon-log-run.erb +0 -2
  158. data/support/cookbooks/git/templates/default/sv-git-daemon-run.erb +0 -3
  159. data/support/cookbooks/install_ruby/README.md +0 -3
  160. data/support/cookbooks/install_ruby/metadata.rb +0 -10
  161. data/support/cookbooks/install_ruby/recipes/default.rb +0 -14
  162. data/support/cookbooks/ruby_build/.gitignore +0 -6
  163. data/support/cookbooks/ruby_build/.kitchen.yml +0 -31
  164. data/support/cookbooks/ruby_build/.travis.yml +0 -4
  165. data/support/cookbooks/ruby_build/Berksfile +0 -10
  166. data/support/cookbooks/ruby_build/CHANGELOG.md +0 -72
  167. data/support/cookbooks/ruby_build/Gemfile +0 -14
  168. data/support/cookbooks/ruby_build/README.md +0 -338
  169. data/support/cookbooks/ruby_build/Rakefile +0 -21
  170. data/support/cookbooks/ruby_build/attributes/default.rb +0 -67
  171. data/support/cookbooks/ruby_build/chefignore +0 -53
  172. data/support/cookbooks/ruby_build/libraries/ruby_build_recipe_helpers.rb +0 -40
  173. data/support/cookbooks/ruby_build/metadata.rb +0 -18
  174. data/support/cookbooks/ruby_build/providers/ruby.rb +0 -88
  175. data/support/cookbooks/ruby_build/recipes/default.rb +0 -69
  176. data/support/cookbooks/ruby_build/resources/ruby.rb +0 -33
  177. data/support/cookbooks/ruby_build/test/cookbooks/alltherubies/metadata.rb +0 -10
  178. data/support/cookbooks/ruby_build/test/cookbooks/alltherubies/recipes/default.rb +0 -59
  179. data/support/cookbooks/ruby_build/test/integration/alltherubies/bats/_verify_tests.bash +0 -33
  180. data/support/cookbooks/ruby_build/test/integration/alltherubies/bats/verify_1.8.7.bats +0 -29
  181. data/support/cookbooks/ruby_build/test/integration/alltherubies/bats/verify_1.9.2.bats +0 -18
  182. data/support/cookbooks/ruby_build/test/integration/alltherubies/bats/verify_1.9.3.bats +0 -18
  183. data/support/cookbooks/ruby_build/test/integration/alltherubies/bats/verify_2.0.0.bats +0 -18
  184. data/support/cookbooks/ruby_build/test/integration/alltherubies/bats/verify_jruby.bats +0 -20
  185. data/support/cookbooks/ruby_build/test/integration/alltherubies/bats/verify_rbx.bats +0 -18
  186. data/support/cookbooks/ruby_build/test/integration/alltherubies/bats/verify_ree.bats +0 -19
  187. data/support/cookbooks/ruby_build/test/integration/installation/bats/installation.bats +0 -6
  188. data/support/scripts/libsodium_ubuntu.sh +0 -80
  189. data/support/tasks/.gitkeep +0 -0
  190. data/support/tasks/libsodium_install.rb +0 -57
@@ -0,0 +1,11 @@
1
+ module VaultTree
2
+ class ContractHeader
3
+ def initialize(header_hash)
4
+ @header_hash = header_hash
5
+ end
6
+
7
+ def to_hash
8
+ @header_hash
9
+ end
10
+ end
11
+ end
@@ -9,104 +9,54 @@ module VaultTree
9
9
  end
10
10
 
11
11
  def close
12
- close_ancestors
13
- close_self
12
+ @properties['contents'] = locked_contents
13
+ self
14
14
  end
15
15
 
16
- def retrieve_contents
16
+ def open
17
+ self.close
17
18
  unlocked_contents
18
19
  end
19
20
 
20
- def fill_with
21
- properties['fill_with']
22
- end
23
-
24
- def lock_with
25
- properties['lock_with']
26
- end
27
-
28
- def unlock_with
29
- properties['unlock_with']
30
- end
31
-
32
- def contents
33
- properties['contents']
34
- end
35
-
36
- def empty?
37
- contents.empty?
38
- end
39
-
40
21
  def filler
41
- KeywordInterpreter.new(fill_with, self).evaluate
22
+ KeywordInterpreter.new(properties['fill_with'], self).evaluate
42
23
  end
43
24
 
44
25
  def locking_key
45
- KeywordInterpreter.new(lock_with, self).evaluate
26
+ VaultKey.new KeywordInterpreter.new(properties['lock_with'], self).evaluate
46
27
  end
47
28
 
48
29
  def unlocking_key
49
- KeywordInterpreter.new(unlock_with, self).evaluate
50
- end
51
-
52
- private
53
-
54
- def close_ancestors
55
- close_lock_ancestor
56
- close_fill_ancestor
57
- end
58
-
59
- def close_self
60
- @properties['contents'] = locked_contents
61
- self
62
- end
63
-
64
- def unlocked_contents
65
- Doorman.new(self).unlocked_contents
30
+ VaultKey.new KeywordInterpreter.new(properties['unlock_with'], self).evaluate
66
31
  end
67
32
 
68
33
  def locked_contents
69
- Doorman.new(self).locked_contents
70
- end
71
-
72
- def close_lock_ancestor
73
- contract.close_vault(lock_ancestor_id)
74
- end
75
-
76
- def close_fill_ancestor
77
- contract.close_vault(fill_ancestor_id)
34
+ begin
35
+ already_locked? ? properties['contents'] : ciphertext(filler)
36
+ rescue RbNaCl::CryptoError => e
37
+ raise Exceptions::FailedLockAttempt.new(e, vault_id: id)
38
+ end
78
39
  end
79
40
 
80
- def has_lock_ancestor?
81
- lock_with_key_or_contents?
82
- end
83
-
84
- def has_fill_ancestor?
85
- fill_with_key_or_contents?
86
- end
87
-
88
- def lock_with_key_or_contents?
89
- (locking_word_base == 'CONTENTS') || (locking_word_base == 'KEY')
90
- end
91
-
92
- def locking_word_base
93
- KeywordInterpreter.new(lock_with,self).word_base
41
+ def unlocked_contents
42
+ begin
43
+ plaintext properties['contents']
44
+ rescue RbNaCl::CryptoError => e
45
+ raise Exceptions::FailedUnlockAttempt.new(e, vault_id: id)
46
+ end
94
47
  end
95
48
 
96
- def fill_with_key_or_contents?
97
- (filling_word_base == 'CONTENTS') || (filling_word_base == 'KEY')
49
+ def ciphertext(m)
50
+ ContentCiphertext.new(m, locking_key).evaluate
98
51
  end
99
52
 
100
- def filling_word_base
101
- KeywordInterpreter.new(fill_with,self).word_base
53
+ def plaintext(c)
54
+ ContentPlaintext.new(c, unlocking_key).evaluate
102
55
  end
103
56
 
104
- def lock_ancestor_id
105
- lock_with.extract_ancestor_id if has_lock_ancestor?
57
+ def already_locked?
58
+ ! (properties['contents'].nil? || properties['contents'].empty?)
106
59
  end
107
60
 
108
- def fill_ancestor_id
109
- fill_with.extract_ancestor_id if has_fill_ancestor?
110
- end
111
61
  end
112
62
  end
@@ -0,0 +1,21 @@
1
+ module VaultTree
2
+ class VaultKey
3
+ attr_reader :k
4
+
5
+ def initialize(k)
6
+ @k = k
7
+ end
8
+
9
+ def secret
10
+ asymmetric? ? k.secret_key : k
11
+ end
12
+
13
+ def public
14
+ asymmetric? ? k.public_key : nil
15
+ end
16
+
17
+ def asymmetric?
18
+ k.kind_of?(DHKeyPair)
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,56 @@
1
+ module VaultTree
2
+ class VaultList
3
+ attr_reader :vaults_hash, :contract
4
+
5
+ def initialize(vaults_hash, contract)
6
+ @vaults_hash = vaults_hash
7
+ @contract = contract
8
+ end
9
+
10
+ def close_vault(id)
11
+ validate_vault(id)
12
+ update_vaults vault(id).close
13
+ self
14
+ end
15
+
16
+ def open_vault(id)
17
+ validate_vault(id)
18
+ vault(id).open
19
+ end
20
+
21
+ def vault_closed?(id)
22
+ non_empty_contents?(id)
23
+ end
24
+
25
+ def to_hash
26
+ @vaults_hash
27
+ end
28
+
29
+ private
30
+
31
+ def non_empty_contents?(id)
32
+ ! empty_contents?(id)
33
+ end
34
+
35
+ def empty_contents?(id)
36
+ vaults_hash[id]['contents'].nil? || vaults_hash[id]['contents'].empty?
37
+ end
38
+
39
+ def update_vaults(vault)
40
+ @vaults_hash[vault.id] = vault.properties unless vault.kind_of?(NullVault)
41
+ end
42
+
43
+ def vault(id)
44
+ id.nil? ? NullVault.new : Vault.new(id, vaults_hash[id], contract)
45
+ end
46
+
47
+ def validate_vault(id)
48
+ raise Exceptions::VaultDoesNotExist.new(nil,vault_id: id) unless valid_id?(id)
49
+ end
50
+
51
+ def valid_id?(id)
52
+ id.nil? || vaults_hash.include?(id)
53
+ end
54
+ end
55
+ end
56
+
@@ -1,8 +1,23 @@
1
1
  module VaultTree
2
2
  module Exceptions
3
- class EmptyVault < VaultTreeException
4
- # Cant open emtpy vaults
5
- # Attempted to open an empty vault
3
+ class EmptyVault < LibraryException
4
+
5
+ def post_initialize(params)
6
+ @vault_id = params[:vault_id]
7
+ end
8
+
9
+ def runtime_information
10
+ %Q{The following vault was empty: #{@vault_id}
11
+
12
+ Vault Tree does not allow you to open an empty vault.
13
+ An empty vault means the the vault contents field is an empty
14
+ string.
15
+
16
+ * Are you closing the vaults in the right order?
17
+ * Are you attempting to open a vault before all
18
+ of the vaults that it references have been closed?
19
+ }
20
+ end
6
21
  end
7
22
  end
8
23
  end
@@ -0,0 +1,18 @@
1
+ module VaultTree
2
+ module Exceptions
3
+ class FailedLockAttempt < LibraryException
4
+
5
+ def post_initialize(params)
6
+ @vault_id = params[:vault_id]
7
+ @locking_key = params[:locking_key]
8
+ end
9
+
10
+ def runtime_information
11
+ %Q{
12
+ Attempted to Lock Vault:
13
+ #{@vault_id}
14
+ }
15
+ end
16
+ end
17
+ end
18
+ end
@@ -1,6 +1,28 @@
1
1
  module VaultTree
2
2
  module Exceptions
3
- class FailedUnlockAttempt < VaultTreeException
3
+ class FailedUnlockAttempt < LibraryException
4
+
5
+ def post_initialize(params)
6
+ @vault_id = params[:vault_id]
7
+ @unlocking_key = params[:unlocking_key]
8
+ end
9
+
10
+ def runtime_information
11
+ %Q{
12
+ Attempted to Unlock Vault:
13
+ #{@vault_id}
14
+
15
+ * Can you access the vault key?
16
+ - Does the CPU that is executing this particular contract
17
+ have access to the vault key? It could be the case that
18
+ this contract does not permit you to open this particular vault.
19
+ - Are you providing the correct key to the Vault Tree Contract? It
20
+ could be that your are trying to open the vault with the wrong key.
21
+ * Invalid Ciphertext?
22
+ - Have the encrypted contents of the vault been tampered with?
23
+ The underlying Vault Tree Cryto library (NaCl) uses authenticated
24
+ encryption. This ensures that ciphertext cannot be modified.}
25
+ end
4
26
  end
5
27
  end
6
28
  end
@@ -0,0 +1,16 @@
1
+ module VaultTree
2
+ module Exceptions
3
+ class InvalidExternalInput < LibraryException
4
+ def post_initialize(params)
5
+ @vault_id = params[:vault_id]
6
+ end
7
+
8
+ def runtime_information
9
+ %Q{
10
+ Vault:
11
+ #{@vault_id}
12
+ }
13
+ end
14
+ end
15
+ end
16
+ end
@@ -1,6 +1,7 @@
1
1
  module VaultTree
2
2
  module Exceptions
3
- class MissingPassphrase < VaultTreeException
3
+ class InvalidShamirSplit < LibraryException
4
4
  end
5
5
  end
6
6
  end
7
+
@@ -0,0 +1,64 @@
1
+ module VaultTree
2
+ module Exceptions
3
+ class LibraryException < StandardError
4
+ attr_reader :original_exception
5
+
6
+ def initialize(original_exception = nil, runtime_information = {})
7
+ @original_exception = original_exception
8
+ post_initialize(runtime_information)
9
+ end
10
+
11
+ def post_initialize(opts)
12
+ nil
13
+ end
14
+
15
+ def runtime_information
16
+ {}
17
+ end
18
+
19
+ def exception
20
+ self
21
+ end
22
+
23
+ def message
24
+ output_exception_message
25
+ end
26
+
27
+ def background
28
+ nil
29
+ end
30
+
31
+ def troubleshooting_questions
32
+ nil
33
+ end
34
+
35
+ def name
36
+ self.class
37
+ end
38
+
39
+ private
40
+
41
+ def output_exception_message
42
+ STDOUT.write(full_exception_message)
43
+ end
44
+
45
+ def full_exception_message
46
+ %Q{
47
+ #{message_banner}
48
+ #{name}
49
+ #{message_banner}
50
+ #{present_runtime_information}
51
+ }
52
+ end
53
+
54
+ def message_banner
55
+ %Q{####################################################}
56
+ end
57
+
58
+ def present_runtime_information
59
+ "#{runtime_information}" unless runtime_information.empty?
60
+ end
61
+
62
+ end
63
+ end
64
+ end
@@ -1,6 +1,16 @@
1
1
  module VaultTree
2
2
  module Exceptions
3
- class MissingPartnerDecryptionKey < VaultTreeException
3
+ class MissingPartnerDecryptionKey < LibraryException
4
+ def post_initialize(params)
5
+ @vault_id = params[:vault_id]
6
+ end
7
+
8
+ def runtime_information
9
+ %Q{
10
+ Missing Decryption Key For:
11
+ #{@vault_id}
12
+ }
13
+ end
4
14
  end
5
15
  end
6
16
  end
@@ -1,6 +1,22 @@
1
1
  module VaultTree
2
2
  module Exceptions
3
- class UnsupportedKeyword < VaultTreeException
3
+ class UnsupportedKeyword < LibraryException
4
+ def post_initialize(params)
5
+ @vault_id = params[:vault_id]
6
+ @keyword = params[:keyword]
7
+ end
8
+
9
+ def runtime_information
10
+ %Q{
11
+ It looks like you have used an unsupported Keyword.
12
+
13
+ Attempted Keyword:
14
+ #{@keyword}
15
+
16
+ Vault:
17
+ #{@vault_id}
18
+ }
19
+ end
4
20
  end
5
21
  end
6
22
  end
@@ -1,6 +1,13 @@
1
1
  module VaultTree
2
2
  module Exceptions
3
- class VaultDoesNotExist < VaultTreeException
3
+ class VaultDoesNotExist < LibraryException
4
+ def post_initialize(params)
5
+ @vault_id = params[:vault_id]
6
+ end
7
+
8
+ def runtime_information
9
+ %Q{Can not find vault #{@vault_id}}
10
+ end
4
11
  end
5
12
  end
6
13
  end