Merge pull request #5233 from betagouv/dev

2020-06-04-03
This commit is contained in:
krichtof 2020-06-04 17:43:51 +02:00 committed by GitHub
commit c9d886e6b2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -16,7 +16,31 @@ end
# this url and replace the host with DS_Proxy host. This way all the operation # this url and replace the host with DS_Proxy host. This way all the operation
# are performed through DS_Proxy. # are performed through DS_Proxy.
# #
# https://github.com/fog/fog-openstack/blob/79116756ab04058a4bd970f3f1944886210221ed/lib/fog/openstack/auth/catalog/v3.rb#L16 # https://github.com/fog/fog-openstack/blob/37621bb1d5ca78d037b3c56bd307f93bba022ae1/lib/fog/openstack/auth/catalog/v2.rb#L16
require 'fog/openstack/auth/catalog/v2'
module Fog::OpenStack::Auth::Catalog
class V2
def endpoint_url(endpoint, interface)
url = endpoint["#{interface}URL"]
if interface == 'public'
publicize(url)
else
url
end
end
private
def publicize(url)
search = %r{^https://[^/]+/}
replace = "#{ENV['DS_PROXY_URL']}/"
url.gsub(search, replace)
end
end
end
require 'fog/openstack/auth/catalog/v3' require 'fog/openstack/auth/catalog/v3'
module Fog::OpenStack::Auth::Catalog module Fog::OpenStack::Auth::Catalog
class V3 class V3