legion-crypt 1.4.14 → 1.4.15
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/CHANGELOG.md +6 -0
- data/CLAUDE.md +1 -1
- data/lib/legion/crypt/vault.rb +23 -5
- data/lib/legion/crypt/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: 5f43eee9680197c62f53f2a7ed8c77eee725f7f01744c32e5ad0115fdfb2ad21
|
|
4
|
+
data.tar.gz: 3ba3cd7da0684d8a9ec68d23797d487240035dc2f5e07fdba7ab0cfb1727dafe
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 79fe4cd8653f9a09c3c2f6acc7da403e00d8a8e05b6fb6f488fb25a3c8fadfcbee00cc1ffa7e31319840025a5d622d2b1b6a32210ff0cd9141a04aef26c27e59
|
|
7
|
+
data.tar.gz: b691e62e093b3504d7e7da0501cda48aca9ae705429ed1d5caf97dd3ab7a9b7f87826a8d0cf4dabbff01e1f755d7cee555d74dee85754f7206feb5cadbfdd8f8
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Legion::Crypt
|
|
2
2
|
|
|
3
|
+
## [1.4.15] - 2026-03-26
|
|
4
|
+
|
|
5
|
+
### Fixed
|
|
6
|
+
- Route `get`, `write`, `read`, `delete`, `exist?` through default cluster client when multi-cluster Vault is configured (#1)
|
|
7
|
+
- Previously these methods used the global `::Vault` singleton which was never initialized when clusters were present, causing 403 errors against the wrong Vault server
|
|
8
|
+
|
|
3
9
|
## [1.4.14] - 2026-03-26
|
|
4
10
|
|
|
5
11
|
### Fixed
|
data/CLAUDE.md
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
Handles encryption, decryption, secrets management, JWT token management, and HashiCorp Vault connectivity for the LegionIO framework. Provides AES-256-CBC message encryption, RSA key pair generation, cluster secret management, JWT issue/verify operations, and Vault token lifecycle management.
|
|
9
9
|
|
|
10
10
|
**GitHub**: https://github.com/LegionIO/legion-crypt
|
|
11
|
-
**Version**: 1.4.
|
|
11
|
+
**Version**: 1.4.15
|
|
12
12
|
**License**: Apache-2.0
|
|
13
13
|
|
|
14
14
|
## Architecture
|
data/lib/legion/crypt/vault.rb
CHANGED
|
@@ -45,7 +45,7 @@ module Legion
|
|
|
45
45
|
def read(path, type = 'legion')
|
|
46
46
|
full_path = type.nil? || type.empty? ? "#{type}/#{path}" : path
|
|
47
47
|
Legion::Logging.debug "Vault read: #{full_path}" if defined?(Legion::Logging)
|
|
48
|
-
lease =
|
|
48
|
+
lease = logical_client.read(full_path)
|
|
49
49
|
add_session(path: lease.lease_id) if lease.respond_to? :lease_id
|
|
50
50
|
lease.data
|
|
51
51
|
rescue StandardError => e
|
|
@@ -55,7 +55,7 @@ module Legion
|
|
|
55
55
|
|
|
56
56
|
def get(path)
|
|
57
57
|
Legion::Logging.debug "Vault kv get: #{path}" if defined?(Legion::Logging)
|
|
58
|
-
result =
|
|
58
|
+
result = kv_client.read(path)
|
|
59
59
|
return nil if result.nil?
|
|
60
60
|
|
|
61
61
|
result.data
|
|
@@ -66,14 +66,14 @@ module Legion
|
|
|
66
66
|
|
|
67
67
|
def write(path, **hash)
|
|
68
68
|
Legion::Logging.debug "Vault kv write: #{path}" if defined?(Legion::Logging)
|
|
69
|
-
|
|
69
|
+
kv_client.write(path, **hash)
|
|
70
70
|
rescue StandardError => e
|
|
71
71
|
Legion::Logging.warn "Vault kv write failed at #{path}: #{e.message}" if defined?(Legion::Logging)
|
|
72
72
|
raise
|
|
73
73
|
end
|
|
74
74
|
|
|
75
75
|
def delete(path)
|
|
76
|
-
|
|
76
|
+
logical_client.delete(path)
|
|
77
77
|
{ success: true, path: path }
|
|
78
78
|
rescue StandardError => e
|
|
79
79
|
Legion::Logging.warn "Vault delete failed for #{path}: #{e.message}" if defined?(Legion::Logging)
|
|
@@ -81,7 +81,7 @@ module Legion
|
|
|
81
81
|
end
|
|
82
82
|
|
|
83
83
|
def exist?(path)
|
|
84
|
-
|
|
84
|
+
!kv_client.read_metadata(path).nil?
|
|
85
85
|
end
|
|
86
86
|
|
|
87
87
|
def add_session(path:)
|
|
@@ -140,6 +140,24 @@ module Legion
|
|
|
140
140
|
def vault_exists?(name)
|
|
141
141
|
::Vault.sys.mounts.key?(name.to_sym)
|
|
142
142
|
end
|
|
143
|
+
|
|
144
|
+
private
|
|
145
|
+
|
|
146
|
+
def kv_client
|
|
147
|
+
if respond_to?(:connected_clusters) && connected_clusters.any?
|
|
148
|
+
vault_client.kv(settings[:vault][:kv_path])
|
|
149
|
+
else
|
|
150
|
+
::Vault.kv(settings[:vault][:kv_path])
|
|
151
|
+
end
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
def logical_client
|
|
155
|
+
if respond_to?(:connected_clusters) && connected_clusters.any?
|
|
156
|
+
vault_client.logical
|
|
157
|
+
else
|
|
158
|
+
::Vault.logical
|
|
159
|
+
end
|
|
160
|
+
end
|
|
143
161
|
end
|
|
144
162
|
end
|
|
145
163
|
end
|
data/lib/legion/crypt/version.rb
CHANGED