secvault 2.0.0 → 2.1.0
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 +28 -0
- data/README.md +4 -11
- data/lib/secvault/railtie.rb +2 -10
- data/lib/secvault/version.rb +1 -1
- data/lib/secvault.rb +4 -4
- data/secvault-2.0.0.gem +0 -0
- metadata +2 -2
- data/lib/secvault/tasks.rake +0 -75
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2c2c9db7124c8ac60bf772bcb42c1367f9e5a25a72c977aecc717da47ec401e8
|
|
4
|
+
data.tar.gz: a8a46d584bf49e2ec7ca1bbfc9609c64b25642406a55efaf79f7f8e5eeeccbba
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 52ffd8869e91255f41bbf5bcba424efa8ccfd2a7ec3227c97a8430cd2a21ecbf816558a966ad68afeff611889085b91af765012a9c1529c27917b56cab9aceab
|
|
7
|
+
data.tar.gz: 191341590209b60085ad54047813788e3bd809ad84791c7aacca546bbc9870a653ae6c6811bce083b8e187aae9d14f9d3bdb5b6c533b549dda356e917816828d
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
## [Unreleased]
|
|
2
2
|
|
|
3
|
+
## [2.1.0] - 2025-09-22
|
|
4
|
+
|
|
5
|
+
### Removed
|
|
6
|
+
|
|
7
|
+
- **Removed all rake tasks** - Ultimate simplicity! No more `rake secvault:setup`, `rake secvault:edit`, or `rake secvault:show`
|
|
8
|
+
- Removed `lib/secvault/tasks.rake` file entirely
|
|
9
|
+
- Removed rake task loading from railtie
|
|
10
|
+
|
|
11
|
+
### Changed
|
|
12
|
+
|
|
13
|
+
- **Ultra-simple setup**: Just create `config/secrets.yml` with any text editor
|
|
14
|
+
- Updated README to reflect manual file creation instead of rake tasks
|
|
15
|
+
- Updated module documentation to show simple 3-step process
|
|
16
|
+
- Cleaner railtie without task loading complexity
|
|
17
|
+
|
|
18
|
+
### Benefits
|
|
19
|
+
|
|
20
|
+
- **Zero dependencies on rake tasks** - works with just plain YAML files
|
|
21
|
+
- **Even simpler** - no commands to remember, just edit YAML files
|
|
22
|
+
- **More intuitive** - developers already know how to create and edit YAML files
|
|
23
|
+
- **Less code** - removed unnecessary complexity
|
|
24
|
+
|
|
25
|
+
### Tested
|
|
26
|
+
|
|
27
|
+
- ✅ Rails 7.1 integration works perfectly
|
|
28
|
+
- ✅ Rails 8.0 automatic setup works perfectly
|
|
29
|
+
- ✅ No rake task conflicts or errors
|
|
30
|
+
|
|
3
31
|
## [2.0.0] - 2025-09-22
|
|
4
32
|
|
|
5
33
|
### BREAKING CHANGES
|
data/README.md
CHANGED
|
@@ -21,11 +21,11 @@ bundle install
|
|
|
21
21
|
## Quick Start (Rails 7.2+)
|
|
22
22
|
|
|
23
23
|
```bash
|
|
24
|
-
# 1. Create secrets.yml
|
|
25
|
-
|
|
24
|
+
# 1. Create secrets.yml
|
|
25
|
+
touch config/secrets.yml
|
|
26
26
|
|
|
27
|
-
# 2. Edit
|
|
28
|
-
|
|
27
|
+
# 2. Edit with your favorite editor
|
|
28
|
+
$EDITOR config/secrets.yml
|
|
29
29
|
```
|
|
30
30
|
|
|
31
31
|
**Usage in your app:**
|
|
@@ -68,13 +68,6 @@ Rails.application.secrets.oauth_settings # ✅ Works
|
|
|
68
68
|
Rails::Secrets.parse_default # ✅ Enhanced functionality
|
|
69
69
|
```
|
|
70
70
|
|
|
71
|
-
## Available Commands
|
|
72
|
-
|
|
73
|
-
```bash
|
|
74
|
-
rake secvault:setup # Create plain secrets.yml file
|
|
75
|
-
rake secvault:edit # Edit secrets.yml file
|
|
76
|
-
rake secvault:show # Display secrets.yml content
|
|
77
|
-
```
|
|
78
71
|
|
|
79
72
|
## Security
|
|
80
73
|
|
data/lib/secvault/railtie.rb
CHANGED
|
@@ -13,18 +13,17 @@ module Secvault
|
|
|
13
13
|
# Ensure initialization happens early in all environments
|
|
14
14
|
config.before_configuration do |app|
|
|
15
15
|
secrets_path = app.root.join("config/secrets.yml")
|
|
16
|
-
key_path = app.root.join("config/secrets.yml.key")
|
|
17
16
|
|
|
18
17
|
if secrets_path.exist? && !Rails.application.respond_to?(:secrets)
|
|
19
18
|
# Early initialization for test environment compatibility
|
|
20
19
|
current_env = ENV['RAILS_ENV'] || 'development'
|
|
21
|
-
secrets = Secvault::Secrets.read_secrets(secrets_path,
|
|
20
|
+
secrets = Secvault::Secrets.read_secrets(secrets_path, current_env)
|
|
22
21
|
|
|
23
22
|
if secrets
|
|
24
23
|
Rails.application.define_singleton_method(:secrets) do
|
|
25
24
|
@secrets ||= begin
|
|
26
25
|
current_secrets = ActiveSupport::OrderedOptions.new
|
|
27
|
-
env_secrets = Secvault::Secrets.read_secrets(secrets_path,
|
|
26
|
+
env_secrets = Secvault::Secrets.read_secrets(secrets_path, Rails.env)
|
|
28
27
|
current_secrets.merge!(env_secrets) if env_secrets
|
|
29
28
|
current_secrets
|
|
30
29
|
end
|
|
@@ -33,12 +32,5 @@ module Secvault
|
|
|
33
32
|
end
|
|
34
33
|
end
|
|
35
34
|
|
|
36
|
-
generators do
|
|
37
|
-
require "secvault/generators/secrets_generator"
|
|
38
|
-
end
|
|
39
|
-
|
|
40
|
-
rake_tasks do
|
|
41
|
-
load "secvault/tasks.rake"
|
|
42
|
-
end
|
|
43
35
|
end
|
|
44
36
|
end
|
data/lib/secvault/version.rb
CHANGED
data/lib/secvault.rb
CHANGED
|
@@ -46,10 +46,10 @@ loader.setup
|
|
|
46
46
|
# Rails.application.secrets.oauth_settings[:google_client_id]
|
|
47
47
|
# Rails::Secrets.parse_default(env: 'development')
|
|
48
48
|
#
|
|
49
|
-
# ##
|
|
50
|
-
#
|
|
51
|
-
#
|
|
52
|
-
#
|
|
49
|
+
# ## Getting Started:
|
|
50
|
+
# 1. Create config/secrets.yml with your secrets
|
|
51
|
+
# 2. Use Rails.application.secrets.your_secret in your app
|
|
52
|
+
# 3. For production, use environment variables with ERB syntax
|
|
53
53
|
#
|
|
54
54
|
# @see https://github.com/unnitallman/secvault
|
|
55
55
|
module Secvault
|
data/secvault-2.0.0.gem
ADDED
|
Binary file
|
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.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Unnikrishnan KP
|
|
@@ -60,8 +60,8 @@ files:
|
|
|
60
60
|
- lib/secvault/railtie.rb
|
|
61
61
|
- lib/secvault/secrets.rb
|
|
62
62
|
- lib/secvault/secrets_helper.rb
|
|
63
|
-
- lib/secvault/tasks.rake
|
|
64
63
|
- lib/secvault/version.rb
|
|
64
|
+
- secvault-2.0.0.gem
|
|
65
65
|
- sig/secvault.rbs
|
|
66
66
|
homepage: https://github.com/unnitallman/secvault
|
|
67
67
|
licenses:
|
data/lib/secvault/tasks.rake
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require "securerandom"
|
|
4
|
-
|
|
5
|
-
namespace :secvault do
|
|
6
|
-
desc "Create a plain YAML secrets.yml file"
|
|
7
|
-
task setup: :environment do
|
|
8
|
-
secrets_path = Rails.root.join("config/secrets.yml")
|
|
9
|
-
|
|
10
|
-
if secrets_path.exist?
|
|
11
|
-
puts "Secrets file already exists at #{secrets_path}"
|
|
12
|
-
else
|
|
13
|
-
default_content = <<~YAML
|
|
14
|
-
# Plain YAML secrets file
|
|
15
|
-
# Environment-specific secrets for your Rails application
|
|
16
|
-
#
|
|
17
|
-
# For production, use environment variables with ERB syntax:
|
|
18
|
-
# production:
|
|
19
|
-
# api_key: <%= ENV['API_KEY'] %>
|
|
20
|
-
|
|
21
|
-
development:
|
|
22
|
-
secret_key_base: #{SecureRandom.hex(64)}
|
|
23
|
-
# Add your development secrets here
|
|
24
|
-
# api_key: dev_key
|
|
25
|
-
# database_password: dev_password
|
|
26
|
-
|
|
27
|
-
test:
|
|
28
|
-
secret_key_base: #{SecureRandom.hex(64)}
|
|
29
|
-
# Add your test secrets here
|
|
30
|
-
# api_key: test_key
|
|
31
|
-
|
|
32
|
-
production:
|
|
33
|
-
secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
|
|
34
|
-
# Use environment variables for production secrets
|
|
35
|
-
# api_key: <%= ENV["API_KEY"] %>
|
|
36
|
-
# database_password: <%= ENV["DATABASE_PASSWORD"] %>
|
|
37
|
-
YAML
|
|
38
|
-
|
|
39
|
-
File.write(secrets_path, default_content)
|
|
40
|
-
puts "✅ Created plain secrets.yml file at #{secrets_path}"
|
|
41
|
-
puts "⚠️ Remember to add production secrets as environment variables"
|
|
42
|
-
puts "⚠️ Never commit production secrets to version control"
|
|
43
|
-
end
|
|
44
|
-
end
|
|
45
|
-
|
|
46
|
-
desc "Edit the plain YAML secrets.yml file"
|
|
47
|
-
task edit: :environment do
|
|
48
|
-
secrets_path = Rails.root.join("config/secrets.yml")
|
|
49
|
-
|
|
50
|
-
unless secrets_path.exist?
|
|
51
|
-
puts "Secrets file doesn't exist. Run 'rake secvault:setup' first."
|
|
52
|
-
exit 1
|
|
53
|
-
end
|
|
54
|
-
|
|
55
|
-
# Open the plain YAML file in editor
|
|
56
|
-
editor = ENV["EDITOR"] || "vi"
|
|
57
|
-
system("#{editor} #{secrets_path}")
|
|
58
|
-
puts "📝 Updated #{secrets_path}"
|
|
59
|
-
end
|
|
60
|
-
|
|
61
|
-
desc "Show the plain YAML secrets.yml content"
|
|
62
|
-
task show: :environment do
|
|
63
|
-
secrets_path = Rails.root.join("config/secrets.yml")
|
|
64
|
-
|
|
65
|
-
unless secrets_path.exist?
|
|
66
|
-
puts "Secrets file doesn't exist. Run 'rake secvault:setup' first."
|
|
67
|
-
exit 1
|
|
68
|
-
end
|
|
69
|
-
|
|
70
|
-
puts "📄 Contents of #{secrets_path}:"
|
|
71
|
-
puts "#{'=' * 50}"
|
|
72
|
-
puts File.read(secrets_path)
|
|
73
|
-
puts "#{'=' * 50}"
|
|
74
|
-
end
|
|
75
|
-
end
|