dotenv-secretsmanager 0.2.0 → 0.3.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/README.md +11 -3
- data/lib/dotenv/secretsmanager/version.rb +1 -1
- data/lib/dotenv/secretsmanager.rb +8 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1179b709da58d9aaf2a856a5a1231036f53151846e30a7767cb04944d1ecbbc4
|
|
4
|
+
data.tar.gz: 439b0ebd08d2a4056ff1cb7d4fdb017fb92f0a9b82f30ae0315452e6b4e52bef
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8e45f5ef7022f70044e3608839c9a518b6269f530206f9e8d2e13f6d7f0a4adf579448733c7bee5120250019fd869aa08ab9a133c7bed24652fb5dd89fb48ddc
|
|
7
|
+
data.tar.gz: 15f96a1c520ccc704909758ef8c38845000d33b17f246d0f9bb840cd33dc1b2b819bc564bcd436f290ceba18e72914b7bc54c07b8c315066591d16ba6c3d09b3
|
data/README.md
CHANGED
|
@@ -63,9 +63,17 @@ makes zero AWS calls and builds no client when no references are present.
|
|
|
63
63
|
|
|
64
64
|
## Skipping resolution
|
|
65
65
|
|
|
66
|
-
Set the `DOTENV_SECRETSMANAGER_SKIP` env var (or `configuration.skip`) to
|
|
67
|
-
|
|
68
|
-
|
|
66
|
+
Set the `DOTENV_SECRETSMANAGER_SKIP` env var (or `configuration.skip`) to skip
|
|
67
|
+
resolution: no AWS calls and no client constructed. Instead of resolving them,
|
|
68
|
+
`resolve!` **removes** every `ENV` key whose value is an `aws-sm:` reference, so
|
|
69
|
+
the net effect is as if those references were never in `ENV`.
|
|
70
|
+
|
|
71
|
+
This deletion is deliberate: a raw `aws-sm:` value is never valid for any
|
|
72
|
+
consumer, and a *present-but-invalid* secret breaks boot. For example, leaving
|
|
73
|
+
`RAILS_MASTER_KEY="aws-sm:..."` in `ENV` makes Rails credentials decryption fail
|
|
74
|
+
with `ArgumentError: key must be 16 bytes`, whereas an *absent* `RAILS_MASTER_KEY`
|
|
75
|
+
is tolerated. Non-reference inline config (e.g. `DEFAULT_URL_HOST`) is left
|
|
76
|
+
intact — the build still wants those values.
|
|
69
77
|
|
|
70
78
|
```sh
|
|
71
79
|
DOTENV_SECRETSMANAGER_SKIP=true
|
|
@@ -26,7 +26,14 @@ module Dotenv
|
|
|
26
26
|
end
|
|
27
27
|
|
|
28
28
|
def resolve!(env = ENV)
|
|
29
|
-
|
|
29
|
+
if skip?
|
|
30
|
+
# Delete reference-holding keys rather than leaving them: a raw
|
|
31
|
+
# aws-sm: literal is never a valid value for any consumer, and a
|
|
32
|
+
# present-but-invalid secret (e.g. RAILS_MASTER_KEY) breaks boot.
|
|
33
|
+
# Non-reference inline config is left intact for the build.
|
|
34
|
+
env.keys.each { |key| env.delete(key) if Reference.reference?(env[key]) }
|
|
35
|
+
return env
|
|
36
|
+
end
|
|
30
37
|
|
|
31
38
|
Resolver.new(env: env, config: configuration).resolve!
|
|
32
39
|
end
|