localvault 1.3.0 → 1.3.1

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: 2fb8eb382004083b9fcd03144139013da7eda568be14370e08a66a1adb7bd332
4
- data.tar.gz: 5e03b4a0b7a7c5ff7e560dd79ef2ada9a4413f8414b275a54478044c90bd267c
3
+ metadata.gz: 0b105245bc108c66fb889a043714a464b0d6c17c31b3546842c1b2e887c83898
4
+ data.tar.gz: c2d881d51515e62c29879bbc6dbee27c14bb7e19bb003c399ea5edd801931add
5
5
  SHA512:
6
- metadata.gz: d241d6f3fa8ddcd176c78bdc8b8d58d66d511f9527d139c3896fdfd84b92462c7f72f705851f05ec8c9be26a14419613093bfda1265cde860f861f6bbfddebcd
7
- data.tar.gz: fc9ec7322791d8eedcdfbb252c11cdd995dc67008d7de6fd7c34b208a9fd0bb913e2a13550e0336104f36f0f3eeaf410d56b2035e699a1a495cd75c67acb310a
6
+ metadata.gz: da9d072b2bfd8633f687838590636a9982056d086bf8e95e0d085c8974e24e7b6edb8fca2ddca79612bfa3eabbd9fa3edeaadc5f86f96d9b31364cb36410f1bb
7
+ data.tar.gz: 66cc50037f18fd47f84d4e6f387904d066eddb0914ba438894c16c5974dd937fa67a729be59bee6df2bd002876c71c17e0a3a8bc7c96d09dfb05dab2f59fbf1f
@@ -6,13 +6,16 @@ module LocalVault
6
6
  class Team < Thor
7
7
  include LocalVault::CLI::TeamHelpers
8
8
 
9
- desc "init", "Initialize a vault as a team vault (sets you as owner)"
9
+ desc "init [VAULT]", "Initialize a vault as a team vault (sets you as owner)"
10
10
  method_option :vault, type: :string, aliases: "-v"
11
11
  # Initialize a vault as a team vault with you as the owner.
12
12
  #
13
13
  # This is the explicit transition from personal sync to team-shared sync.
14
14
  # Creates the owner's key slot and bumps the bundle to v3.
15
- def init
15
+ #
16
+ # Accepts the vault name as either a positional argument
17
+ # (`team init intellectaco`) or via --vault/-v.
18
+ def init(vault_name = nil)
16
19
  unless Config.token
17
20
  $stderr.puts "Error: Not logged in."
18
21
  $stderr.puts "\n localvault login YOUR_TOKEN\n"
@@ -25,12 +28,12 @@ module LocalVault
25
28
  return
26
29
  end
27
30
 
28
- vault_name = options[:vault] || Config.default_vault
31
+ vault_name ||= options[:vault] || Config.default_vault
29
32
  handle = Config.inventlist_handle
30
33
 
31
34
  master_key = SessionCache.get(vault_name)
32
35
  unless master_key
33
- $stderr.puts "Error: Vault '#{vault_name}' is not unlocked. Run: localvault show -v #{vault_name}"
36
+ $stderr.puts "Error: Vault '#{vault_name}' is not unlocked. Run: localvault unlock -v #{vault_name}"
34
37
  return
35
38
  end
36
39
 
@@ -131,19 +134,22 @@ module LocalVault
131
134
  $stderr.puts "Error: #{e.message}"
132
135
  end
133
136
 
134
- desc "rotate", "Re-encrypt a team vault with a new master key (no member changes)"
137
+ desc "rotate [VAULT]", "Re-encrypt a team vault with a new master key (no member changes)"
135
138
  method_option :vault, type: :string, aliases: "-v"
136
139
  # Re-key a team vault without adding or removing members.
137
140
  #
138
141
  # Prompts for a new passphrase, re-encrypts all secrets, and rebuilds
139
142
  # all key slots. Useful for periodic key rotation.
140
- def rotate
143
+ #
144
+ # Accepts the vault name as either a positional argument
145
+ # (`team rotate intellectaco`) or via --vault/-v.
146
+ def rotate(vault_name = nil)
141
147
  unless Config.token
142
148
  $stderr.puts "Error: Not logged in."
143
149
  return
144
150
  end
145
151
 
146
- vault_name = options[:vault] || Config.default_vault
152
+ vault_name ||= options[:vault] || Config.default_vault
147
153
  client = ApiClient.new(token: Config.token)
148
154
 
149
155
  team_data = load_team_data(client, vault_name)
@@ -1,3 +1,3 @@
1
1
  module LocalVault
2
- VERSION = "1.3.0"
2
+ VERSION = "1.3.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: localvault
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nauman Tariq