ruborg 0.7.3 → 0.7.4

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: 314fb4f24b1b5544d95257f5d3f315099f221ecc92b7920e935066319db72458
4
- data.tar.gz: 0ef7e5183f7596e1417b4b12915557d9c177b0b2504f6a143c7ff8aa59f726aa
3
+ metadata.gz: 8b7697818fdf4537e02f840cb2f30c71cc3cbd6bbfc8cb8b72fe4bba7908deac
4
+ data.tar.gz: 2c509aec3d6586f7f3ea85aa84a621516e8ea73cd191ff325f8c33f056eb5a15
5
5
  SHA512:
6
- metadata.gz: fb9bcdb3517dc9fd2c1c05d868e8015fd5fe3a55c00e5c277cf7b0257f238535821f8dbcda594dc9bc4b413a8b96d4739d327e1b420f6bad08ac19e724193199
7
- data.tar.gz: 6544e4d87969bd59ca7912653ecaebedeca75795f934edb93ad9435a0e48cff5b0c95734aa5bdc70572a38cbed014ea8ac93cff4abee97867a910acba47d5240
6
+ metadata.gz: 711e51216fcc8e7522d32567f4a1759dccadb2d9691599b6408eb2f46187586dca3e837b45f7a7044a15117747b3a39ff5b083254ada2fd64f8e88f1c01e9f22
7
+ data.tar.gz: d7d2a732e8fbf38b33a2a5b39d35a820b98f22d3515656663c4e64fc8b589ca7ad5f49441e00f0b117118b04fe13c6ca036c28bcc6109b387a67275b5b8e7d1d
data/CHANGELOG.md CHANGED
@@ -7,6 +7,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.7.4] - 2025-10-09
11
+
12
+ ### Fixed
13
+ - **Passbolt Error Reporting**: Enhanced error handling for Passbolt CLI failures
14
+ - Now captures and logs stderr from Passbolt CLI commands
15
+ - Error messages include actual Passbolt CLI output for easier debugging
16
+ - Improved error logging with detailed failure context
17
+
18
+ ### Changed
19
+ - **Passbolt Environment Variables**: Passbolt env vars now explicitly passed to subprocess
20
+ - Preserves `PASSBOLT_SERVER_ADDRESS`, `PASSBOLT_USER_PRIVATE_KEY_FILE`, `PASSBOLT_USER_PASSWORD`
21
+ - Also preserves `PASSBOLT_GPG_HOME` and `PASSBOLT_CONFIG`
22
+ - Ensures Passbolt CLI has access to required configuration when run by Ruborg
23
+
10
24
  ## [0.7.3] - 2025-10-09
11
25
 
12
26
  ### Changed
@@ -17,11 +17,12 @@ module Ruborg
17
17
  @logger&.info("Retrieving password from Passbolt (resource_id: #{@resource_id})")
18
18
 
19
19
  cmd = ["passbolt", "get", "resource", "--id", @resource_id, "--json"]
20
- output, status = execute_command(cmd)
20
+ output, status, error_msg = execute_command(cmd)
21
21
 
22
22
  unless status
23
23
  @logger&.error("Failed to retrieve password from Passbolt for resource #{@resource_id}")
24
- raise PassboltError, "Failed to retrieve password from Passbolt"
24
+ error_detail = error_msg ? ": #{error_msg}" : ""
25
+ raise PassboltError, "Failed to retrieve password from Passbolt#{error_detail}"
25
26
  end
26
27
 
27
28
  @logger&.info("Successfully retrieved password from Passbolt")
@@ -38,8 +39,29 @@ module Ruborg
38
39
 
39
40
  def execute_command(cmd)
40
41
  require "open3"
41
- stdout, _, status = Open3.capture3(*cmd)
42
- [stdout, status.success?]
42
+
43
+ # Preserve Passbolt environment variables
44
+ env = {}
45
+ %w[
46
+ PASSBOLT_SERVER_ADDRESS
47
+ PASSBOLT_USER_PRIVATE_KEY_FILE
48
+ PASSBOLT_USER_PASSWORD
49
+ PASSBOLT_GPG_HOME
50
+ PASSBOLT_CONFIG
51
+ ].each do |var|
52
+ env[var] = ENV[var] if ENV[var]
53
+ end
54
+
55
+ stdout, stderr, status = Open3.capture3(env, *cmd)
56
+
57
+ # Log stderr if command failed
58
+ error_msg = nil
59
+ if !status.success? && !stderr.strip.empty?
60
+ error_msg = stderr.strip
61
+ @logger&.error("Passbolt CLI error: #{error_msg}")
62
+ end
63
+
64
+ [stdout, status.success?, error_msg]
43
65
  end
44
66
 
45
67
  def parse_password(json_output)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Ruborg
4
- VERSION = "0.7.3"
4
+ VERSION = "0.7.4"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruborg
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.3
4
+ version: 0.7.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michail Pantelelis