secvault 2.6.0 → 2.7.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/.rspec +1 -1
- data/README.md +45 -159
- data/lib/secvault/rails_secrets.rb +10 -16
- data/lib/secvault/railtie.rb +4 -5
- data/lib/secvault/secrets.rb +35 -61
- data/lib/secvault/version.rb +1 -1
- data/lib/secvault.rb +103 -93
- metadata +1 -8
- data/CHANGELOG.md +0 -185
- data/CODE_OF_CONDUCT.md +0 -132
- data/USAGE_EXAMPLES.md +0 -65
- data/lib/secvault/generators/secrets_generator.rb +0 -100
- data/lib/secvault/secrets_helper.rb +0 -44
- data/secvault-2.0.0.gem +0 -0
- data/sig/secvault.rbs +0 -4
data/lib/secvault.rb
CHANGED
|
@@ -12,34 +12,21 @@ loader = Zeitwerk::Loader.for_gem
|
|
|
12
12
|
loader.setup
|
|
13
13
|
|
|
14
14
|
# Secvault - Simple secrets management for Rails
|
|
15
|
-
#
|
|
16
|
-
# Secvault restores the classic Rails secrets.yml functionality
|
|
17
|
-
#
|
|
18
|
-
#
|
|
15
|
+
#
|
|
16
|
+
# Secvault restores the classic Rails secrets.yml functionality using simple,
|
|
17
|
+
# plain YAML files for environment-specific secrets management. Works consistently
|
|
18
|
+
# across all Rails versions with automatic deprecation warning suppression.
|
|
19
19
|
#
|
|
20
20
|
# ## Rails Version Support:
|
|
21
|
-
# - Rails 7.1
|
|
22
|
-
# - Rails 7.2+:
|
|
21
|
+
# - Rails 7.1+: Full compatibility with automatic setup
|
|
22
|
+
# - Rails 7.2+: Drop-in replacement for removed functionality
|
|
23
23
|
# - Rails 8.0+: Full compatibility
|
|
24
24
|
#
|
|
25
|
-
# ##
|
|
26
|
-
#
|
|
25
|
+
# ## Quick Start:
|
|
26
|
+
# Add this to an initializer:
|
|
27
27
|
#
|
|
28
28
|
# # config/initializers/secvault.rb
|
|
29
|
-
#
|
|
30
|
-
# remove_const(:Secrets) if defined?(Secrets)
|
|
31
|
-
# Secrets = Secvault::RailsSecrets
|
|
32
|
-
# end
|
|
33
|
-
#
|
|
34
|
-
# Rails.application.config.after_initialize do
|
|
35
|
-
# secrets_path = Rails.root.join("config/secrets.yml")
|
|
36
|
-
# if secrets_path.exist?
|
|
37
|
-
# loaded_secrets = Rails::Secrets.parse([secrets_path], env: Rails.env)
|
|
38
|
-
# secrets_object = ActiveSupport::OrderedOptions.new
|
|
39
|
-
# secrets_object.merge!(loaded_secrets)
|
|
40
|
-
# Rails.application.define_singleton_method(:secrets) { secrets_object }
|
|
41
|
-
# end
|
|
42
|
-
# end
|
|
29
|
+
# Secvault.setup!
|
|
43
30
|
#
|
|
44
31
|
# ## Usage:
|
|
45
32
|
# Rails.application.secrets.api_key
|
|
@@ -57,7 +44,7 @@ module Secvault
|
|
|
57
44
|
class Error < StandardError; end
|
|
58
45
|
|
|
59
46
|
extend self
|
|
60
|
-
|
|
47
|
+
|
|
61
48
|
# Internal storage for loaded secrets
|
|
62
49
|
@@loaded_secrets = nil
|
|
63
50
|
|
|
@@ -65,12 +52,12 @@ module Secvault
|
|
|
65
52
|
def secrets
|
|
66
53
|
@@loaded_secrets || ActiveSupport::OrderedOptions.new
|
|
67
54
|
end
|
|
68
|
-
|
|
55
|
+
|
|
69
56
|
# Check if Secvault is currently active (started)
|
|
70
57
|
def active?
|
|
71
58
|
@@loaded_secrets != nil
|
|
72
59
|
end
|
|
73
|
-
|
|
60
|
+
|
|
74
61
|
# Check if Secvault is integrated with Rails.application.secrets
|
|
75
62
|
def rails_integrated?
|
|
76
63
|
defined?(Rails) && Rails::Secrets == Secvault::RailsSecrets
|
|
@@ -82,59 +69,71 @@ module Secvault
|
|
|
82
69
|
require "secvault/railtie"
|
|
83
70
|
require "secvault/rails_secrets"
|
|
84
71
|
end
|
|
85
|
-
|
|
86
|
-
#
|
|
87
|
-
# This provides
|
|
88
|
-
#
|
|
72
|
+
|
|
73
|
+
# Set up Secvault for all Rails versions
|
|
74
|
+
# This provides a universal way to integrate Secvault into Rails apps
|
|
75
|
+
# with consistent behavior across all Rails versions.
|
|
89
76
|
#
|
|
90
77
|
# Usage in an initializer:
|
|
91
|
-
# Secvault.
|
|
78
|
+
# Secvault.setup!
|
|
79
|
+
# Secvault.setup!(suppress_warnings: false)
|
|
92
80
|
#
|
|
93
81
|
# This will:
|
|
94
|
-
# 1.
|
|
82
|
+
# 1. Set up Rails::Secrets with Secvault implementation
|
|
95
83
|
# 2. Replace Rails.application.secrets with Secvault-powered functionality
|
|
96
84
|
# 3. Load secrets from config/secrets.yml automatically
|
|
97
|
-
|
|
85
|
+
# 4. Suppress Rails deprecation warnings about secrets (default: true)
|
|
86
|
+
# 5. Set Rails.application.config.secret_key_base from secrets (default: true)
|
|
87
|
+
def setup!(suppress_warnings: true, set_secret_key_base: true)
|
|
98
88
|
# Override native Rails::Secrets
|
|
99
|
-
if defined?(Rails::Secrets)
|
|
100
|
-
Rails.send(:remove_const, :Secrets)
|
|
101
|
-
end
|
|
89
|
+
Rails.send(:remove_const, :Secrets) if defined?(Rails::Secrets)
|
|
102
90
|
Rails.const_set(:Secrets, Secvault::RailsSecrets)
|
|
103
|
-
|
|
91
|
+
|
|
104
92
|
# Set up Rails.application.secrets replacement
|
|
105
93
|
Rails.application.config.after_initialize do
|
|
94
|
+
# Suppress Rails deprecation warnings about secrets if requested
|
|
95
|
+
suppress_secrets_deprecation_warning! if suppress_warnings
|
|
96
|
+
|
|
106
97
|
secrets_path = Rails.root.join("config/secrets.yml")
|
|
107
|
-
|
|
98
|
+
|
|
108
99
|
if secrets_path.exist?
|
|
109
100
|
# Load secrets using Secvault
|
|
110
101
|
loaded_secrets = Rails::Secrets.parse([secrets_path], env: Rails.env)
|
|
111
|
-
|
|
102
|
+
|
|
112
103
|
# Create ActiveSupport::OrderedOptions object for compatibility
|
|
113
104
|
secrets_object = ActiveSupport::OrderedOptions.new
|
|
114
105
|
secrets_object.merge!(loaded_secrets)
|
|
115
|
-
|
|
106
|
+
|
|
116
107
|
# Replace Rails.application.secrets
|
|
117
108
|
Rails.application.define_singleton_method(:secrets) do
|
|
118
109
|
secrets_object
|
|
119
110
|
end
|
|
120
|
-
|
|
111
|
+
|
|
112
|
+
# Set secret_key_base in Rails config to avoid accessing it from secrets
|
|
113
|
+
if set_secret_key_base && loaded_secrets.key?("secret_key_base")
|
|
114
|
+
Rails.application.config.secret_key_base = loaded_secrets["secret_key_base"]
|
|
115
|
+
unless Rails.env.production?
|
|
116
|
+
Rails.logger&.info "[Secvault] Set Rails.application.config.secret_key_base from secrets.yml"
|
|
117
|
+
end
|
|
118
|
+
end
|
|
119
|
+
|
|
121
120
|
# Log integration success (except in production)
|
|
122
121
|
unless Rails.env.production?
|
|
123
|
-
Rails.logger&.info "[Secvault]
|
|
122
|
+
Rails.logger&.info "[Secvault] Integration complete. Loaded #{loaded_secrets.keys.size} secret keys."
|
|
124
123
|
end
|
|
125
124
|
else
|
|
126
125
|
Rails.logger&.warn "[Secvault] No secrets.yml file found at #{secrets_path}"
|
|
127
126
|
end
|
|
128
127
|
end
|
|
129
128
|
end
|
|
130
|
-
|
|
129
|
+
|
|
131
130
|
# Set up multi-file secrets loading with a clean API
|
|
132
131
|
# Just pass an array of file paths and Secvault handles the rest
|
|
133
132
|
#
|
|
134
133
|
# Usage in an initializer:
|
|
135
134
|
# Secvault.setup_multi_file!([
|
|
136
135
|
# 'config/secrets.yml',
|
|
137
|
-
# 'config/secrets.oauth.yml',
|
|
136
|
+
# 'config/secrets.oauth.yml',
|
|
138
137
|
# 'config/secrets.local.yml'
|
|
139
138
|
# ])
|
|
140
139
|
#
|
|
@@ -142,50 +141,54 @@ module Secvault
|
|
|
142
141
|
# - files: Array of file paths (String or Pathname)
|
|
143
142
|
# - reload_method: Add a reload helper method (default: true in development)
|
|
144
143
|
# - logger: Enable/disable logging (default: true except in production)
|
|
145
|
-
|
|
144
|
+
# - suppress_warnings: Suppress Rails deprecation warnings about secrets (default: true)
|
|
145
|
+
# - set_secret_key_base: Set Rails.application.config.secret_key_base from secrets (default: true)
|
|
146
|
+
def setup_multi_file!(files, reload_method: Rails.env.development?, logger: !Rails.env.production?,
|
|
147
|
+
suppress_warnings: true, set_secret_key_base: true)
|
|
146
148
|
# Ensure Secvault integration is active
|
|
147
|
-
|
|
148
|
-
|
|
149
|
+
setup!(suppress_warnings: suppress_warnings, set_secret_key_base: set_secret_key_base) unless active?
|
|
150
|
+
|
|
149
151
|
# Convert strings to Pathname objects and resolve relative to Rails.root
|
|
150
152
|
file_paths = Array(files).map do |file|
|
|
151
153
|
file.is_a?(Pathname) ? file : Rails.root.join(file)
|
|
152
154
|
end
|
|
153
|
-
|
|
155
|
+
|
|
154
156
|
# Set up the multi-file loading
|
|
155
157
|
Rails.application.config.after_initialize do
|
|
156
|
-
load_multi_file_secrets!(file_paths, logger: logger
|
|
158
|
+
load_multi_file_secrets!(file_paths, logger: logger, suppress_warnings: suppress_warnings,
|
|
159
|
+
set_secret_key_base: set_secret_key_base)
|
|
157
160
|
end
|
|
158
|
-
|
|
161
|
+
|
|
159
162
|
# Add reload helper in development
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
+
return unless reload_method
|
|
164
|
+
|
|
165
|
+
add_reload_helper!(file_paths)
|
|
163
166
|
end
|
|
164
|
-
|
|
167
|
+
|
|
165
168
|
# Load secrets into Secvault.secrets only (no Rails integration)
|
|
166
169
|
def load_secrets_only!(files, logger: !Rails.env.production?)
|
|
167
170
|
# Convert strings to Pathname objects and resolve relative to Rails.root
|
|
168
171
|
file_paths = Array(files).map do |file|
|
|
169
172
|
file.is_a?(Pathname) ? file : Rails.root.join(file)
|
|
170
173
|
end
|
|
171
|
-
|
|
174
|
+
|
|
172
175
|
existing_files = file_paths.select(&:exist?)
|
|
173
|
-
|
|
176
|
+
|
|
174
177
|
if existing_files.any?
|
|
175
178
|
# Load and merge all secrets files using Secvault's parser directly
|
|
176
179
|
merged_secrets = Secvault::Secrets.parse(existing_files, env: Rails.env)
|
|
177
|
-
|
|
180
|
+
|
|
178
181
|
# Store in Secvault.secrets (ActiveSupport::OrderedOptions for compatibility)
|
|
179
182
|
@@loaded_secrets = ActiveSupport::OrderedOptions.new
|
|
180
183
|
@@loaded_secrets.merge!(merged_secrets)
|
|
181
|
-
|
|
184
|
+
|
|
182
185
|
# Log successful loading
|
|
183
186
|
if logger
|
|
184
187
|
file_names = existing_files.map(&:basename)
|
|
185
|
-
Rails.logger&.info "[Secvault] Loaded #{existing_files.size} files: #{file_names.join(
|
|
188
|
+
Rails.logger&.info "[Secvault] Loaded #{existing_files.size} files: #{file_names.join(", ")}"
|
|
186
189
|
Rails.logger&.info "[Secvault] Parsed #{merged_secrets.keys.size} secret keys for #{Rails.env}"
|
|
187
190
|
end
|
|
188
|
-
|
|
191
|
+
|
|
189
192
|
true
|
|
190
193
|
else
|
|
191
194
|
Rails.logger&.warn "[Secvault] No secrets files found" if logger
|
|
@@ -193,36 +196,46 @@ module Secvault
|
|
|
193
196
|
false
|
|
194
197
|
end
|
|
195
198
|
end
|
|
196
|
-
|
|
199
|
+
|
|
197
200
|
# Load secrets from multiple files and merge them (with Rails integration)
|
|
198
|
-
def load_multi_file_secrets!(file_paths, logger: !Rails.env.production
|
|
201
|
+
def load_multi_file_secrets!(file_paths, logger: !Rails.env.production?, suppress_warnings: true,
|
|
202
|
+
set_secret_key_base: true)
|
|
199
203
|
existing_files = file_paths.select(&:exist?)
|
|
200
|
-
|
|
204
|
+
|
|
201
205
|
if existing_files.any?
|
|
206
|
+
# Suppress Rails deprecation warnings about secrets if requested
|
|
207
|
+
suppress_secrets_deprecation_warning! if suppress_warnings
|
|
208
|
+
|
|
202
209
|
# Load and merge all secrets files
|
|
203
210
|
merged_secrets = Rails::Secrets.parse(existing_files, env: Rails.env)
|
|
204
|
-
|
|
211
|
+
|
|
205
212
|
# Create ActiveSupport::OrderedOptions object for Rails compatibility
|
|
206
213
|
secrets_object = ActiveSupport::OrderedOptions.new
|
|
207
214
|
secrets_object.merge!(merged_secrets)
|
|
208
|
-
|
|
215
|
+
|
|
209
216
|
# Replace Rails.application.secrets
|
|
210
217
|
Rails.application.define_singleton_method(:secrets) { secrets_object }
|
|
211
|
-
|
|
218
|
+
|
|
219
|
+
# Set secret_key_base in Rails config to avoid accessing it from secrets
|
|
220
|
+
if set_secret_key_base && merged_secrets.key?("secret_key_base")
|
|
221
|
+
Rails.application.config.secret_key_base = merged_secrets["secret_key_base"]
|
|
222
|
+
Rails.logger&.info "[Secvault Multi-File] Set Rails.application.config.secret_key_base from secrets" if logger
|
|
223
|
+
end
|
|
224
|
+
|
|
212
225
|
# Log successful loading
|
|
213
226
|
if logger
|
|
214
227
|
file_names = existing_files.map(&:basename)
|
|
215
|
-
Rails.logger&.info "[Secvault Multi-File] Loaded #{existing_files.size} files: #{file_names.join(
|
|
228
|
+
Rails.logger&.info "[Secvault Multi-File] Loaded #{existing_files.size} files: #{file_names.join(", ")}"
|
|
216
229
|
Rails.logger&.info "[Secvault Multi-File] Merged #{merged_secrets.keys.size} secret keys for #{Rails.env}"
|
|
217
230
|
end
|
|
218
|
-
|
|
231
|
+
|
|
219
232
|
merged_secrets
|
|
220
233
|
else
|
|
221
234
|
Rails.logger&.warn "[Secvault Multi-File] No secrets files found" if logger
|
|
222
235
|
{}
|
|
223
236
|
end
|
|
224
237
|
end
|
|
225
|
-
|
|
238
|
+
|
|
226
239
|
# Add reload helper method for development
|
|
227
240
|
def add_reload_helper!(file_paths)
|
|
228
241
|
# Define reload method on Rails.application
|
|
@@ -231,15 +244,15 @@ module Secvault
|
|
|
231
244
|
puts "🔄 Reloaded secrets from #{file_paths.size} files"
|
|
232
245
|
true
|
|
233
246
|
end
|
|
234
|
-
|
|
247
|
+
|
|
235
248
|
# Also make it available as a top-level method
|
|
236
249
|
Object.define_method(:reload_secrets!) do
|
|
237
250
|
Rails.application.reload_secrets!
|
|
238
251
|
end
|
|
239
252
|
end
|
|
240
|
-
|
|
253
|
+
|
|
241
254
|
# Start Secvault and load secrets (without Rails integration)
|
|
242
|
-
#
|
|
255
|
+
#
|
|
243
256
|
# Usage:
|
|
244
257
|
# Secvault.start! # Uses config/secrets.yml only
|
|
245
258
|
# Secvault.start!(files: []) # Same as above
|
|
@@ -253,38 +266,34 @@ module Secvault
|
|
|
253
266
|
# - files: Array of file paths (String or Pathname). Defaults to ['config/secrets.yml']
|
|
254
267
|
# - logger: Enable logging (default: true except production)
|
|
255
268
|
def start!(files: [], logger: !Rails.env.production?)
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
false
|
|
267
|
-
end
|
|
269
|
+
# Default to host app's config/secrets.yml if no files specified
|
|
270
|
+
files_to_load = files.empty? ? ["config/secrets.yml"] : files
|
|
271
|
+
|
|
272
|
+
# Load secrets into Secvault.secrets (completely independent of Rails)
|
|
273
|
+
load_secrets_only!(files_to_load, logger: logger)
|
|
274
|
+
|
|
275
|
+
true
|
|
276
|
+
rescue => e
|
|
277
|
+
Rails.logger&.error "[Secvault] Failed to start: #{e.message}" if defined?(Rails)
|
|
278
|
+
false
|
|
268
279
|
end
|
|
269
|
-
|
|
280
|
+
|
|
270
281
|
# Integrate loaded secrets with Rails.application.secrets
|
|
271
282
|
def integrate_with_rails!
|
|
272
283
|
return false unless @@loaded_secrets
|
|
273
|
-
|
|
284
|
+
|
|
274
285
|
begin
|
|
275
286
|
# Set up Rails::Secrets to use Secvault's parser (only when integrating)
|
|
276
287
|
unless rails_integrated?
|
|
277
|
-
if defined?(Rails::Secrets)
|
|
278
|
-
Rails.send(:remove_const, :Secrets)
|
|
279
|
-
end
|
|
288
|
+
Rails.send(:remove_const, :Secrets) if defined?(Rails::Secrets)
|
|
280
289
|
Rails.const_set(:Secrets, Secvault::RailsSecrets)
|
|
281
290
|
end
|
|
282
|
-
|
|
291
|
+
|
|
283
292
|
# Replace Rails.application.secrets with Secvault's loaded secrets
|
|
284
293
|
Rails.application.define_singleton_method(:secrets) do
|
|
285
294
|
Secvault.secrets
|
|
286
295
|
end
|
|
287
|
-
|
|
296
|
+
|
|
288
297
|
Rails.logger&.info "[Secvault] Integrated with Rails.application.secrets" unless Rails.env.production?
|
|
289
298
|
true
|
|
290
299
|
rescue => e
|
|
@@ -292,10 +301,11 @@ module Secvault
|
|
|
292
301
|
false
|
|
293
302
|
end
|
|
294
303
|
end
|
|
295
|
-
|
|
304
|
+
|
|
296
305
|
# Backward compatibility aliases
|
|
297
|
-
alias_method :
|
|
298
|
-
alias_method :
|
|
306
|
+
alias_method :setup_backward_compatibility_with_older_rails!, :setup! # Legacy name
|
|
307
|
+
alias_method :setup_rails_71_integration!, :setup! # Legacy name
|
|
308
|
+
alias_method :setup_multi_files!, :setup_multi_file! # Alternative name
|
|
299
309
|
end
|
|
300
310
|
|
|
301
311
|
Secvault.install! if defined?(Rails)
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: secvault
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.
|
|
4
|
+
version: 2.7.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Unnikrishnan KP
|
|
@@ -49,21 +49,14 @@ extra_rdoc_files: []
|
|
|
49
49
|
files:
|
|
50
50
|
- ".rspec"
|
|
51
51
|
- ".standard.yml"
|
|
52
|
-
- CHANGELOG.md
|
|
53
|
-
- CODE_OF_CONDUCT.md
|
|
54
52
|
- LICENSE.txt
|
|
55
53
|
- README.md
|
|
56
54
|
- Rakefile
|
|
57
|
-
- USAGE_EXAMPLES.md
|
|
58
55
|
- lib/secvault.rb
|
|
59
|
-
- lib/secvault/generators/secrets_generator.rb
|
|
60
56
|
- lib/secvault/rails_secrets.rb
|
|
61
57
|
- lib/secvault/railtie.rb
|
|
62
58
|
- lib/secvault/secrets.rb
|
|
63
|
-
- lib/secvault/secrets_helper.rb
|
|
64
59
|
- lib/secvault/version.rb
|
|
65
|
-
- secvault-2.0.0.gem
|
|
66
|
-
- sig/secvault.rbs
|
|
67
60
|
homepage: https://github.com/unnitallman/secvault
|
|
68
61
|
licenses:
|
|
69
62
|
- MIT
|
data/CHANGELOG.md
DELETED
|
@@ -1,185 +0,0 @@
|
|
|
1
|
-
## [Unreleased]
|
|
2
|
-
|
|
3
|
-
## [2.3.0] - 2025-09-22
|
|
4
|
-
|
|
5
|
-
### Changed
|
|
6
|
-
|
|
7
|
-
- **Better method naming**: Renamed `setup_rails_71_integration!` to `setup_backward_compatibility_with_older_rails!`
|
|
8
|
-
- **More generic approach**: New method name works for any older Rails version, not just 7.1
|
|
9
|
-
- **Updated documentation**: README now uses "Older Rails Integration" instead of "Rails 7.1 Integration"
|
|
10
|
-
- **Clearer version support**: Documentation now shows "Rails 7.1 and older" for better clarity
|
|
11
|
-
|
|
12
|
-
### Backward Compatibility
|
|
13
|
-
|
|
14
|
-
- ✅ **Old method name still works**: `setup_rails_71_integration!` is aliased to the new method
|
|
15
|
-
- ✅ **No breaking changes**: All existing code continues to work
|
|
16
|
-
- ✅ **Updated test apps**: Rails 7.1 test app uses the new, cleaner method name
|
|
17
|
-
|
|
18
|
-
### Benefits
|
|
19
|
-
|
|
20
|
-
- **Future-proof naming**: Works for Rails 7.1, 7.0, 6.x, or any version with native secrets
|
|
21
|
-
- **Clearer intent**: Method name clearly indicates it's for backward compatibility
|
|
22
|
-
- **Better documentation**: More generic approach in README and code comments
|
|
23
|
-
- **Maintained compatibility**: Existing users don't need to change anything
|
|
24
|
-
|
|
25
|
-
## [2.2.0] - 2025-09-22
|
|
26
|
-
|
|
27
|
-
### Added
|
|
28
|
-
|
|
29
|
-
- **New simplified API**: `Rails::Secrets.load()` - cleaner method to load default config/secrets.yml
|
|
30
|
-
- **Enhanced README** with comprehensive examples for multiple files usage
|
|
31
|
-
- **Better documentation** showing how to parse custom files and multiple file merging
|
|
32
|
-
- **Backward compatibility aliases** - `parse_default` and `read` still work
|
|
33
|
-
|
|
34
|
-
### Changed
|
|
35
|
-
|
|
36
|
-
- **Improved method naming**: `Rails::Secrets.load()` is now the preferred method over `parse_default()`
|
|
37
|
-
- **Enhanced documentation** in code with clear examples for single file, multiple files, and custom paths
|
|
38
|
-
- **Better README examples** showing advanced usage patterns
|
|
39
|
-
|
|
40
|
-
### Examples Added
|
|
41
|
-
|
|
42
|
-
- Multiple secrets files merging: `Rails::Secrets.parse(['secrets.yml', 'secrets.local.yml'], env: Rails.env)`
|
|
43
|
-
- Environment-specific loading: `Rails::Secrets.load(env: 'production')`
|
|
44
|
-
- Custom file parsing: `Rails::Secrets.parse(['config/custom.yml'], env: Rails.env)`
|
|
45
|
-
- Multiple path support: `Rails::Secrets.parse([Rails.root.join('config', 'secrets.yml')], env: Rails.env)`
|
|
46
|
-
|
|
47
|
-
### Backward Compatibility
|
|
48
|
-
|
|
49
|
-
- ✅ All existing methods still work
|
|
50
|
-
- ✅ `parse_default` → `load` (alias maintained)
|
|
51
|
-
- ✅ `read` → `load` (alias maintained)
|
|
52
|
-
- ✅ No breaking changes
|
|
53
|
-
|
|
54
|
-
## [2.1.0] - 2025-09-22
|
|
55
|
-
|
|
56
|
-
### Removed
|
|
57
|
-
|
|
58
|
-
- **Removed all rake tasks** - Ultimate simplicity! No more `rake secvault:setup`, `rake secvault:edit`, or `rake secvault:show`
|
|
59
|
-
- Removed `lib/secvault/tasks.rake` file entirely
|
|
60
|
-
- Removed rake task loading from railtie
|
|
61
|
-
|
|
62
|
-
### Changed
|
|
63
|
-
|
|
64
|
-
- **Ultra-simple setup**: Just create `config/secrets.yml` with any text editor
|
|
65
|
-
- Updated README to reflect manual file creation instead of rake tasks
|
|
66
|
-
- Updated module documentation to show simple 3-step process
|
|
67
|
-
- Cleaner railtie without task loading complexity
|
|
68
|
-
|
|
69
|
-
### Benefits
|
|
70
|
-
|
|
71
|
-
- **Zero dependencies on rake tasks** - works with just plain YAML files
|
|
72
|
-
- **Even simpler** - no commands to remember, just edit YAML files
|
|
73
|
-
- **More intuitive** - developers already know how to create and edit YAML files
|
|
74
|
-
- **Less code** - removed unnecessary complexity
|
|
75
|
-
|
|
76
|
-
### Tested
|
|
77
|
-
|
|
78
|
-
- ✅ Rails 7.1 integration works perfectly
|
|
79
|
-
- ✅ Rails 8.0 automatic setup works perfectly
|
|
80
|
-
- ✅ No rake task conflicts or errors
|
|
81
|
-
|
|
82
|
-
## [2.0.0] - 2025-09-22
|
|
83
|
-
|
|
84
|
-
### BREAKING CHANGES
|
|
85
|
-
|
|
86
|
-
- **Removed all encryption functionality** - Secvault now focuses purely on plain YAML secrets management
|
|
87
|
-
- Removed ActiveSupport::EncryptedFile dependencies
|
|
88
|
-
- Removed MissingKeyError and InvalidKeyError exceptions
|
|
89
|
-
- Removed `encrypted?`, `decrypt`, `decrypt_secrets` methods
|
|
90
|
-
- Simplified rake tasks to work with plain YAML only
|
|
91
|
-
|
|
92
|
-
### Added
|
|
93
|
-
|
|
94
|
-
- Simplified `rake secvault:setup` that creates plain YAML files with helpful comments
|
|
95
|
-
- Better error messages and user guidance in rake tasks
|
|
96
|
-
- Cleaner, more focused codebase without encryption complexity
|
|
97
|
-
|
|
98
|
-
### Changed
|
|
99
|
-
|
|
100
|
-
- **Major simplification**: All secrets are now stored in plain YAML files
|
|
101
|
-
- Updated README to reflect plain YAML approach
|
|
102
|
-
- Updated module documentation and gemspec descriptions
|
|
103
|
-
- Rake tasks now use emojis and better user experience
|
|
104
|
-
- Production secrets should use ERB syntax with environment variables
|
|
105
|
-
|
|
106
|
-
### Benefits
|
|
107
|
-
|
|
108
|
-
- Much simpler gem with single focus: plain YAML secrets management
|
|
109
|
-
- No encryption keys to manage or lose
|
|
110
|
-
- Easy to understand, edit, and debug secrets files
|
|
111
|
-
- Perfect for development and test environments
|
|
112
|
-
- Production secrets via environment variables (recommended best practice)
|
|
113
|
-
|
|
114
|
-
## [1.0.4] - 2025-09-22
|
|
115
|
-
|
|
116
|
-
### Added
|
|
117
|
-
|
|
118
|
-
- Comprehensive Rails 7.1 integration support
|
|
119
|
-
- New `Secvault.setup_rails_71_integration!` helper method for easy Rails 7.1 setup
|
|
120
|
-
- Enhanced documentation with Rails 7.1 integration guide
|
|
121
|
-
- Module-level documentation with usage examples and version compatibility
|
|
122
|
-
|
|
123
|
-
### Improved
|
|
124
|
-
|
|
125
|
-
- Better Rails 7.1 compatibility with automatic detection and setup
|
|
126
|
-
- Enhanced README with Rails 7.1 integration section
|
|
127
|
-
- Improved error handling and logging for Rails 7.1 integration
|
|
128
|
-
- More comprehensive inline documentation
|
|
129
|
-
|
|
130
|
-
### Changed
|
|
131
|
-
|
|
132
|
-
- Refined automatic setup logic to avoid conflicts with Rails 7.1 native functionality
|
|
133
|
-
- Updated gemspec description to include Rails 7.1+ support
|
|
134
|
-
|
|
135
|
-
## [1.0.3] - 2025-09-22
|
|
136
|
-
|
|
137
|
-
### Fixed
|
|
138
|
-
|
|
139
|
-
- Rails 7.1 compatibility issues with native Rails::Secrets conflicts
|
|
140
|
-
- String path handling in parse method
|
|
141
|
-
- Zeitwerk constant name mismatch resolution
|
|
142
|
-
|
|
143
|
-
### Added
|
|
144
|
-
|
|
145
|
-
- Manual setup method for Rails 7.1 (opt-in)
|
|
146
|
-
- Rails version detection for automatic setup decisions
|
|
147
|
-
- Only create Rails::Secrets alias for Rails 7.2+ to avoid conflicts
|
|
148
|
-
|
|
149
|
-
## [1.0.2] - 2025-09-22
|
|
150
|
-
|
|
151
|
-
### Changed
|
|
152
|
-
|
|
153
|
-
- Updated Rails dependency from >= 7.2.0 to >= 7.1.0 for broader compatibility
|
|
154
|
-
- Updated gem description to include Rails 7.1+ support
|
|
155
|
-
|
|
156
|
-
## [1.0.1] - 2025-09-22
|
|
157
|
-
|
|
158
|
-
### Fixed
|
|
159
|
-
|
|
160
|
-
- Zeitwerk constant name mismatch in rails_secrets.rb
|
|
161
|
-
- Changed module definition from Rails::Secrets to Secvault::RailsSecrets
|
|
162
|
-
- Added Rails::Secrets alias for backward compatibility
|
|
163
|
-
- Resolved Zeitwerk::NameError when loading Rails applications
|
|
164
|
-
|
|
165
|
-
## [1.0.0] - 2025-09-22
|
|
166
|
-
|
|
167
|
-
### Added
|
|
168
|
-
|
|
169
|
-
- Initial release of Secvault gem
|
|
170
|
-
- Rails secrets.yml functionality for Rails 7.2+
|
|
171
|
-
- Encrypted secrets.yml support using Rails' built-in encryption
|
|
172
|
-
- Environment-specific secrets management
|
|
173
|
-
- ERB template support in secrets files
|
|
174
|
-
- Rake tasks for secrets management:
|
|
175
|
-
- `rake secvault:setup` - Create encrypted secrets file
|
|
176
|
-
- `rake secvault:edit` - Edit encrypted secrets
|
|
177
|
-
- `rake secvault:show` - Display decrypted secrets
|
|
178
|
-
- Rails generator for creating secrets files
|
|
179
|
-
- Automatic integration with Rails.application.secrets
|
|
180
|
-
- Support for both encrypted and plain YAML secrets files
|
|
181
|
-
- Key management with config/secrets.yml.key
|
|
182
|
-
- Environment variable fallback for encryption key
|
|
183
|
-
- Comprehensive error handling for missing/invalid keys
|
|
184
|
-
- Full test coverage with RSpec
|
|
185
|
-
- Detailed documentation and usage examples
|