Skip to content

Commit

Permalink
Merge branch 'master' into noauthLicense
Browse files Browse the repository at this point in the history
  • Loading branch information
felixsch authored Jan 29, 2024
2 parents bf344c3 + 36d721c commit 1251d00
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 6 deletions.
6 changes: 3 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ GEM
dry-initializer (~> 3.0)
dry-schema (~> 1.5, >= 1.5.2)
erubi (1.12.0)
ethon (0.15.0)
ethon (0.16.0)
ffi (>= 1.15.0)
factory_bot (6.2.0)
activesupport (>= 5.0.0)
Expand All @@ -100,7 +100,7 @@ GEM
fakefs (1.8.0)
fast_gettext (2.3.0)
ffaker (2.21.0)
ffi (1.15.5)
ffi (1.16.3)
formatador (0.2.5)
forwardable (1.3.3)
fuubar (2.5.1)
Expand Down Expand Up @@ -295,7 +295,7 @@ GEM
timecop (0.9.8)
tins (1.26.0)
sync
typhoeus (1.4.0)
typhoeus (1.4.1)
ethon (>= 0.9.0)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
Expand Down
8 changes: 7 additions & 1 deletion app/controllers/services_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,15 @@ def show

builder = Builder::XmlMarkup.new
service_xml = builder.repoindex(ttl: ZYPPER_SERVICE_TTL) do
# NOTE: We only care to add the ?credentials parameter to the repository URL if
# we are *NOT* dealing with plain RMT but the authentication engine of Public Cloud.
# The engine requires to supply the service name to function properly, since repositories
# are authenticated in this case.
service_name = defined?(StrictAuthentication::Engine) ? service.name : nil

repos.each do |repo|
attributes = {
url: make_repo_url(request.base_url, repo.local_path, service.name),
url: make_repo_url(request.base_url, repo.local_path, service_name),
alias: repo.name,
name: repo.name,
autorefresh: repo.autorefresh,
Expand Down
3 changes: 3 additions & 0 deletions lib/rmt/misc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ module RMT
module Misc
def self.make_repo_url(base_url, local_path, service_name = nil)
uri = URI.join(base_url, File.join(RMT::DEFAULT_MIRROR_URL_PREFIX, local_path))
# NOTE: Make sure to only add the credentials where necessary (Pubcloud? or SMT?)
# In all other cases do not add them, since this will break other repository
# managers such as yum!
uri.query = "credentials=#{service_name}" if service_name
uri.to_s
end
Expand Down
3 changes: 2 additions & 1 deletion package/obs/rmt-server.changes
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
-------------------------------------------------------------------
Wed Oct 04 13:23:00 UTC 2023 - Felix Schnizlein <[email protected]>
Thu Jan 25 17:40:00 UTC 2024 - Felix Schnizlein <[email protected]>

- Version 2.15:
* Moving system hardware information to systems database table to
Expand All @@ -8,6 +8,7 @@ Wed Oct 04 13:23:00 UTC 2023 - Felix Schnizlein <[email protected]>
* rmt-client-setup-res script: fix for CentOS8 clients (bsc#1214709)
* Updated supportconfig script (bsc#1216389)
* Support zstd compression for repository metadata (bsc#1218775)
* Do not add credential handling to normal repository URLs (#1219153)

-------------------------------------------------------------------
Thu Jun 06 15:44:00 UTC 2023 - Luís Caparroz <[email protected]>
Expand Down
2 changes: 1 addition & 1 deletion spec/requests/services_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

let(:model_urls) do
service.repositories.reject(&:installer_updates).map do |repo|
RMT::Misc.make_repo_url('http://www.example.com', repo.local_path, service.name)
RMT::Misc.make_repo_url('http://www.example.com', repo.local_path)
end
end

Expand Down

0 comments on commit 1251d00

Please sign in to comment.