diff --git a/engines/scc_proxy/lib/scc_proxy/engine.rb b/engines/scc_proxy/lib/scc_proxy/engine.rb index e2897e000..2413f8edf 100644 --- a/engines/scc_proxy/lib/scc_proxy/engine.rb +++ b/engines/scc_proxy/lib/scc_proxy/engine.rb @@ -264,7 +264,7 @@ def scc_check_subscription_expiration(headers, system, product_class = nil) status_products_classes = if system.byos? scc_systems_activations.map do |act| product = act['service']['product'] - if product['product_class'] == product_class && (product['free'] || (!act['status'].nil? && act['status'].casecmp('active').zero?)) + if product['product_class'] == product_class && (product['free'] || (!act['status'].nil? && act['status'].casecmp('active').zero?)) # rubocop:disable Layout/LineLength # free module or (paid extension or base product)) true end diff --git a/engines/strict_authentication/app/controllers/strict_authentication/authentication_controller.rb b/engines/strict_authentication/app/controllers/strict_authentication/authentication_controller.rb index 3a48afc0e..ee81bb698 100644 --- a/engines/strict_authentication/app/controllers/strict_authentication/authentication_controller.rb +++ b/engines/strict_authentication/app/controllers/strict_authentication/authentication_controller.rb @@ -14,6 +14,8 @@ def check protected + # rubocop:disable Metrics/CyclomaticComplexity + # rubocop:disable Metrics/PerceivedComplexity def path_allowed?(headers) path = headers['X-Original-URI'] return false if path.blank? @@ -79,6 +81,8 @@ def path_allowed?(headers) false end end + # rubocop:enable Metrics/CyclomaticComplexity + # rubocop:enable Metrics/PerceivedComplexity # rubocop:disable Metrics/CyclomaticComplexity # rubocop:disable Metrics/PerceivedComplexity diff --git a/engines/zypper_auth/lib/zypper_auth/engine.rb b/engines/zypper_auth/lib/zypper_auth/engine.rb index 8fc2844a9..0655c460c 100644 --- a/engines/zypper_auth/lib/zypper_auth/engine.rb +++ b/engines/zypper_auth/lib/zypper_auth/engine.rb @@ -6,7 +6,7 @@ def auth_logger Thread.current[:logger] end - def verify_instance(request, logger, system, params_product_id = nil) + def verify_instance(request, logger, system) return false unless request.headers['X-Instance-Data'] base_product = system.products.find_by(product_type: 'base') diff --git a/engines/zypper_auth/spec/requests/strict_authentication/authentication_controller_spec.rb b/engines/zypper_auth/spec/requests/strict_authentication/authentication_controller_spec.rb index b14ac89a1..5e5026efb 100644 --- a/engines/zypper_auth/spec/requests/strict_authentication/authentication_controller_spec.rb +++ b/engines/zypper_auth/spec/requests/strict_authentication/authentication_controller_spec.rb @@ -69,8 +69,8 @@ systems_count: 1, service: { product: { - id: system_byos.products.find_by(product_type: 'base').id, # activations.joins(:product).where(products: { free: false, product_type: :extension }).first.product.id, - product_class: system_byos.products.find_by(product_type: 'base').product_class # activations.joins(:product).where(products: { free: false, product_type: :extension }).first.product.product_class + id: system_byos.products.find_by(product_type: 'base').id, # activations.joins(:product).where(products: { free: false, product_type: :extension }).first.product.id, # rubocop:disable Layout/LineLength + product_class: system_byos.products.find_by(product_type: 'base').product_class # activations.joins(:product).where(products: { free: false, product_type: :extension }).first.product.product_class # rubocop:disable Layout/LineLength } } } @@ -432,7 +432,8 @@ service: { product: { id: system_hybrid.activations.joins(:product).where(products: { free: false, product_type: :extension }).first.product.id, - product_class: system_hybrid.activations.joins(:product).where(products: { free: false, product_type: :extension }).first.product.product_class + product_class: system_hybrid.activations.joins(:product).where(products: { free: false, + product_type: :extension }).first.product.product_class } } } @@ -482,7 +483,8 @@ service: { product: { id: system_hybrid.activations.joins(:product).where(products: { free: false, product_type: :extension }).first.product.id, - product_class: system_hybrid.activations.joins(:product).where(products: { free: false, product_type: :extension }).first.product.product_class + product_class: system_hybrid.activations.joins(:product).where(products: { free: false, + product_type: :extension }).first.product.product_class } } }