kaui 3.0.8 → 3.0.9

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: cf7ea372356e996b5fc77a5626f3f3842afcc2b2dce9327f9bca8f0ffaad8b78
4
- data.tar.gz: 398c7541e8545b5a38516e3a1ddf5601335a305d55f5e952879aee05eaa6d113
3
+ metadata.gz: 0407ec65d7d8fbb849a36b506a1f2f31d37f50fb3f70cc9acfbe444624e247ae
4
+ data.tar.gz: 92ba60faa926a45b0112de00d220c3fca430187c7cfcd5e03e2578d984de3a88
5
5
  SHA512:
6
- metadata.gz: ea1290c241b5eff5135e0336c8d0102bb683179b035b3bdea84488547d8ba277b5cfbc556721697c566153d1fa513dc493291da606e9b0b2c380e1bb53ec491d
7
- data.tar.gz: feb7fce03adcc134ba0990b183d5f17967de1a0057329ffba850a616115ae424fc81519f7356d999da3c460d0555431b24b4490c36ae2a51fc3e798ee472d710
6
+ metadata.gz: d543f8aa470d4425b229ebebf3da3a19bf7774788a368a973db2c2ba4edbaf072d5282c3b32a18de66c5ddb3827aae929d60c21fc92edbe2e3988cff799cc5ac
7
+ data.tar.gz: fa917bc4b277a5e06cb5b6898b22fa65b52ec1e4048f86bd0e1f39b098ce292ed77175e5ea3144d7d123458758f20a82eba39db161428df81565a9ae16d1525c
@@ -103,7 +103,7 @@ module Kaui
103
103
  end
104
104
 
105
105
  tenants_for_current_user = retrieve_tenants_for_current_user
106
- tenants = (Kaui::Tenant.where(id: tenants).select { |tenant| tenants_for_current_user.include?(tenant.kb_tenant_id) }).map(&:id)
106
+ tenants = Kaui::Tenant.where(id: tenants).select { |tenant| tenants_for_current_user.include?(tenant.kb_tenant_id) }.map(&:id)
107
107
 
108
108
  allowed_user.kaui_tenant_ids = tenants
109
109
 
@@ -31,8 +31,12 @@ module Kaui
31
31
  options[:api_key] = param_tenant[:api_key]
32
32
  options[:api_secret] = param_tenant[:api_secret]
33
33
  new_tenant = Kaui::AdminTenant.find_by_api_key(param_tenant[:api_key], options)
34
- rescue KillBillClient::API::Unauthorized, KillBillClient::API::NotFound
34
+ rescue KillBillClient::API::Unauthorized, KillBillClient::API::NotFound, KillBillClient::API::InternalServerError => e
35
35
  # Create the tenant in Kill Bill
36
+ if e.instance_of?(KillBillClient::API::InternalServerError) && !e.message&.include?('TenantCacheLoader cannot find value')
37
+ flash[:error] = "Internal server error while retrieving tenant: #{as_string(e)}"
38
+ redirect_to admin_tenants_path and return
39
+ end
36
40
  new_tenant = Kaui::AdminTenant.new
37
41
  new_tenant.external_key = param_tenant[:name]
38
42
  new_tenant.api_key = param_tenant[:api_key]
@@ -117,7 +117,7 @@ module Kaui
117
117
  def find_value_from_properties(properties, key)
118
118
  return nil if key.nil? || properties.nil?
119
119
 
120
- prop = (properties.find { |kv| kv.key.to_s == key.to_s })
120
+ prop = properties.find { |kv| kv.key.to_s == key.to_s }
121
121
  prop&.value
122
122
  end
123
123
  end
@@ -25,7 +25,7 @@ module Kaui
25
25
 
26
26
  ALL_OBJECT_TYPES.each do |object_type|
27
27
  define_singleton_method "all_for_#{object_type.downcase}" do |options_for_klient|
28
- (all('NONE', options_for_klient).delete_if { |tag_definition| !tag_definition.applicable_object_types.include?(object_type) }).sort
28
+ all('NONE', options_for_klient).delete_if { |tag_definition| !tag_definition.applicable_object_types.include?(object_type) }.sort
29
29
  end
30
30
  end
31
31
 
data/lib/kaui/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Kaui
4
- VERSION = '3.0.8'
4
+ VERSION = '3.0.9'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kaui
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.8
4
+ version: 3.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kill Bill core team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-07-07 00:00:00.000000000 Z
11
+ date: 2025-08-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionpack