ruby_vault 0.1.0.pre.13 → 0.1.0.pre.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d40a8d757f596aa8fb8c1900e1d317ded67098c0afae11ba27ab2c90c9fb2625
4
- data.tar.gz: 83f4c230fb052fd4d8152e8dd2f741d2675d4f8bf397ea6561dbaef45f6bc7de
3
+ metadata.gz: b7f36432434eebe9d29814ea87207855d888d471bede5d6baa069e34c332d749
4
+ data.tar.gz: f021a1281e92ab14f6e9cd6fcfe0e97a71f3c9c39b1ada07e628a6b020f39ab0
5
5
  SHA512:
6
- metadata.gz: f04805293ea5398a68b474db7672c1e4129f8be9e215e48e036290eaca0ee3f413527a32e69c799e9ad26599b8841ba6038108f863e95a88f13db6e197fb19f3
7
- data.tar.gz: 3982035d0d513e80ce2957cc6bb075f94d8aad86caf7bf93dab0b6548d7111fa429bca29fac6be44758880d980dcd26f409c28213444e5e16c66b5fdfc1cbe48
6
+ metadata.gz: bdf2f62179d0e4ed2593db536e970393e8f8280a797cdffc4039ccbbc36a00567c9d85667bbc894b72c8341603fc22fa7c4b63cf42420822cbc3de217adb8d75
7
+ data.tar.gz: 74f1e931a687479dbf0004752a9dfcad405dc955d08919c273b6e4b358e32a1f97666555781c0646a93a4137435ea8b334e3b2ee49445aa81ec9a08010c87e84
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ruby_vault (0.1.0.pre.13)
4
+ ruby_vault (0.1.0.pre.16)
5
5
  immutable-struct (~> 2.4)
6
6
  lino (~> 3.0)
7
7
 
@@ -69,7 +69,7 @@ GEM
69
69
  sawyer (~> 0.9)
70
70
  open4 (1.3.4)
71
71
  parallel (1.22.1)
72
- parser (3.1.2.0)
72
+ parser (3.1.2.1)
73
73
  ast (~> 2.4.1)
74
74
  pry (0.14.1)
75
75
  coderay (~> 1.1)
@@ -115,17 +115,17 @@ GEM
115
115
  diff-lcs (>= 1.2.0, < 2.0)
116
116
  rspec-support (~> 3.11.0)
117
117
  rspec-support (3.11.0)
118
- rubocop (1.33.0)
118
+ rubocop (1.34.1)
119
119
  json (~> 2.3)
120
120
  parallel (~> 1.10)
121
- parser (>= 3.1.0.0)
121
+ parser (>= 3.1.2.1)
122
122
  rainbow (>= 2.2.2, < 4.0)
123
123
  regexp_parser (>= 1.8, < 3.0)
124
124
  rexml (>= 3.2.5, < 4.0)
125
- rubocop-ast (>= 1.19.1, < 2.0)
125
+ rubocop-ast (>= 1.20.0, < 2.0)
126
126
  ruby-progressbar (~> 1.7)
127
127
  unicode-display_width (>= 1.4.0, < 3.0)
128
- rubocop-ast (1.20.1)
128
+ rubocop-ast (1.21.0)
129
129
  parser (>= 3.1.1.0)
130
130
  rubocop-rake (0.6.0)
131
131
  rubocop (~> 1.0)
@@ -182,4 +182,4 @@ DEPENDENCIES
182
182
  yard
183
183
 
184
184
  BUNDLED WITH
185
- 2.3.19
185
+ 2.3.20
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'base'
4
+
5
+ module RubyVault
6
+ module Commands
7
+ class List < Base
8
+ # @!visibility private
9
+ def subcommands
10
+ %w[list]
11
+ end
12
+
13
+ # @!visibility private
14
+ def options
15
+ super +
16
+ Options::Sets::HTTP_OPTIONS +
17
+ Options::Sets::OUTPUT_OPTIONS
18
+ end
19
+
20
+ # @!visibility private
21
+ def arguments(parameters)
22
+ [parameters[:path]].compact.flatten
23
+ end
24
+ end
25
+ end
26
+ end
@@ -12,7 +12,16 @@ module RubyVault
12
12
 
13
13
  # @!visibility private
14
14
  def options
15
- super + Options::Sets::HTTP_OPTIONS + ['-method']
15
+ super +
16
+ Options::Sets::HTTP_OPTIONS +
17
+ Options::Sets::OUTPUT_OPTIONS +
18
+ %w[
19
+ -method
20
+ -no-print
21
+ -no-store
22
+ -path
23
+ -token-only
24
+ ]
16
25
  end
17
26
 
18
27
  def arguments(parameters)
@@ -12,12 +12,16 @@ module RubyVault
12
12
 
13
13
  # @!visibility private
14
14
  def options
15
- super + Options::Sets::HTTP_OPTIONS
15
+ super +
16
+ Options::Sets::HTTP_OPTIONS +
17
+ Options::Sets::OUTPUT_OPTIONS + %w[
18
+ -force
19
+ ]
16
20
  end
17
21
 
18
22
  # @!visibility private
19
23
  def arguments(parameters)
20
- [parameters[:path], parameters[:data]].flatten
24
+ [parameters[:path], parameters[:data]].compact.flatten
21
25
  end
22
26
  end
23
27
  end
@@ -2,6 +2,7 @@
2
2
 
3
3
  require_relative 'commands/login'
4
4
  require_relative 'commands/write'
5
+ require_relative 'commands/list'
5
6
 
6
7
  module RubyVault
7
8
  module Commands
@@ -26,7 +26,8 @@ module RubyVault
26
26
  -unlock-key
27
27
  -wrap-ttl
28
28
  ].map do |o|
29
- definition(name: o, option_type: :standard, value_type: :string)
29
+ definition(name: o, option_type: :standard,
30
+ value_type: :string)
30
31
  end,
31
32
 
32
33
  # flag options
@@ -37,7 +38,18 @@ module RubyVault
37
38
  -policy-override
38
39
  -tls-skip-verify
39
40
  ].map do |o|
40
- definition(name: o, option_type: :flag, value_type: :boolean)
41
+ definition(name: o, option_type: :flag,
42
+ value_type: :boolean)
43
+ end
44
+ ].flatten.freeze
45
+
46
+ OUTPUT_DEFINITIONS = [
47
+ # string options
48
+ %w[
49
+ -field
50
+ -format
51
+ ].map do |o|
52
+ definition(name: o, option_type: :standard, value_type: :string)
41
53
  end
42
54
  ].flatten.freeze
43
55
 
@@ -45,11 +57,26 @@ module RubyVault
45
57
  # string options
46
58
  %w[
47
59
  -method
60
+ -path
48
61
  ].map do |o|
49
62
  definition(name: o, option_type: :standard, value_type: :string)
63
+ end,
64
+
65
+ # flag options
66
+ %w[
67
+ -force
68
+ -no-print
69
+ -no-store
70
+ -token-only
71
+ ].map do |o|
72
+ definition(name: o, option_type: :flag, value_type: :boolean)
50
73
  end
51
74
  ].flatten.freeze
52
75
 
53
- DEFINITIONS = (HTTP_DEFINITIONS + OTHER_DEFINITIONS).flatten.freeze
76
+ DEFINITIONS = (
77
+ HTTP_DEFINITIONS +
78
+ OUTPUT_DEFINITIONS +
79
+ OTHER_DEFINITIONS
80
+ ).flatten.freeze
54
81
  end
55
82
  end
@@ -22,6 +22,11 @@ module RubyVault
22
22
  -unlock-key
23
23
  -wrap-ttl
24
24
  ].freeze
25
+
26
+ OUTPUT_OPTIONS = %w[
27
+ -field
28
+ -format
29
+ ].freeze
25
30
  end
26
31
  end
27
32
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RubyVault
4
- VERSION = '0.1.0.pre.13'
4
+ VERSION = '0.1.0.pre.16'
5
5
  end
data/lib/ruby_vault.rb CHANGED
@@ -31,6 +31,11 @@ module RubyVault
31
31
  parameters, invocation_options)
32
32
  end
33
33
 
34
+ def list(parameters = {}, invocation_options = {})
35
+ exec(RubyVault::Commands::List,
36
+ parameters, invocation_options)
37
+ end
38
+
34
39
  private
35
40
 
36
41
  def exec(command_class, parameters, invocation_options)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_vault
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0.pre.13
4
+ version: 0.1.0.pre.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - InfraBlocks Maintainers
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-08-08 00:00:00.000000000 Z
11
+ date: 2022-08-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: immutable-struct
@@ -295,6 +295,7 @@ files:
295
295
  - lib/ruby_vault.rb
296
296
  - lib/ruby_vault/commands.rb
297
297
  - lib/ruby_vault/commands/base.rb
298
+ - lib/ruby_vault/commands/list.rb
298
299
  - lib/ruby_vault/commands/login.rb
299
300
  - lib/ruby_vault/commands/write.rb
300
301
  - lib/ruby_vault/errors.rb