samson_secret_puller 1.1.1 → 1.2.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 +5 -5
- data/lib/samson_secret_puller.rb +13 -7
- metadata +4 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 76feecbfbae99ef70859b49cc85426258cd579e18e5c3bad23446aec61a50c01
|
4
|
+
data.tar.gz: 9421a32d60bf36d898b873dc5c90c900ca1f4dbbb19cbafd158aaa9e086d19ef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a8ccd3bcdaea0a8072dbba23f8b1d6a214b3453bf22ad7c765a38e412027796b4e3ba8c949ac4303f1108c5dce6a3033c3c59375692f5d5c7cf88a1371e9cb98
|
7
|
+
data.tar.gz: 0fc213134b9531452fc725394ebb3b1f6688dd3696b0abdae731041a3f307611f41a24d1edf13706749a5ff1c83ba0971b8f9d8938b7f4c9d5eefa0692b50714
|
data/lib/samson_secret_puller.rb
CHANGED
@@ -1,7 +1,9 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'forwardable'
|
2
4
|
|
3
5
|
module SamsonSecretPuller
|
4
|
-
FOLDER = '/secrets'
|
6
|
+
FOLDER = '/secrets'
|
5
7
|
|
6
8
|
ENV = ENV # store a copy since we might replace ENV on Object
|
7
9
|
|
@@ -9,7 +11,7 @@ module SamsonSecretPuller
|
|
9
11
|
extend Forwardable
|
10
12
|
[
|
11
13
|
:[], :fetch, :keys, :each, :has_key?, :key?, :include?,
|
12
|
-
:each_with_object, :values_at, :reject, :select, :to_a
|
14
|
+
:each_with_object, :values_at, :reject, :select, :to_a, :update
|
13
15
|
].each do |method|
|
14
16
|
def_delegator :secrets, method
|
15
17
|
end
|
@@ -41,7 +43,7 @@ module SamsonSecretPuller
|
|
41
43
|
|
42
44
|
# When we run in kubernetes we need to read secrets from ENV and secret storage
|
43
45
|
# but other parts of the apps or gems do not need to know about this
|
44
|
-
def replace_ENV! # rubocop:disable
|
46
|
+
def replace_ENV! # rubocop:disable Naming/MethodName
|
45
47
|
old = $VERBOSE
|
46
48
|
$VERBOSE = nil
|
47
49
|
Object.const_set(:ENV, self)
|
@@ -63,10 +65,14 @@ module SamsonSecretPuller
|
|
63
65
|
|
64
66
|
def read_secrets
|
65
67
|
return {} unless File.exist?(FOLDER)
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
68
|
+
scan_folder.each_with_object({}) do |file, all|
|
69
|
+
all[File.basename(file)] = File.read(file).strip
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
def scan_folder
|
74
|
+
Dir.glob("#{FOLDER}/*").reject do |path|
|
75
|
+
File.directory?(path)
|
70
76
|
end
|
71
77
|
end
|
72
78
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: samson_secret_puller
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Grosser
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-05-07 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email: michael@grosser.it
|
@@ -30,15 +30,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: '2.7'
|
34
34
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
35
35
|
requirements:
|
36
36
|
- - ">="
|
37
37
|
- !ruby/object:Gem::Version
|
38
38
|
version: '0'
|
39
39
|
requirements: []
|
40
|
-
|
41
|
-
rubygems_version: 2.4.5.1
|
40
|
+
rubygems_version: 3.4.10
|
42
41
|
signing_key:
|
43
42
|
specification_version: 4
|
44
43
|
summary: Gem to read secrets generated by samson secret puller
|