legion-crypt 1.4.5 → 1.4.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2e448a5dd1e2c70e43cff0b6512e1b2af1d41f9a2af7b9719495ba5b10c90ec7
4
- data.tar.gz: 6c270665c5a185baa844e5b7e80af9f2ac8922a520748e387a9d10363294061e
3
+ metadata.gz: 58236395edc171db0660e744e8ed15ed7497af43bb6154f9361693a6576f070c
4
+ data.tar.gz: '008c7865a64d8a43c3c167ae3fc36aef7b537f26522b2ce05f40615b98ff3e80'
5
5
  SHA512:
6
- metadata.gz: bc43cab1939dee1cd1d6c28a07a2766953af52fc30230375d47e23e289f53beaf3a2be47d98c549bd9098c545d6dd540faa8a87143bb678429265a96b55d96cf
7
- data.tar.gz: 1813d049d59f5bb81baeef8f10fb2e9f68d7540c8fb4858a75f2f40d881eb7b101a42ce4f89161a38ef14122da0e53e1cf0d2009716d7411ba16c0a77902504c
6
+ metadata.gz: eb66a3e5aaf65cf06e463e0ed4024121d9f8b9459731ef8422761fa0d9888c6e90bef58e0a4bb13cfd57eb2d14063ebfe07a8968209f738d15f99080669055e9
7
+ data.tar.gz: 980231e72cdb5a7eb36702fcb69dfc25ff41811c35df5485476410e386126ff45c4911715ec43cc3c347932f6a5d79d4c70728afde25f99cf423d03aae223265
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Legion::Crypt
2
2
 
3
+ ## [1.4.6] - 2026-03-21
4
+
5
+ ### Fixed
6
+ - Vault URL construction: normalize `address` field that contains a full URL with scheme (e.g. `https://host`) instead of just a hostname, preventing malformed `http://https://host:port` addresses
7
+
3
8
  ## [1.4.5] - 2026-03-20
4
9
 
5
10
  ### Changed
data/CODEOWNERS ADDED
@@ -0,0 +1 @@
1
+ * @Esity
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'uri'
3
4
  require 'vault'
4
5
 
5
6
  module Legion
@@ -13,7 +14,19 @@ module Legion
13
14
 
14
15
  def connect_vault
15
16
  @sessions = []
16
- ::Vault.address = "#{Legion::Settings[:crypt][:vault][:protocol]}://#{Legion::Settings[:crypt][:vault][:address]}:#{Legion::Settings[:crypt][:vault][:port]}" # rubocop:disable Layout/LineLength
17
+ vault_settings = Legion::Settings[:crypt][:vault]
18
+ protocol = vault_settings[:protocol] || 'http'
19
+ address = vault_settings[:address] || 'localhost'
20
+ port = vault_settings[:port] || 8200
21
+
22
+ if address.match?(%r{\Ahttps?://})
23
+ uri = URI.parse(address)
24
+ protocol = uri.scheme
25
+ address = uri.host
26
+ port = uri.port if vault_settings[:port].nil?
27
+ end
28
+
29
+ ::Vault.address = "#{protocol}://#{address}:#{port}"
17
30
 
18
31
  Legion::Settings[:crypt][:vault][:token] = ENV['VAULT_DEV_ROOT_TOKEN_ID'] if ENV.key? 'VAULT_DEV_ROOT_TOKEN_ID'
19
32
  return nil if Legion::Settings[:crypt][:vault][:token].nil?
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Legion
4
4
  module Crypt
5
- VERSION = '1.4.5'
5
+ VERSION = '1.4.6'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: legion-crypt
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.5
4
+ version: 1.4.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Esity
@@ -66,6 +66,7 @@ files:
66
66
  - ".rubocop.yml"
67
67
  - CHANGELOG.md
68
68
  - CLAUDE.md
69
+ - CODEOWNERS
69
70
  - Gemfile
70
71
  - LICENSE
71
72
  - README.md