kubekrypt 2.1.0 → 2.1.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/CHANGELOG.md +7 -0
- data/Gemfile.lock +1 -1
- data/lib/kubekrypt/cli.rb +20 -2
- data/lib/kubekrypt/version.rb +1 -1
- data/lib/kubekrypt.rb +2 -2
- 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: e71a844906b188fbb2f4adca4d2ccae9cf45380a9be2bb6b16c1890bc1c37b68
|
|
4
|
+
data.tar.gz: a42f8a26b5f1991f5141b0b988c3412f1680d7045de982f46aa66bc65a83f3eb
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 967a4d2b36bfd9ff119d9fa5dafc6e8419a000bee7a34fcbb32d30d91fc3efa7fd52529673147f7196527a7db79b0f46bc3489491033058f635efb97bff756d1
|
|
7
|
+
data.tar.gz: d414ff61b5e4971d22bdd7906c2b8cabbb56011f37c8072cd34833c22beacb851277173a70db57ff5e84770a4be57471ae3aa6245de8edf0ce8cf8f4bd8c9156
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [2.1.1] - 2026-03-24
|
|
4
|
+
|
|
5
|
+
### Fixed
|
|
6
|
+
- Typos in error class names (`AlreadyEncryptedError`, `NotEncryptedError`)
|
|
7
|
+
- CLI now prints clean error messages instead of backtraces on failure
|
|
8
|
+
- Use `METADATA_KEY` constant consistently in CLI
|
|
9
|
+
|
|
3
10
|
## [2.1.0] - 2026-03-24
|
|
4
11
|
|
|
5
12
|
### Changed
|
data/Gemfile.lock
CHANGED
data/lib/kubekrypt/cli.rb
CHANGED
|
@@ -18,10 +18,19 @@ module KubeKrypt
|
|
|
18
18
|
content = YAML.safe_load(yaml_content)
|
|
19
19
|
key_name = options.fetch(KMS_KEY)
|
|
20
20
|
|
|
21
|
-
raise
|
|
21
|
+
raise AlreadyEncryptedError, "#{file_path} is already encrypted" if content[METADATA_KEY]
|
|
22
22
|
|
|
23
23
|
result = KubeKrypt::Encryptor.call(content:, key_name:)
|
|
24
24
|
puts result
|
|
25
|
+
rescue AlreadyEncryptedError, NotEncryptedError => e
|
|
26
|
+
warn "Error: #{e.message}"
|
|
27
|
+
exit 1
|
|
28
|
+
rescue Errno::ENOENT
|
|
29
|
+
warn "Error: file not found: #{file_path}"
|
|
30
|
+
exit 1
|
|
31
|
+
rescue => e
|
|
32
|
+
warn "Error: #{e.message}"
|
|
33
|
+
exit 1
|
|
25
34
|
end
|
|
26
35
|
|
|
27
36
|
method_option :base64, desc: "Base64 encoded values", type: :boolean, required: false
|
|
@@ -31,10 +40,19 @@ module KubeKrypt
|
|
|
31
40
|
content = YAML.safe_load(yaml_content)
|
|
32
41
|
base64 = options.fetch(:base64, false)
|
|
33
42
|
|
|
34
|
-
raise
|
|
43
|
+
raise NotEncryptedError, "#{file_path} is not encrypted" unless content[METADATA_KEY]
|
|
35
44
|
|
|
36
45
|
result = KubeKrypt::Decryptor.call(content:, base64:)
|
|
37
46
|
puts result
|
|
47
|
+
rescue AlreadyEncryptedError, NotEncryptedError => e
|
|
48
|
+
warn "Error: #{e.message}"
|
|
49
|
+
exit 1
|
|
50
|
+
rescue Errno::ENOENT
|
|
51
|
+
warn "Error: file not found: #{file_path}"
|
|
52
|
+
exit 1
|
|
53
|
+
rescue => e
|
|
54
|
+
warn "Error: #{e.message}"
|
|
55
|
+
exit 1
|
|
38
56
|
end
|
|
39
57
|
end
|
|
40
58
|
end
|
data/lib/kubekrypt/version.rb
CHANGED
data/lib/kubekrypt.rb
CHANGED
|
@@ -5,8 +5,8 @@ require "thor"
|
|
|
5
5
|
require "yaml"
|
|
6
6
|
|
|
7
7
|
module KubeKrypt
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
AlreadyEncryptedError = Class.new(StandardError)
|
|
9
|
+
NotEncryptedError = Class.new(StandardError)
|
|
10
10
|
KMS_KEY = :kms_key
|
|
11
11
|
ENCRYPTION_METHOD = "aes-256-gcm".freeze
|
|
12
12
|
METADATA_KEY = "kubekrypt".freeze
|