From 73dc05df9de6cf37e4574265e57103ab940f67a6 Mon Sep 17 00:00:00 2001 From: Petr Stepchenko Date: Mon, 18 Feb 2019 21:46:28 +0700 Subject: [PATCH] Add AzureRM to support authenticated_url --- lib/carrierwave/storage/fog.rb | 4 ++-- spec/storage/fog_helper.rb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/carrierwave/storage/fog.rb b/lib/carrierwave/storage/fog.rb index 863e6a130..5ec5c5266 100644 --- a/lib/carrierwave/storage/fog.rb +++ b/lib/carrierwave/storage/fog.rb @@ -177,7 +177,7 @@ def attributes ## # Return a temporary authenticated url to a private file, if available - # Only supported for AWS, Rackspace and Google providers + # Only supported for AWS, Rackspace, Google and AzureRM providers # # === Returns # @@ -186,7 +186,7 @@ def attributes # [NilClass] no authenticated url available # def authenticated_url(options = {}) - if ['AWS', 'Google', 'Rackspace', 'OpenStack'].include?(@uploader.fog_credentials[:provider]) + if ['AWS', 'Google', 'Rackspace', 'OpenStack', 'AzureRM'].include?(@uploader.fog_credentials[:provider]) # avoid a get by using local references local_directory = connection.directories.new(:key => @uploader.fog_directory) local_file = local_directory.files.new(:key => path) diff --git a/spec/storage/fog_helper.rb b/spec/storage/fog_helper.rb index f1d6da7cf..455698a6b 100644 --- a/spec/storage/fog_helper.rb +++ b/spec/storage/fog_helper.rb @@ -438,7 +438,7 @@ class FogSpec#{fog_credentials[:provider]}Uploader < CarrierWave::Uploader::Base end it "should have an authenticated_url" do - if ['AWS', 'Rackspace', 'Google', 'OpenStack'].include?(@provider) + if ['AWS', 'Rackspace', 'Google', 'OpenStack', 'AzureRM'].include?(@provider) expect(@fog_file.authenticated_url).not_to be_nil end end