rubyconfig-vault 0.1.2 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6472a1998cf169f1dca30ea8106dc75b21f2faf9a480ee1bf382d324e2c79c19
4
- data.tar.gz: d25f00cd1684191891ae98689db23e3aace676d9188b26e6ad09a2a199e04d82
3
+ metadata.gz: b468333af49d93bac42b51514158c5d3867604ca9aa7c64ac7a6ce02421821b9
4
+ data.tar.gz: ea5200b58941e1dab0fdf9cc09fa7532fda3b054702994d0b28081b259be0a5f
5
5
  SHA512:
6
- metadata.gz: d07012ba1f5d6e89a29ff6797c6cbbb94277e9766d1771f051a7ba408ae929dbd58ea8bf82cc1dd6e348352a9d8df0d68dd8bf227a329e2b55775278bace5077
7
- data.tar.gz: 6881a30a2b2a9cddf3d0c7753f744eef1b809d72fa669cbf89f4347234a44be47c150e404754e54ced347d449ff6e5467c260f185ac1d4226ce7a90946d8f26e
6
+ metadata.gz: 7a06193b680915812e77b1632ca04c54aaedea10d99b3894f36737f97028f5321c2e844f5030746285b9bfea08e97c1ee9272764c97b896de546a8485a63c5e3
7
+ data.tar.gz: 756beb031fcc04827054e8ddc8b3c8077cb86d9cd5488bed1021f0994bf3477717370650c23f65512e3b880fef9dd9b8d8dd29afa09babfddc79470b313ae46f
@@ -2,10 +2,17 @@ require 'vault'
2
2
 
3
3
  module Config
4
4
  module Sources
5
+ # A vault source for Config
5
6
  class VaultSource
6
7
  attr_accessor :kv, :root
7
8
  attr_reader :paths, :client
8
9
 
10
+ # Create a new Config source
11
+ #
12
+ # @param [Hash] opts
13
+ # @option opts [String, nil] :kv mount point for operations
14
+ # @option opts [Array<String>, nil] :paths paths for vault secrets
15
+ # @option opts [String, Symbol, nil] :root root key for data provided by source
9
16
  def initialize(opts = {})
10
17
  client_opts = opts.clone
11
18
  @kv = client_opts.delete(:kv) || ''
@@ -14,18 +21,32 @@ module Config
14
21
  @client = Vault::Client.new(client_opts)
15
22
  end
16
23
 
24
+ # Add a path to Config source
25
+ #
26
+ # @example Use glob operators
27
+ # source.add_path('secrets/**/test/*')
28
+ # source.load #=> { secrets: { some_key: { test: { secret_data: 2 } } } }
29
+ #
30
+ # @param path [String]
17
31
  def add_path(path)
18
32
  @paths << path
19
33
  end
20
34
 
35
+ # Remove added paths
21
36
  def clear_paths
22
37
  @paths = []
23
38
  end
24
39
 
40
+ # Load data from source into hash
41
+ #
42
+ # @return [Hash]
25
43
  def load
26
44
  process_paths
27
45
  end
28
46
 
47
+ # Client reference for quick operations
48
+ #
49
+ # @return [Vault::KV, Vault:Logical]
29
50
  def client
30
51
  unless kv.empty?
31
52
  @client.kv(@kv)
@@ -1,5 +1,5 @@
1
- module Rubyconfig
1
+ module Config
2
2
  module Vault
3
- VERSION = "0.1.2"
3
+ VERSION = "1.0.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubyconfig-vault
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Young
@@ -96,6 +96,7 @@ metadata:
96
96
  allowed_push_host: https://rubygems.org
97
97
  homepage_uri: https://github.com/CrunchwrapSupreme/rubyconfig-vault
98
98
  source_code_uri: https://github.com/CrunchwrapSupreme/rubyconfig-vault
99
+ documentation_uri: https://www.rubydoc.info/gems/rubyconfig-vault/index
99
100
  post_install_message:
100
101
  rdoc_options: []
101
102
  require_paths: