legionio 1.6.13 → 1.6.14

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: 8682edaf8eaf214c03e6dca287e4298260dde6482506bacee7c6ef247ad1fc8f
4
- data.tar.gz: 3f045eec756ee09f7d15ea25c7d40709fd95dd71d6e277845e400c4c6be19f98
3
+ metadata.gz: dc17927ba8bbaf31e26083ef2c3d550ccbd87abafa545714e094e1f899d7f543
4
+ data.tar.gz: e5bb743c58d92b8342874f360bd7e4d4099afb02f952c11cf082da71018dcba9
5
5
  SHA512:
6
- metadata.gz: b41ad3b698ae6318ae2a6e7f1c3e0f1d34a46df6dcc183bcf644f5850d458c0d5c1ca080ddee2f81d69dce7a8d5ecdcbb7ae509295a7fd56f852e8f5af8aa189
7
- data.tar.gz: 860b776fc04f33f031f07c1969058f4278b8c6a124c09920a54c40b808bdbf708454b8062be32d3960741e8cef5afd1c2c38bb546ad382dd98e528c806a46bf4
6
+ metadata.gz: 4974c363f4072d5320529dcd0f4682b0d929c8d52fad085cfa6ec703f93306db15fc4a6a79e18fb48e933a62d96ba5039aa30b820e6a18a2d79a90bf3e2ca284
7
+ data.tar.gz: d3f45ca33a851c1de50d5a4bc2ec6fbce83afec0d5e64733c93a46372d423a6f0a892ef4233aa735e0c502ad93a748c958d31fc843382b388abfa8e10364e2f1
data/CHANGELOG.md CHANGED
@@ -2,6 +2,21 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [1.6.14] - 2026-03-27
6
+
7
+ ### Added
8
+ - `Legion::Compliance` module rewritten with DEFAULTS hash, `merge_settings` registration, and clean API
9
+ - `Compliance.setup` registers max-classification defaults: PHI, PCI, PII, FedRAMP all enabled by default
10
+ - `Compliance.enabled?`, `.phi_enabled?`, `.pci_enabled?`, `.pii_enabled?`, `.fedramp_enabled?` convenience methods
11
+ - `Compliance.classification_level` returns `'confidential'` by default (highest level)
12
+ - `Compliance.profile` returns a hash with all compliance flags for downstream consumers
13
+ - `setup_compliance` wired into Service boot sequence after settings load
14
+ - Compliance profile spec (8 examples)
15
+
16
+ ### Changed
17
+ - `Compliance.phi_enabled?` now uses `Settings.dig(:compliance, :phi_enabled)` instead of chaining `[]` calls
18
+ - Existing PhiTag and PhiAccessLog specs updated to use `merge_settings` instead of stubbing `Settings.[]`
19
+
5
20
  ## [1.6.13] - 2026-03-27
6
21
 
7
22
  ### Added
@@ -6,13 +6,69 @@ require 'legion/compliance/phi_erasure'
6
6
 
7
7
  module Legion
8
8
  module Compliance
9
+ DEFAULTS = {
10
+ enabled: true,
11
+ classification_level: 'confidential',
12
+ phi_enabled: true,
13
+ pci_enabled: true,
14
+ pii_enabled: true,
15
+ fedramp_enabled: true,
16
+ log_redaction: true,
17
+ cache_phi_max_ttl: 3600
18
+ }.freeze
19
+
9
20
  class << self
21
+ def setup
22
+ return unless defined?(Legion::Settings)
23
+
24
+ Legion::Settings.merge_settings(:compliance, DEFAULTS)
25
+ Legion::Logging.info('[Compliance] max-classification profile active') if defined?(Legion::Logging)
26
+ end
27
+
28
+ def enabled?
29
+ setting(:enabled) == true
30
+ end
31
+
10
32
  def phi_enabled?
11
- return false unless defined?(Legion::Settings)
33
+ setting(:phi_enabled) == true
34
+ end
35
+
36
+ def pci_enabled?
37
+ setting(:pci_enabled) == true
38
+ end
39
+
40
+ def pii_enabled?
41
+ setting(:pii_enabled) == true
42
+ end
43
+
44
+ def fedramp_enabled?
45
+ setting(:fedramp_enabled) == true
46
+ end
47
+
48
+ def classification_level
49
+ setting(:classification_level) || 'confidential'
50
+ end
51
+
52
+ def profile
53
+ {
54
+ classification_level: classification_level,
55
+ phi: phi_enabled?,
56
+ pci: pci_enabled?,
57
+ pii: pii_enabled?,
58
+ fedramp: fedramp_enabled?,
59
+ log_redaction: setting(:log_redaction) == true,
60
+ cache_phi_max_ttl: setting(:cache_phi_max_ttl) || 3600
61
+ }
62
+ end
63
+
64
+ private
65
+
66
+ def setting(key)
67
+ return nil unless defined?(Legion::Settings)
12
68
 
13
- Legion::Settings[:compliance][:phi_enabled] == true
69
+ Legion::Settings.dig(:compliance, key)
14
70
  rescue StandardError
15
- false
71
+ nil
16
72
  end
17
73
  end
18
74
  end
@@ -31,6 +31,7 @@ module Legion
31
31
  Legion::Logging.debug('Starting Legion::Service')
32
32
  setup_settings
33
33
  apply_cli_overrides(http_port: http_port)
34
+ setup_compliance
34
35
  setup_local_mode
35
36
  reconfigure_logging(log_level)
36
37
  Legion::Logging.info("node name: #{Legion::Settings[:client][:name]}")
@@ -225,6 +226,15 @@ module Legion
225
226
  self.class.log_privacy_mode_status
226
227
  end
227
228
 
229
+ def setup_compliance
230
+ require 'legion/compliance'
231
+ Legion::Compliance.setup
232
+ rescue LoadError => e
233
+ Legion::Logging.debug "Compliance module not available: #{e.message}"
234
+ rescue StandardError => e
235
+ Legion::Logging.warn "Compliance setup failed: #{e.message}"
236
+ end
237
+
228
238
  def apply_cli_overrides(http_port: nil)
229
239
  return unless http_port
230
240
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Legion
4
- VERSION = '1.6.13'
4
+ VERSION = '1.6.14'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: legionio
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.13
4
+ version: 1.6.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Esity