legion-settings 1.3.1 → 1.3.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cb0e2c44578e9e5b6cbb495c5160e1a37c067ea5692979e50e89494d33da9888
4
- data.tar.gz: ebca4fdb1fb58e2fa315620209ccbe5f5302057a7dc0d4a256f9689ea8d5d8b0
3
+ metadata.gz: 905fefabffcdb64f2d654827742feb7c2651a3603625eb7f4e2eb71930416c8e
4
+ data.tar.gz: e19c105841be33b885565d5dac97d2549ee9813897ea4286bf68977e35e95e63
5
5
  SHA512:
6
- metadata.gz: 738f2ced6bf58fcb2d9ad4fca307d63abea4241bd6c5e788ff3ee47346f8f1054fd1cceb94d86e2f393f7985a0a835076513b94de730a89e9e233d923d5c1775
7
- data.tar.gz: ac60c369c84bd0dcb53b84f5fcdf9440fcd25ea00d15bb32386b67a4b999ceead7dde040fa66de53c9e6b06a5e99628b674923d0503dcbbe945a5b30a7d88bb6
6
+ metadata.gz: 71a352c5cd2a45145619ae24d31f9b9f3280c33c0d2f864c21c9549f7a78a4a48b45f06d4172bc6ed30d314a355ab1548bc141efa63638917734816b1c66c0ba
7
+ data.tar.gz: 6a7a29a655bc77c13352631a62763bc20c8cf9d2a7e84efeaa43b92cc70301425081aa8ed82e6d34a2c77aac9944500ff241ce404f09d0af76bb4de9aaf68baf
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Legion::Settings Changelog
2
2
 
3
+ ## [1.3.2] - 2026-03-17
4
+
5
+ ### Added
6
+ - `dig(*keys)` method on `Legion::Settings` and `Legion::Settings::Loader` for nested key access
7
+
3
8
  ## [1.3.1] - 2026-03-16
4
9
 
5
10
  ### Added
data/README.md CHANGED
@@ -36,12 +36,13 @@ Each Legion module registers its own defaults via `merge_settings` during startu
36
36
 
37
37
  ### Secret Resolution
38
38
 
39
- Settings values can reference external secret sources using URI syntax. Two schemes are supported:
39
+ Settings values can reference external secret sources using URI syntax. Three schemes are supported:
40
40
 
41
41
  | Scheme | Format | Resolution |
42
42
  |--------|--------|------------|
43
- | `vault://` | `vault://path/to/secret#key` | Reads from HashiCorp Vault via `Legion::Crypt` |
43
+ | `vault://` | `vault://path/to/secret#key` | Reads static KV secrets from HashiCorp Vault via `Legion::Crypt` |
44
44
  | `env://` | `env://ENV_VAR_NAME` | Reads from environment variable |
45
+ | `lease://` | `lease://name#key` | Reads from dynamic Vault leases via `Legion::Crypt::LeaseManager` |
45
46
 
46
47
  Array values act as fallback chains — the first non-nil result wins:
47
48
 
@@ -59,7 +60,7 @@ Call `Legion::Settings.resolve_secrets!` to resolve all URIs in-place. In the Le
59
60
 
60
61
  ```ruby
61
62
  Legion::Settings.resolve_secrets!
62
- # All vault:// and env:// references are now replaced with their resolved values
63
+ # All vault://, env://, and lease:// references are now replaced with their resolved values
63
64
  ```
64
65
 
65
66
  ### Schema Validation
@@ -69,6 +69,10 @@ module Legion
69
69
  to_hash[key]
70
70
  end
71
71
 
72
+ def dig(*keys)
73
+ to_hash.dig(*keys)
74
+ end
75
+
72
76
  def []=(key, value)
73
77
  @settings[key] = value
74
78
  @indifferent_access = false
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Legion
4
4
  module Settings
5
- VERSION = '1.3.1'
5
+ VERSION = '1.3.2'
6
6
  end
7
7
  end
@@ -37,6 +37,13 @@ module Legion
37
37
  nil
38
38
  end
39
39
 
40
+ def dig(*keys)
41
+ @loader = load if @loader.nil?
42
+ @loader.dig(*keys)
43
+ rescue NoMethodError, TypeError
44
+ nil
45
+ end
46
+
40
47
  def set_prop(key, value)
41
48
  @loader = load if @loader.nil?
42
49
  @loader[key] = value
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: legion-settings
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.1
4
+ version: 1.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Esity