verikloak-audience 0.2.0 → 0.2.1

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: 0fb9e7977881b01b0bd15bad81ebf1a49e279ae3f5e2cefb9d978c6579c9fceb
4
- data.tar.gz: 778b0260bb771b2e5d14f18b2cda54ce19567a5ee727f85ade281e8331170e44
3
+ metadata.gz: f7b437ab60e6ddce3b76539ce7806633ef21509c2541d645ad1040ff0d840cd0
4
+ data.tar.gz: 3f181a7ffe9aef9973e27aee57ce14840937eb16dc7a2dcf00951b30115d367d
5
5
  SHA512:
6
- metadata.gz: 26a8bfcc5c5d714b1376dd88b4e7a27c530806f6d935f8d2b3665b3c7c52d7345782ad1df40a3d7fb63b912e899aa33f27e79ddb6b39c05074b256dfd0c99fe0
7
- data.tar.gz: 359a268c4ad3567c83dc93f1a6a348f8a8b8c22cb0067fced9c1473cd9285a7b7bb64b4a10b09d397b4de305a28221678238da1bdc7c0adb4ccf2632a18d0232
6
+ metadata.gz: 58bf73692f747dd60d6e8da0985fde737202152df279fe56d3eeecd684846e4ea3bb186583d735dc709b8a048b27a40709cb7bbd2c133e992eacadb306c22f69
7
+ data.tar.gz: 9b2d528270ebe27dc89a4c0d78f915ef43956e535f3d0cf9a40e2452e112136aaa654b31df97045d2a49f32e68b4ad51bd1217769f2cde725cd9bb790780a54e
data/CHANGELOG.md CHANGED
@@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ---
9
9
 
10
+ ## [0.2.1] - 2025-09-22
11
+
12
+ ### Fixed
13
+ - Skip configuration validation while Rails generators run so `rails g verikloak:install` can execute before `required_aud` is configured.
14
+
10
15
  ## [0.2.0] - 2025-09-21
11
16
 
12
17
  ### Added
@@ -35,6 +35,8 @@ module Verikloak
35
35
 
36
36
  initializer 'verikloak_audience.configuration' do
37
37
  config.after_initialize do
38
+ next if Verikloak::Audience::Railtie.skip_configuration_validation?
39
+
38
40
  Verikloak::Audience.config.validate!
39
41
  end
40
42
  end
@@ -50,6 +52,35 @@ module Verikloak
50
52
 
51
53
  app.middleware.insert_after ::Verikloak::Middleware, ::Verikloak::Audience::Middleware
52
54
  end
55
+
56
+ COMMANDS_SKIPPING_VALIDATION = %w[generate g destroy d].freeze
57
+
58
+ # Detect whether Rails is currently executing a generator-style command.
59
+ # Generators boot the application before configuration exists, so we
60
+ # temporarily skip validation to let the install task complete.
61
+ #
62
+ # @return [Boolean]
63
+ def self.skip_configuration_validation?
64
+ return false unless defined?(Rails::Generators)
65
+
66
+ command = first_rails_command
67
+ COMMANDS_SKIPPING_VALIDATION.include?(command)
68
+ end
69
+
70
+ # Capture the first non-option argument passed to the Rails CLI,
71
+ # ignoring wrapper tokens such as "rails".
72
+ #
73
+ # @return [String, nil]
74
+ def self.first_rails_command
75
+ ARGV.each do |arg|
76
+ next if arg.start_with?('-')
77
+ next if arg == 'rails'
78
+
79
+ return arg
80
+ end
81
+
82
+ nil
83
+ end
53
84
  end
54
85
  end
55
86
  end
@@ -4,6 +4,6 @@ module Verikloak
4
4
  module Audience
5
5
  # Current gem version.
6
6
  # @return [String]
7
- VERSION = '0.2.0'
7
+ VERSION = '0.2.1'
8
8
  end
9
9
  end
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.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - taiyaky
@@ -35,7 +35,7 @@ dependencies:
35
35
  requirements:
36
36
  - - ">="
37
37
  - !ruby/object:Gem::Version
38
- version: 0.1.5
38
+ version: 0.2.0
39
39
  - - "<"
40
40
  - !ruby/object:Gem::Version
41
41
  version: 1.0.0
@@ -45,7 +45,7 @@ dependencies:
45
45
  requirements:
46
46
  - - ">="
47
47
  - !ruby/object:Gem::Version
48
- version: 0.1.5
48
+ version: 0.2.0
49
49
  - - "<"
50
50
  - !ruby/object:Gem::Version
51
51
  version: 1.0.0
@@ -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.0
77
+ documentation_uri: https://rubydoc.info/gems/verikloak-audience/0.2.1
78
78
  rubygems_mfa_required: 'true'
79
79
  rdoc_options: []
80
80
  require_paths: