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 +4 -4
- data/lib/localvault/cli/team.rb +13 -7
- data/lib/localvault/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 0b105245bc108c66fb889a043714a464b0d6c17c31b3546842c1b2e887c83898
|
|
4
|
+
data.tar.gz: c2d881d51515e62c29879bbc6dbee27c14bb7e19bb003c399ea5edd801931add
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: da9d072b2bfd8633f687838590636a9982056d086bf8e95e0d085c8974e24e7b6edb8fca2ddca79612bfa3eabbd9fa3edeaadc5f86f96d9b31364cb36410f1bb
|
|
7
|
+
data.tar.gz: 66cc50037f18fd47f84d4e6f387904d066eddb0914ba438894c16c5974dd937fa67a729be59bee6df2bd002876c71c17e0a3a8bc7c96d09dfb05dab2f59fbf1f
|
data/lib/localvault/cli/team.rb
CHANGED
|
@@ -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
|
-
|
|
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
|
|
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
|
|
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
|
-
|
|
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
|
|
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)
|
data/lib/localvault/version.rb
CHANGED