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.
data/CODE_OF_CONDUCT.md DELETED
@@ -1,132 +0,0 @@
1
- # Contributor Covenant Code of Conduct
2
-
3
- ## Our Pledge
4
-
5
- We as members, contributors, and leaders pledge to make participation in our
6
- community a harassment-free experience for everyone, regardless of age, body
7
- size, visible or invisible disability, ethnicity, sex characteristics, gender
8
- identity and expression, level of experience, education, socio-economic status,
9
- nationality, personal appearance, race, caste, color, religion, or sexual
10
- identity and orientation.
11
-
12
- We pledge to act and interact in ways that contribute to an open, welcoming,
13
- diverse, inclusive, and healthy community.
14
-
15
- ## Our Standards
16
-
17
- Examples of behavior that contributes to a positive environment for our
18
- community include:
19
-
20
- * Demonstrating empathy and kindness toward other people
21
- * Being respectful of differing opinions, viewpoints, and experiences
22
- * Giving and gracefully accepting constructive feedback
23
- * Accepting responsibility and apologizing to those affected by our mistakes,
24
- and learning from the experience
25
- * Focusing on what is best not just for us as individuals, but for the overall
26
- community
27
-
28
- Examples of unacceptable behavior include:
29
-
30
- * The use of sexualized language or imagery, and sexual attention or advances of
31
- any kind
32
- * Trolling, insulting or derogatory comments, and personal or political attacks
33
- * Public or private harassment
34
- * Publishing others' private information, such as a physical or email address,
35
- without their explicit permission
36
- * Other conduct which could reasonably be considered inappropriate in a
37
- professional setting
38
-
39
- ## Enforcement Responsibilities
40
-
41
- Community leaders are responsible for clarifying and enforcing our standards of
42
- acceptable behavior and will take appropriate and fair corrective action in
43
- response to any behavior that they deem inappropriate, threatening, offensive,
44
- or harmful.
45
-
46
- Community leaders have the right and responsibility to remove, edit, or reject
47
- comments, commits, code, wiki edits, issues, and other contributions that are
48
- not aligned to this Code of Conduct, and will communicate reasons for moderation
49
- decisions when appropriate.
50
-
51
- ## Scope
52
-
53
- This Code of Conduct applies within all community spaces, and also applies when
54
- an individual is officially representing the community in public spaces.
55
- Examples of representing our community include using an official email address,
56
- posting via an official social media account, or acting as an appointed
57
- representative at an online or offline event.
58
-
59
- ## Enforcement
60
-
61
- Instances of abusive, harassing, or otherwise unacceptable behavior may be
62
- reported to the community leaders responsible for enforcement at
63
- [INSERT CONTACT METHOD].
64
- All complaints will be reviewed and investigated promptly and fairly.
65
-
66
- All community leaders are obligated to respect the privacy and security of the
67
- reporter of any incident.
68
-
69
- ## Enforcement Guidelines
70
-
71
- Community leaders will follow these Community Impact Guidelines in determining
72
- the consequences for any action they deem in violation of this Code of Conduct:
73
-
74
- ### 1. Correction
75
-
76
- **Community Impact**: Use of inappropriate language or other behavior deemed
77
- unprofessional or unwelcome in the community.
78
-
79
- **Consequence**: A private, written warning from community leaders, providing
80
- clarity around the nature of the violation and an explanation of why the
81
- behavior was inappropriate. A public apology may be requested.
82
-
83
- ### 2. Warning
84
-
85
- **Community Impact**: A violation through a single incident or series of
86
- actions.
87
-
88
- **Consequence**: A warning with consequences for continued behavior. No
89
- interaction with the people involved, including unsolicited interaction with
90
- those enforcing the Code of Conduct, for a specified period of time. This
91
- includes avoiding interactions in community spaces as well as external channels
92
- like social media. Violating these terms may lead to a temporary or permanent
93
- ban.
94
-
95
- ### 3. Temporary Ban
96
-
97
- **Community Impact**: A serious violation of community standards, including
98
- sustained inappropriate behavior.
99
-
100
- **Consequence**: A temporary ban from any sort of interaction or public
101
- communication with the community for a specified period of time. No public or
102
- private interaction with the people involved, including unsolicited interaction
103
- with those enforcing the Code of Conduct, is allowed during this period.
104
- Violating these terms may lead to a permanent ban.
105
-
106
- ### 4. Permanent Ban
107
-
108
- **Community Impact**: Demonstrating a pattern of violation of community
109
- standards, including sustained inappropriate behavior, harassment of an
110
- individual, or aggression toward or disparagement of classes of individuals.
111
-
112
- **Consequence**: A permanent ban from any sort of public interaction within the
113
- community.
114
-
115
- ## Attribution
116
-
117
- This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118
- version 2.1, available at
119
- [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
120
-
121
- Community Impact Guidelines were inspired by
122
- [Mozilla's code of conduct enforcement ladder][Mozilla CoC].
123
-
124
- For answers to common questions about this code of conduct, see the FAQ at
125
- [https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
126
- [https://www.contributor-covenant.org/translations][translations].
127
-
128
- [homepage]: https://www.contributor-covenant.org
129
- [v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
130
- [Mozilla CoC]: https://github.com/mozilla/diversity
131
- [FAQ]: https://www.contributor-covenant.org/faq
132
- [translations]: https://www.contributor-covenant.org/translations
data/USAGE_EXAMPLES.md DELETED
@@ -1,65 +0,0 @@
1
- # Secvault API
2
-
3
- Secvault provides separate control over secrets loading and Rails integration.
4
-
5
- ## Core Methods
6
-
7
- ### `Secvault.start!(files: [])`
8
-
9
- Loads secrets from YAML files. Returns `true`/`false`.
10
-
11
- - **Default**: Uses `config/secrets.yml` if `files` is empty
12
- - **Access**: Secrets available via `Secvault.secrets`
13
- - **Non-invasive**: Does not modify `Rails.application.secrets`
14
-
15
- ### `Secvault.integrate_with_rails!`
16
-
17
- Replaces `Rails.application.secrets` with Secvault's loaded secrets. Returns `true`/`false`.
18
-
19
- ### `Secvault.secrets`
20
-
21
- Access to loaded secrets as `ActiveSupport::OrderedOptions`.
22
-
23
- ### Status Methods
24
-
25
- - `Secvault.active?` - Returns `true` if secrets have been loaded
26
- - `Secvault.rails_integrated?` - Returns `true` if Rails integration is active
27
-
28
- ## Usage
29
-
30
- ### Standalone
31
-
32
- ```ruby
33
- # Load secrets independently
34
- Secvault.start!
35
- api_key = Secvault.secrets.api_key
36
- ```
37
-
38
- ### With Rails Integration
39
-
40
- ```ruby
41
- # Load and integrate with Rails
42
- Secvault.start!
43
- Secvault.integrate_with_rails!
44
- api_key = Rails.application.secrets.api_key
45
- ```
46
-
47
- ### Multiple Files
48
-
49
- ```ruby
50
- # Files are deep-merged in order
51
- Secvault.start!(files: [
52
- 'config/shared_secrets.yml',
53
- 'config/secrets.yml'
54
- ])
55
- ```
56
-
57
- ### Error Handling
58
-
59
- ```ruby
60
- if Secvault.start!(files: ['config/secrets.yml'])
61
- if Secvault.integrate_with_rails!
62
- # Both operations successful
63
- end
64
- end
65
- ```
@@ -1,100 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "rails/generators/base"
4
- require "active_support/encrypted_file"
5
- require "securerandom"
6
-
7
- module Secvault
8
- module Generators
9
- class SecretsGenerator < Rails::Generators::Base
10
- source_root File.expand_path("templates", __dir__)
11
-
12
- desc "Creates a secrets.yml file for secrets management"
13
-
14
- class_option :force, type: :boolean, default: false, desc: "Overwrite existing secrets.yml"
15
- class_option :encrypted, type: :boolean, default: false, desc: "Create encrypted secrets.yml (default: plain YAML)"
16
-
17
- def create_secrets_file
18
- secrets_path = Rails.root.join("config/secrets.yml")
19
- key_path = Rails.root.join("config/secrets.yml.key")
20
-
21
- if secrets_path.exist? && !options[:force]
22
- say "Secrets file already exists at config/secrets.yml", :yellow
23
- return
24
- end
25
-
26
- default_content = generate_default_secrets
27
-
28
- if options[:encrypted]
29
- # Create encrypted secrets file
30
- unless key_path.exist?
31
- key = ActiveSupport::EncryptedFile.generate_key
32
- File.write(key_path, key)
33
- say "Generated encryption key in config/secrets.yml.key", :green
34
- end
35
-
36
- encrypted_file = ActiveSupport::EncryptedFile.new(
37
- content_path: secrets_path,
38
- key_path: key_path,
39
- env_key: "RAILS_SECRETS_KEY",
40
- raise_if_missing_key: true
41
- )
42
-
43
- encrypted_file.write(default_content)
44
- say "Created encrypted secrets.yml file", :green
45
- say "Add config/secrets.yml.key to your .gitignore file", :yellow
46
- else
47
- # Create plain YAML secrets file
48
- File.write(secrets_path, default_content)
49
- say "Created plain secrets.yml file", :green
50
- say "Remember to add config/secrets.yml to your .gitignore if it contains sensitive data", :yellow
51
- end
52
- end
53
-
54
- def add_to_gitignore
55
- gitignore_path = Rails.root.join(".gitignore")
56
- key_entry = "/config/secrets.yml.key"
57
-
58
- if gitignore_path.exist?
59
- gitignore_content = File.read(gitignore_path)
60
- unless gitignore_content.include?(key_entry)
61
- File.open(gitignore_path, "a") do |f|
62
- f.puts "\n# Ignore encrypted secrets key"
63
- f.puts key_entry
64
- end
65
- say "Added secrets key to .gitignore", :green
66
- end
67
- end
68
- end
69
-
70
- private
71
-
72
- def generate_default_secrets
73
- <<~YAML
74
- # Be sure to restart your server when you modify this file.
75
-
76
- # Your secret key is used for verifying the integrity of signed cookies.
77
- # If you change this key, all old signed cookies will become invalid!
78
-
79
- # Make sure the secret is at least 30 characters and all random,
80
- # no regular words or you'll be exposed to dictionary attacks.
81
- # You can use `rails secret` to generate a secure secret key.
82
-
83
- # Make sure the secrets in this file are kept private
84
- # if you're sharing your code publicly.
85
-
86
- development:
87
- secret_key_base: #{SecureRandom.hex(64)}
88
-
89
- test:
90
- secret_key_base: #{SecureRandom.hex(64)}
91
-
92
- # Do not keep production secrets in the repository,
93
- # instead read values from the environment.
94
- production:
95
- secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
96
- YAML
97
- end
98
- end
99
- end
100
- end
@@ -1,44 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Secvault
4
- class SecretsHelper
5
- def initialize(app)
6
- @app = app
7
- @secrets_path = app.root.join("config/secrets.yml")
8
- @key_path = app.root.join("config/secrets.yml.key")
9
- end
10
-
11
- def secrets
12
- @secrets ||= load_secrets
13
- end
14
-
15
- def [](key)
16
- secrets[key.to_sym]
17
- end
18
-
19
- def fetch(key, default = nil)
20
- secrets.fetch(key.to_sym, default)
21
- end
22
-
23
- def key?(key)
24
- secrets.key?(key.to_sym)
25
- end
26
-
27
- def empty?
28
- secrets.empty?
29
- end
30
-
31
- def to_h
32
- secrets.dup
33
- end
34
-
35
- private
36
-
37
- def load_secrets
38
- return {} unless @secrets_path.exist?
39
-
40
- env_secrets = Secvault::Secrets.read_secrets(@secrets_path, @key_path, Rails.env)
41
- env_secrets || {}
42
- end
43
- end
44
- end
data/secvault-2.0.0.gem DELETED
Binary file
data/sig/secvault.rbs DELETED
@@ -1,4 +0,0 @@
1
- module Secvault
2
- VERSION: String
3
- # See the writing guide of rbs: https://github.com/ruby/rbs#guides
4
- end