verikloak-audience 0.2.3 → 0.2.5

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: 713d20df5953ade3498d0e2fbd5ea3adbd86475911e3bf28b9d3ba670a5fdac7
4
- data.tar.gz: a2f6975e273151879cd3a9bde96b0619b6db1214f5a1f9d007992dbb0bea6467
3
+ metadata.gz: 3b5e110926bc9c76f3fd1060601f6633ac033e1d8e4609e87be95a7a7d96f0a4
4
+ data.tar.gz: 50fb3c748a6702d63a049a3dc70d27739bf80e00719880d195d00e854d6c0586
5
5
  SHA512:
6
- metadata.gz: b8288ce11783eb853baa74d1c1fa3622b547b2332e140c6e395cd28301a1995a39d329c54df46121bfec54f222784e923ae0d6de7ff4a226e55c88f195980804
7
- data.tar.gz: 9856d8684a3fbdcbde033e48926878a0cb54578c24f95f57ff34d4e62385249cbd8707721a59b3495b7f980413189fe32a9cc11d4af4319015aea34c0467852d
6
+ metadata.gz: c3555c88018205a6d4f7926c8316e9b188e7401a920376cae45cf1100830c29b47dfb3f8d6f0975bb37fbeab09758327f91975ede97e3dedc1427a4dd603f557
7
+ data.tar.gz: 9e701c727b9049fe912fdca6763c3e88e57bf53f951d69303653ec0430d6ff814ff69d2bdef36277c98c9dbf47c29ef00f4b209c84a2cf6cfd3c70f300dca967
data/CHANGELOG.md CHANGED
@@ -7,6 +7,22 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ---
9
9
 
10
+ ## [0.2.5] - 2025-09-23
11
+
12
+ ### Changed
13
+ - Use autoload for middleware to avoid circular require dependencies.
14
+ - Improve module loading performance by deferring middleware class loading until accessed.
15
+
16
+ ### Added
17
+ - Comprehensive test suite for standalone middleware require scenarios.
18
+ - Test coverage for middleware functionality when loaded independently of main gem entrypoint.
19
+
20
+ ## [0.2.4] - 2025-09-22
21
+
22
+ ### Fixed
23
+ - Skip middleware validation even before `Rails::Generators` is loaded so `rails g verikloak:install` succeeds without a placeholder configuration.
24
+ - Treat all `verikloak:*:install` generators as safe so additional installer tasks (e.g. `verikloak:pundit:install`) can run before configuration exists.
25
+
10
26
  ## [0.2.3] - 2025-09-22
11
27
 
12
28
  ### Fixed
@@ -54,10 +54,9 @@ module Verikloak
54
54
  end
55
55
 
56
56
  # Rails short commands (`g`, `d`) are stripped from ARGV fairly early in
57
- # the boot process. When that happens the first argument becomes the
58
- # generator namespace (e.g. `verikloak:install`). Include it here so the
59
- # install generator can run before `required_aud` is configured.
60
- COMMANDS_SKIPPING_VALIDATION = %w[generate g destroy d verikloak:install].freeze
57
+ # the boot process. Treat `verikloak:*:install` generators as safe so they
58
+ # can run before configuration files exist.
59
+ COMMANDS_SKIPPING_VALIDATION = %w[generate g destroy d].freeze
61
60
 
62
61
  # Detect whether Rails is currently executing a generator-style command.
63
62
  # Generators boot the application before configuration exists, so we
@@ -65,10 +64,10 @@ module Verikloak
65
64
  #
66
65
  # @return [Boolean]
67
66
  def self.skip_configuration_validation?
68
- return false unless defined?(Rails::Generators)
69
-
70
67
  command = first_rails_command
71
- COMMANDS_SKIPPING_VALIDATION.include?(command)
68
+ return false unless command
69
+
70
+ COMMANDS_SKIPPING_VALIDATION.include?(command) || verikloak_install_generator?(command)
72
71
  end
73
72
 
74
73
  # Capture the first non-option argument passed to the Rails CLI,
@@ -85,6 +84,17 @@ module Verikloak
85
84
 
86
85
  nil
87
86
  end
87
+
88
+ # Detect whether the provided CLI token refers to a Verikloak install
89
+ # generator (e.g. `verikloak:install`, `verikloak:pundit:install`).
90
+ #
91
+ # @param command [String, nil] first non-option argument from ARGV
92
+ # @return [Boolean]
93
+ def self.verikloak_install_generator?(command)
94
+ return false unless command.is_a?(String)
95
+
96
+ command.start_with?('verikloak:') && command.end_with?(':install')
97
+ end
88
98
  end
89
99
  end
90
100
  end
@@ -4,6 +4,6 @@ module Verikloak
4
4
  module Audience
5
5
  # Current gem version.
6
6
  # @return [String]
7
- VERSION = '0.2.3'
7
+ VERSION = '0.2.5'
8
8
  end
9
9
  end
@@ -5,13 +5,14 @@ require 'verikloak/audience/version'
5
5
  require 'verikloak/audience/configuration'
6
6
  require 'verikloak/audience/errors'
7
7
  require 'verikloak/audience/checker'
8
- require 'verikloak/audience/middleware'
9
8
  require 'verikloak/audience/railtie' if defined?(Rails::Railtie)
10
9
 
11
10
  module Verikloak
12
11
  # Audience configuration entrypoint and helpers.
13
12
  # This file also requires the public components of the gem.
14
13
  module Audience
14
+ autoload :Middleware, 'verikloak/audience/middleware'
15
+
15
16
  class << self
16
17
  # Configure verikloak-audience.
17
18
  #
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: verikloak-audience
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - taiyaky
@@ -74,7 +74,7 @@ metadata:
74
74
  source_code_uri: https://github.com/taiyaky/verikloak-audience
75
75
  changelog_uri: https://github.com/taiyaky/verikloak-audience/blob/main/CHANGELOG.md
76
76
  bug_tracker_uri: https://github.com/taiyaky/verikloak-audience/issues
77
- documentation_uri: https://rubydoc.info/gems/verikloak-audience/0.2.3
77
+ documentation_uri: https://rubydoc.info/gems/verikloak-audience/0.2.5
78
78
  rubygems_mfa_required: 'true'
79
79
  rdoc_options: []
80
80
  require_paths: