Commit 3b5ec230 authored by Alessio Caiazza's avatar Alessio Caiazza

Respect user configured schema when generating object storage URLs

When generating S3 compatible URLs we should respect user configuration in
`congig/gitlab.yml`; In GDK we are using local minio over HTTP.
parent 5cf4da85
......@@ -109,7 +109,7 @@ gem 'dropzonejs-rails', '~> 0.7.1'
# for backups
gem 'fog-aws', '~> 2.0'
gem 'fog-core', '~> 1.44'
gem 'fog-google', '~> 1.3'
gem 'fog-google', '~> 1.3.2'
gem 'fog-local', '~> 0.3'
gem 'fog-openstack', '~> 0.1'
gem 'fog-rackspace', '~> 0.1.1'
......
......@@ -266,7 +266,7 @@ GEM
builder
excon (~> 0.58)
formatador (~> 0.2)
fog-google (1.3.0)
fog-google (1.3.2)
fog-core
fog-json
fog-xml
......@@ -442,7 +442,7 @@ GEM
httparty (0.13.7)
json (~> 1.8)
multi_xml (>= 0.5.2)
httpclient (2.8.2)
httpclient (2.8.3)
i18n (0.9.1)
concurrent-ruby (~> 1.0)
ice_nine (0.11.2)
......@@ -1085,7 +1085,7 @@ DEPENDENCIES
fog-aliyun (~> 0.2.0)
fog-aws (~> 2.0)
fog-core (~> 1.44)
fog-google (~> 1.3)
fog-google (~> 1.3.2)
fog-local (~> 0.3)
fog-openstack (~> 0.1)
fog-rackspace (~> 0.1.1)
......
......@@ -183,7 +183,7 @@ module ObjectStorage
{
ID: id,
GetURL: connection.get_object_https_url(remote_store_path, upload_path, expire_at),
GetURL: connection.get_object_url(remote_store_path, upload_path, expire_at),
DeleteURL: connection.delete_object_url(remote_store_path, upload_path, expire_at),
StoreURL: connection.put_object_url(remote_store_path, upload_path, expire_at, options)
}
......
---
title: Generate ObjectStorage URL based on user provided schema
merge_request: 4932
author:
type: fixed
......@@ -481,6 +481,29 @@ describe ObjectStorage do
end
end
end
context 'uses GDK/minio' do
before do
expect(uploader_class).to receive(:object_store_credentials) do
{ provider: "AWS",
aws_access_key_id: "AWS_ACCESS_KEY_ID",
aws_secret_access_key: "AWS_SECRET_ACCESS_KEY",
endpoint: 'http://127.0.0.1:9000',
path_style: true,
region: "gdk" }
end
end
it_behaves_like 'uses remote storage' do
let(:storage_url) { "http://127.0.0.1:9000/uploads/" }
it 'returns links for S3' do
expect(subject[:RemoteObject][:GetURL]).to start_with(storage_url)
expect(subject[:RemoteObject][:DeleteURL]).to start_with(storage_url)
expect(subject[:RemoteObject][:StoreURL]).to start_with(storage_url)
end
end
end
end
context 'when direct upload is disabled' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment