kreds 1.1.5 → 1.1.6
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 +4 -0
- data/README.md +9 -15
- data/kreds.gemspec +1 -1
- data/lib/kreds/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 854050f1d4157bcfb7cd033c15d751ddfa22ee702f77bd768752e96048f6ae26
|
|
4
|
+
data.tar.gz: 7e549366af77fc5d2621bbbcccc87c66e927d458892ffc71fdd8950f25b9b92b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 0d1ced3f9f5f4d2817a4ebb654e90ef0aa5c48dea648156d0e72843134a2ab2fb032e4fd85ba90a7f8a2987584c3eb9ce1710b0f97c7b16c2989c297300f0bb5
|
|
7
|
+
data.tar.gz: 84f636b9899db018c4f5af342a40ef18cbf3c77e705f0d7d7ad8635f8ac8c96c2c2bdb7073435581d5e253457c5aea8ec327054db37113e21694052e148faa86
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
|
@@ -5,35 +5,29 @@
|
|
|
5
5
|
[](https://github.com/enjaku4/kreds/actions/workflows/ci.yml)
|
|
6
6
|
[](LICENSE)
|
|
7
7
|
|
|
8
|
-
Kreds is a simpler, shorter, and safer way to access Rails credentials, with a few extra features built in.
|
|
8
|
+
Rails credentials are a convenient way to store secrets, but retrieving them could be more intuitive - that's where Kreds comes in. Kreds is a simpler, shorter, and safer way to access Rails credentials, with a few extra features built in. It provides environment variable fallback support and blank value detection with clear human-readable error messages.
|
|
9
9
|
|
|
10
|
-
**
|
|
10
|
+
**Example of Usage:**
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
- Environment variable fallback support
|
|
14
|
-
- Environment-scoped credentials access
|
|
15
|
-
- Blank value detection and prevention
|
|
16
|
-
|
|
17
|
-
**Before and After:**
|
|
12
|
+
Say you want to fetch `[:recaptcha][:site_key]` from your Rails credentials but forgot to set a value or made a typo in the key name:
|
|
18
13
|
|
|
19
14
|
```ruby
|
|
20
|
-
#
|
|
15
|
+
# Rails credentials (silent failure, unclear errors):
|
|
21
16
|
Rails.application.credentials[:recaptcha][:site_key]
|
|
22
17
|
# => nil
|
|
23
18
|
|
|
24
|
-
# Or this (long, unclear errors):
|
|
25
19
|
Rails.application.credentials[:captcha][:site_key]
|
|
26
20
|
# => undefined method `[]' for nil:NilClass (NoMethodError)
|
|
27
21
|
|
|
28
|
-
# Or even this (longer, still unclear errors):
|
|
29
22
|
Rails.application.credentials.fetch(:recaptcha).fetch(:key)
|
|
30
23
|
# => key not found: :key (KeyError)
|
|
31
24
|
|
|
32
|
-
#
|
|
25
|
+
# Kreds (clear, human-readable errors):
|
|
33
26
|
Kreds.fetch!(:recaptcha, :site_key)
|
|
34
27
|
# => Blank value in credentials: [:recaptcha][:site_key] (Kreds::BlankCredentialsError)
|
|
35
|
-
|
|
36
|
-
|
|
28
|
+
|
|
29
|
+
Kreds.fetch!(:recaptcha, :key)
|
|
30
|
+
# => Credentials key not found: [:recaptcha][:key] (Kreds::UnknownCredentialsError)
|
|
37
31
|
```
|
|
38
32
|
|
|
39
33
|
## Table of Contents
|
|
@@ -58,7 +52,7 @@ Add Kreds to your Gemfile:
|
|
|
58
52
|
gem "kreds"
|
|
59
53
|
```
|
|
60
54
|
|
|
61
|
-
|
|
55
|
+
Install the gem:
|
|
62
56
|
|
|
63
57
|
```bash
|
|
64
58
|
bundle install
|
data/kreds.gemspec
CHANGED
data/lib/kreds/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: kreds
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.1.
|
|
4
|
+
version: 1.1.6
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- enjaku4
|
|
@@ -32,7 +32,7 @@ dependencies:
|
|
|
32
32
|
version: '7.1'
|
|
33
33
|
- - "<"
|
|
34
34
|
- !ruby/object:Gem::Version
|
|
35
|
-
version: '8.
|
|
35
|
+
version: '8.2'
|
|
36
36
|
type: :runtime
|
|
37
37
|
prerelease: false
|
|
38
38
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -42,7 +42,7 @@ dependencies:
|
|
|
42
42
|
version: '7.1'
|
|
43
43
|
- - "<"
|
|
44
44
|
- !ruby/object:Gem::Version
|
|
45
|
-
version: '8.
|
|
45
|
+
version: '8.2'
|
|
46
46
|
description: Kreds provides a simpler, shorter, and safer way to access Rails credentials
|
|
47
47
|
with clear error messages, environment variable fallback support, and blank value
|
|
48
48
|
detection
|