Skip to content

Commit

Permalink
Merge branch 'master' into revert-1214-revert-1210-change_local_path_…
Browse files Browse the repository at this point in the history
…type
  • Loading branch information
Adnilson authored Sep 20, 2024
2 parents bfc5a92 + 085f907 commit 42d2fda
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 3 deletions.
5 changes: 4 additions & 1 deletion app/serializers/v3/product_serializer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,11 @@ def eula_url
end

def free
# Everything is free on RMT :-)
# Everything is free on RMT :-) outside of the Public Cloud (i.e. LTSS)
# Otherwise Yast and SUSEConnect will request a regcode when activating an extension
# FIXME
return object.free if defined?(SccProxy::Engine) && object.extension?

true
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,7 @@
context 'when no regcode is provided' do
it 'activates the product' do
data = JSON.parse(response.body)
expect(data['product']['free']).to eq(false)
expect(data['id']).to eq(product.id)
end
end
Expand Down
2 changes: 1 addition & 1 deletion engines/registry/app/models/access_scope.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def allowed_paths(system = nil)
allowed_product_classes = (active_product_classes & access_policies_yml.keys)
if system && system.hybrid?
# if the system is hybrid => check if the non free product subscription is still valid for accessing images
allowed_non_free_product_classes = allowed_product_classes.map { |s| s unless Product.find_by(product_class: s).free? }
allowed_non_free_product_classes = allowed_product_classes.map { |s| s unless Product.find_by(product_class: s, product_type: 'extension').free? }.compact
unless allowed_non_free_product_classes.empty?
auth_header = {
'HTTP_AUTHORIZATION' => ActionController::HttpAuthentication::Basic.encode_credentials(system.login, system.password)
Expand Down
2 changes: 1 addition & 1 deletion engines/registry/spec/app/models/access_scope_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@
system
end
let(:product1) do
product = FactoryBot.create(:product, :with_mirrored_repositories)
product = FactoryBot.create(:product, :with_mirrored_repositories, :extension)
product.repositories.where(enabled: false).update(mirroring_enabled: false)
product.update(product_class: 'SLES15-SP4-LTSS-X86')
product
Expand Down
1 change: 1 addition & 0 deletions engines/scc_proxy/lib/scc_proxy/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,7 @@ def announce_system
password: response['password'],
hostname: params[:hostname],
proxy_byos_mode: :byos,
proxy_byos: true,
system_information: system_information,
instance_data: instance_data
)
Expand Down

0 comments on commit 42d2fda

Please sign in to comment.