Commit 4804b612 authored by Kamil Trzciński's avatar Kamil Trzciński

Rename ObjectStore to RemoteObject

parent 1b494305
......@@ -153,7 +153,7 @@ module ObjectStorage
def workhorse_authorize
if options = workhorse_remote_upload_options
{ ObjectStore: options }
{ RemoteStore: options }
else
{ TempPath: workhorse_local_upload_path }
end
......@@ -174,7 +174,7 @@ module ObjectStorage
options = { 'Content-Type' => 'application/octet-stream' }
{
ObjectID: id,
ID: id,
GetURL: connection.get_object_https_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)
......
......@@ -401,21 +401,21 @@ describe ObjectStorage do
end
it "does not return remote store" do
is_expected.not_to have_key('ObjectStore')
is_expected.not_to have_key('RemoteStore')
end
end
shared_examples 'uses remote storage' do
it "returns remote store" do
is_expected.to have_key(:ObjectStore)
is_expected.to have_key(:RemoteStore)
expect(subject[:ObjectStore]).to have_key(:ObjectID)
expect(subject[:ObjectStore]).to have_key(:GetURL)
expect(subject[:ObjectStore]).to have_key(:DeleteURL)
expect(subject[:ObjectStore]).to have_key(:StoreURL)
expect(subject[:ObjectStore][:GetURL]).to include(described_class::TMP_UPLOAD_PATH)
expect(subject[:ObjectStore][:DeleteURL]).to include(described_class::TMP_UPLOAD_PATH)
expect(subject[:ObjectStore][:StoreURL]).to include(described_class::TMP_UPLOAD_PATH)
expect(subject[:RemoteStore]).to have_key(:ID)
expect(subject[:RemoteStore]).to have_key(:GetURL)
expect(subject[:RemoteStore]).to have_key(:DeleteURL)
expect(subject[:RemoteStore]).to have_key(:StoreURL)
expect(subject[:RemoteStore][:GetURL]).to include(described_class::TMP_UPLOAD_PATH)
expect(subject[:RemoteStore][:DeleteURL]).to include(described_class::TMP_UPLOAD_PATH)
expect(subject[:RemoteStore][:StoreURL]).to include(described_class::TMP_UPLOAD_PATH)
end
it "does not return local store" do
......@@ -455,9 +455,9 @@ describe ObjectStorage do
let(:storage_url) { "https://uploads.s3-eu-central-1.amazonaws.com/" }
it 'returns links for S3' do
expect(subject[:ObjectStore][:GetURL]).to start_with(storage_url)
expect(subject[:ObjectStore][:DeleteURL]).to start_with(storage_url)
expect(subject[:ObjectStore][:StoreURL]).to start_with(storage_url)
expect(subject[:RemoteStore][:GetURL]).to start_with(storage_url)
expect(subject[:RemoteStore][:DeleteURL]).to start_with(storage_url)
expect(subject[:RemoteStore][:StoreURL]).to start_with(storage_url)
end
end
end
......@@ -475,9 +475,9 @@ describe ObjectStorage do
let(:storage_url) { "https://storage.googleapis.com/uploads/" }
it 'returns links for Google Cloud' do
expect(subject[:ObjectStore][:GetURL]).to start_with(storage_url)
expect(subject[:ObjectStore][:DeleteURL]).to start_with(storage_url)
expect(subject[:ObjectStore][:StoreURL]).to start_with(storage_url)
expect(subject[:RemoteStore][:GetURL]).to start_with(storage_url)
expect(subject[:RemoteStore][:DeleteURL]).to start_with(storage_url)
expect(subject[:RemoteStore][:StoreURL]).to start_with(storage_url)
end
end
end
......
......@@ -1008,7 +1008,7 @@ describe 'Git LFS API and storage' do
it_behaves_like 'a valid response' do
it 'responds with status 200, location of lfs store and object details' do
expect(json_response['TempPath']).to eq(LfsObjectUploader.workhorse_local_upload_path)
expect(json_response['ObjectStore']).to be_nil
expect(json_response['RemoteStore']).to be_nil
expect(json_response['LfsOid']).to eq(sample_oid)
expect(json_response['LfsSize']).to eq(sample_size)
end
......@@ -1028,10 +1028,10 @@ describe 'Git LFS API and storage' do
it_behaves_like 'a valid response' do
it 'responds with status 200, location of lfs remote store and object details' do
expect(json_response['TempPath']).to be_nil
expect(json_response['ObjectStore']).to have_key('ObjectID')
expect(json_response['ObjectStore']).to have_key('GetURL')
expect(json_response['ObjectStore']).to have_key('StoreURL')
expect(json_response['ObjectStore']).to have_key('DeleteURL')
expect(json_response['RemoteStore']).to have_key('ID')
expect(json_response['RemoteStore']).to have_key('GetURL')
expect(json_response['RemoteStore']).to have_key('StoreURL')
expect(json_response['RemoteStore']).to have_key('DeleteURL')
expect(json_response['LfsOid']).to eq(sample_oid)
expect(json_response['LfsSize']).to eq(sample_size)
end
......
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