hephaestus 0.7.5 → 0.7.5.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: 3cd0baba4158ddab44fe1aff04d5e606b419a5882f05764efedeb5c9ec5a5916
4
- data.tar.gz: d5fcc05a6f058e03a73659b5cd4f41890d70cb470164af73ea5ae803e1b92a32
3
+ metadata.gz: 86f3a565b2f72b7554045e961efb160be49c89ede06c633e18cf4464b2a1b098
4
+ data.tar.gz: f970244378be6c08670923ac548fb20654aa618f51dedcf99d159e9b7599995c
5
5
  SHA512:
6
- metadata.gz: 154445c0b91ff0c7d32bf0c0997d9440d8ef634c49dfa8d8009ec4124d5377974e4f0f092daa4eb3ee2c47eaac151290a7a62b281e8a4b0099cfa14a00c46272
7
- data.tar.gz: 2894735072d816b7848920b934e69b3f9d56067a533ccb5360c9ab4e6d94f6f9782ca4ba307128284ba972314fcbe538e95bfa95341e287cf19bae7fcc9bedc4
6
+ metadata.gz: 3a7a3e78ec00d955c0b4fd160593ccf29ed4972d63302476f51b34104464a188f048e5eb0be15c511f95a6f72f8abfe997f94a5fa582695eeaafbcf488855c86
7
+ data.tar.gz: 907bf42577991b390b195e50dfab101aa7738d5f24421652e5e618a969c10cec3a57f6936a605933fb946183252388db7eccd0723fce927479fe65ad623e49a9
data/CHANGELOG.md CHANGED
@@ -1,3 +1,5 @@
1
+ # [v0.7.5.1] - 20-11-2024
2
+ **Full Changelog**: https://github.com/yettoapp/hephaestus/compare/v0.7.5...v0.7.5.1
1
3
  # [v0.7.5] - 20-11-2024
2
4
  ## What's Changed
3
5
  * No do by @gjtorikian in https://github.com/yettoapp/hephaestus/pull/49
@@ -26,14 +26,27 @@ def fetch_document_secret(document_secrets, label:, default:)
26
26
  end
27
27
 
28
28
  def op_read(label)
29
- %x(#{include_sudo?}op read "#{label}").chomp
29
+ %x(#{include_sudo?}op read "#{label}").chomp.tap do
30
+ raise "Failed to fetch `#{label}` from 1Password" unless $CHILD_STATUS.success?
31
+ end
30
32
  end
31
33
 
32
34
  # technically, this gets every secret, including ones UNIQUE
33
35
  # to the platform, but we're not using those yet. feels "better"
34
36
  # to have the plugs manage those on their own
35
37
  def op_get_secrets(vault:, tag:)
36
- %x(#{include_sudo?}op item list --vault #{vault} --tags #{tag} --format json | op item get - --reveal --format=json)
38
+ %x(#{include_sudo?}op item list --vault #{vault} --tags #{tag} --format json | op item get - --reveal --format=json).tap do
39
+ raise "Failed to fetch value `#{vault}` for `#{tag}` from 1Password" unless $CHILD_STATUS.success?
40
+ end
41
+ end
42
+
43
+ def check_dependencies!
44
+ raise "1Password CLI is not installed" unless cli_installed?
45
+ end
46
+
47
+ def cli_installed?
48
+ %x(#{include_sudo?}op --version 2> /dev/null)
49
+ $CHILD_STATUS.success?
37
50
  end
38
51
 
39
52
  def include_sudo?
@@ -97,6 +110,7 @@ module Hephaestus
97
110
  # Every plug has these secrets; to reduce the amount of API calls to 1Password,
98
111
  # we can grab one document that contains all the secrets we need
99
112
  if productionish?
113
+ check_dependencies!
100
114
  fetched_secrets = op_get_secrets(vault: "Plug-#{plug_name}", tag: ENV["RAILS_ENV"])
101
115
  end
102
116
 
@@ -2,7 +2,7 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module Hephaestus
5
- VERSION = "0.7.5"
5
+ VERSION = "0.7.5.1"
6
6
  RAILS_VERSION = ">= 8.0"
7
7
  RUBY_VERSION = File
8
8
  .read("#{File.dirname(__FILE__)}/../../.ruby-version")
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hephaestus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.5
4
+ version: 0.7.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Garen Torikian