legion-data 1.10.6 → 1.10.7

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: 861fe6533a77e8819c03400430f32ddb420a7cfa29e042b3c86734f6d7fd57bc
4
- data.tar.gz: 48fe377db280cad64c5e9331926a24319a44c78c96eeb9aa7e2c6aa038a77024
3
+ metadata.gz: bc598e354968c28944d6e897feb5853d57987fed49eaf0cd16f319abcfbd8cf8
4
+ data.tar.gz: ebc17c4d4b8c49585bcdb0a49803c4988e8d55970ddde56b294746d810193f63
5
5
  SHA512:
6
- metadata.gz: 3850a5774dbc1de772fd8a2b4762dddc9da3164e9cff32b5f02b946f7608dba551394bcb3b2aa90590f038199f33da655957c74896ff74419e840a4769b7008e
7
- data.tar.gz: 006b1ed6fd955a876dabfa6875fa075eb8abfec1aa59467b3411e36e3ce32752735277b4013ba908db280cb98a4c152bb91e14563be55c41d6ff53778c3f944a
6
+ metadata.gz: 7f36631ecd03c493fa2dfd3b347a4f16765b7900545d31306e4b73f0418a455a99c15ab55a8de83ad86c123befede09a222a67a6095f624923028c585ca9c7d0
7
+ data.tar.gz: 9a1783c655df6dce9c23a4a878645cf196e4463d0763d95c380029263a8deeccce7cfce8e66ede4843a04c68e8369232d8d4b785460bd70181d4ad1adcf1c01b
data/.rubocop.yml CHANGED
@@ -23,13 +23,6 @@ Naming/VariableNumber:
23
23
  - lib/legion/data/connection.rb
24
24
  Legion/Framework/EagerSequelModel:
25
25
  Enabled: false
26
- # TaxonomyEnum validates LLM lane taxonomy (:tier/:type/:circuit_state). In
27
- # these paths `type:` is a Sequel column type (e.g. foreign_key type: :uuid) or
28
- # the extract API (type: :auto/:text) — not LLM taxonomy — so the cop misfires.
29
- Legion/Llm/TaxonomyEnum:
30
- Exclude:
31
- - 'lib/legion/data/migrations/**/*'
32
- - 'spec/**/*'
33
26
  Metrics/BlockLength:
34
27
  Max: 100
35
28
  Exclude:
@@ -37,6 +30,8 @@ Metrics/BlockLength:
37
30
  - 'lib/legion/data/migrations/*'
38
31
  ThreadSafety/ClassInstanceVariable:
39
32
  Enabled: false
33
+ Legion/Llm/TaxonomyEnum:
34
+ Enabled: false
40
35
  ThreadSafety/ClassAndModuleAttributes:
41
36
  Enabled: false
42
37
  Metrics/AbcSize:
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Legion::Data Changelog
2
2
 
3
+ ## [1.10.7] - 2026-07-15
4
+ ### Fixed
5
+ - Fail loud with actionable error when unresolved lease:// credentials reach connection
6
+
3
7
  ## [1.10.6] - 2026-07-03
4
8
 
5
9
  ### Changed
@@ -10,6 +10,10 @@ module Legion
10
10
  module Connection
11
11
  ADAPTERS = %i[sqlite mysql2 postgres].freeze
12
12
 
13
+ UNRESOLVED_URI_PATTERN = %r{\A(?:vault|env|lease)://}
14
+
15
+ class UnresolvedCredentialError < StandardError; end
16
+
13
17
  GENERIC_KEYS = %i[max_connections pool_timeout preconnect single_threaded test name].freeze
14
18
 
15
19
  ADAPTER_KEYS = {
@@ -171,6 +175,9 @@ module Legion
171
175
  attempted_adapter = adapter
172
176
  begin
173
177
  ::Sequel.connect(connection_opts_for(adapter: attempted_adapter, opts: opts))
178
+ rescue UnresolvedCredentialError => e
179
+ handle_exception(e, level: :fatal, handled: false, operation: :data_connect)
180
+ raise
174
181
  rescue StandardError => e
175
182
  raise unless dev_fallback?
176
183
 
@@ -410,10 +417,23 @@ module Legion
410
417
 
411
418
  def connection_opts_for(adapter:, opts:)
412
419
  connection_opts = opts.merge(adapter: adapter, **creds_builder)
420
+ validate_no_unresolved_uris!(connection_opts)
413
421
  connection_opts[:preconnect] = false if adapter != :sqlite && dev_fallback?
414
422
  connection_opts
415
423
  end
416
424
 
425
+ def validate_no_unresolved_uris!(connection_opts)
426
+ %i[user username password].each do |key|
427
+ value = connection_opts[key]
428
+ next unless value.is_a?(String) && value.match?(UNRESOLVED_URI_PATTERN)
429
+
430
+ raise UnresolvedCredentialError,
431
+ "Legion::Data cannot connect: settings[:data][:creds][:#{key}] is still " \
432
+ "an unresolved URI placeholder (#{value}). The settings resolver failed to " \
433
+ 'resolve this lease — check that Legion::Crypt and Vault are available at boot.'
434
+ end
435
+ end
436
+
417
437
  def sequel_opts
418
438
  data = Legion::Settings[:data]
419
439
  opts = {}
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Legion
4
4
  module Data
5
- VERSION = '1.10.6'
5
+ VERSION = '1.10.7'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: legion-data
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.10.6
4
+ version: 1.10.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Esity