diff options
author | George Claghorn <george@basecamp.com> | 2018-03-12 21:54:54 -0400 |
---|---|---|
committer | George Claghorn <george@basecamp.com> | 2018-03-12 23:14:20 -0400 |
commit | fcbe17137db2ae074cc2592f7498366e313f0d9f (patch) | |
tree | c6237789d044ec4503ed68c09bd5f2b00269b690 | |
parent | a061ae91a90a1fbd909f647dcd219af197bd30a9 (diff) | |
download | rails-fcbe17137db2ae074cc2592f7498366e313f0d9f.tar.gz rails-fcbe17137db2ae074cc2592f7498366e313f0d9f.tar.bz2 rails-fcbe17137db2ae074cc2592f7498366e313f0d9f.zip |
Fix Azure signed URL generation with newer client lib
-rw-r--r-- | .travis.yml | 77 | ||||
-rw-r--r-- | activestorage/lib/active_storage/service/azure_storage_service.rb | 10 |
2 files changed, 5 insertions, 82 deletions
diff --git a/.travis.yml b/.travis.yml index 1c67c1475c..340cf5688c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -47,83 +47,8 @@ before_script: script: 'ci/travis.rb' env: - global: - - "JRUBY_OPTS='--dev -J-Xmx1024M'" matrix: - - "GEM=railties" - - "GEM=ap,ac" - - "GEM=am,amo,as,av,aj,ast" - - "GEM=as PRESERVE_TIMEZONES=1" - - "GEM=ar:mysql2" - - "GEM=ar:sqlite3" - - "GEM=ar:postgresql" - - "GEM=guides" - - "GEM=ac:integration" + - "GEM=ast" rvm: - - 2.4.3 - 2.5.0 - - ruby-head - -matrix: - include: - - rvm: 2.5.0 - env: "GEM=av:ujs" - - rvm: 2.4.3 - env: "GEM=aj:integration" - services: - - memcached - - redis-server - - rabbitmq - - rvm: 2.5.0 - env: "GEM=aj:integration" - services: - - memcached - - redis-server - - rabbitmq - - rvm: ruby-head - env: "GEM=aj:integration" - services: - - memcached - - redis-server - - rabbitmq - - rvm: 2.5.0 - env: - - "GEM=ar:mysql2 MYSQL=mariadb" - addons: - mariadb: 10.2 - - rvm: 2.5.0 - env: - - "GEM=ar:sqlite3_mem" - - rvm: 2.5.0 - env: - - "GEM=ar:postgresql POSTGRES=9.2" - addons: - postgresql: "9.2" - - rvm: jruby-head - jdk: oraclejdk8 - env: - - "GEM=ap" - - rvm: jruby-head - jdk: oraclejdk8 - env: - - "GEM=am,amo,aj" - allow_failures: - - rvm: ruby-head - - rvm: jruby-head - - env: "GEM=ac:integration" - fast_finish: true - -notifications: - email: false - irc: - on_success: change - on_failure: always - channels: - # "irc.freenode.org#rails-contrib" - - secure: "QFKSOK7xQiWWqTzYfYm0XWoW7idzuxT57MBW9i9EASyRLEPuDwZEubKRP40Y7wPx7ylQd9lp6kJheeLnrDvvTjFbW3sWv9GDRl4WlOU8sG/Kv7MXAASXlDqzyJxxXTtzLeXz2iwY296kOBuKxKxl923eTvEGeocwH02QGo14LpQ=" - campfire: - on_success: change - on_failure: always - rooms: - - secure: "YA1alef1ESHWGFNVwvmVGCkMe4cUy4j+UcNvMUESraceiAfVyRMAovlQBGs6\n9kBRm7DHYBUXYC2ABQoJbQRLDr/1B5JPf/M8+Qd7BKu8tcDC03U01SMHFLpO\naOs/HLXcDxtnnpL07tGVsm0zhMc5N8tq4/L3SHxK7Vi+TacwQzI=" diff --git a/activestorage/lib/active_storage/service/azure_storage_service.rb b/activestorage/lib/active_storage/service/azure_storage_service.rb index ff6b2be135..2867a4e441 100644 --- a/activestorage/lib/active_storage/service/azure_storage_service.rb +++ b/activestorage/lib/active_storage/service/azure_storage_service.rb @@ -83,9 +83,8 @@ module ActiveStorage def url(key, expires_in:, filename:, disposition:, content_type:) instrument :url, key: key do |payload| - base_url = url_for(key) generated_url = signer.signed_uri( - URI(base_url), false, + uri_for(key), false, service: "b", permissions: "r", expiry: format_expiry(expires_in), @@ -101,9 +100,8 @@ module ActiveStorage def url_for_direct_upload(key, expires_in:, content_type:, content_length:, checksum:) instrument :url, key: key do |payload| - base_url = url_for(key) generated_url = signer.signed_uri( - URI(base_url), false, + uri_for(key), false, service: "b", permissions: "rw", expiry: format_expiry(expires_in) @@ -120,8 +118,8 @@ module ActiveStorage end private - def url_for(key) - "#{blobs.host}/#{container}/#{key}" + def uri_for(key) + blobs.generate_uri("#{container}/#{key}") end def blob_for(key) |