Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for S3 through the REST API #118

Merged
merged 21 commits into from
May 11, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
86dc45f
Add support for S3 through the REST API
gregkare Apr 26, 2018
f083022
Get the ETag from Redis on a GET request
gregkare Apr 16, 2018
7bd4554
Set headers from the Redis metadata on a GET that results in a 304
gregkare Apr 16, 2018
21dad2a
Get the metadata from Redis on a HEAD request
gregkare Apr 16, 2018
21f3a9f
Remove all duplication the specs
gregkare Apr 19, 2018
b00fc5b
Reverse the not found logic in the delete_data method to make it clearer
gregkare Apr 30, 2018
3b72b8d
Pass the headers to the set_response_headers directly, not the response
gregkare Apr 30, 2018
97cd5ec
Move a comment to the relevant line
gregkare Apr 30, 2018
1532a23
Reorder the argument in authorization_headers_for
gregkare Apr 30, 2018
454f02d
Rename the spec root description
gregkare Apr 30, 2018
5da0d0b
Delete unused methods
gregkare Apr 30, 2018
ca0127d
Rename the S3 provider to just S3
gregkare Apr 30, 2018
f14ef4d
Consider that the metadata has changed when the Last-Modified changes
gregkare Apr 30, 2018
a922867
Uncomment the development config in the examples
gregkare Apr 30, 2018
d0a28c7
Remove useless comments and remove duplicate section in the example c…
gregkare May 9, 2018
0ec76c8
Fix coding style for a hash
gregkare May 9, 2018
709f635
Rewrite to avoid long lines
gregkare May 9, 2018
639c372
Refactor the put_request method to have a return value
gregkare May 9, 2018
c0d88f1
Run Travis builds on the Docker infrastructure
gregkare May 9, 2018
df65190
Simply the request stubs, add comments
gregkare May 9, 2018
be33b0e
Replace placeholder comment that I forgot to replace
gregkare May 9, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@ rvm:
- 2.4.1
services:
- redis-server
before_install:
- gem install bundler
before_script:
- cp config.yml.example config.yml
- cp config.yml.example.$BACKEND config.yml
- mkdir -p tmp && echo "swifttoken" > tmp/swift_token.txt
script: ruby spec/swift/*
script: ruby spec/$BACKEND/*
branches:
only:
- master
Expand All @@ -21,3 +19,8 @@ notifications:
- http://hook-juggler.herokuapp.com/hooks/travis
on_success: always
on_failure: always
env:
- BACKEND=s3
- BACKEND=swift
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't the second one overwriting the first one here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's setting a build matrix, creating one build for the s3 backend and one for the swift backend

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I see. Didn't read that far in their docs.

# Run on Docker infrastructure
sudo: false
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ group :test do
gem 'purdytest', :require => false
gem 'm'
gem 'minitest-stub_any_instance'
gem 'webmock'
end

group :staging, :production do
Expand Down
12 changes: 12 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,17 @@ GEM
i18n (>= 0.7, < 2)
minitest (~> 5.1)
tzinfo (~> 1.1)
addressable (2.5.2)
public_suffix (>= 2.0.2, < 4.0)
backports (3.11.2)
concurrent-ruby (1.0.5)
crack (0.4.3)
safe_yaml (~> 1.0.0)
domain_name (0.5.20170404)
unf (>= 0.0.5, < 1.0.0)
faraday (0.14.0)
multipart-post (>= 1.2, < 3)
hashdiff (0.3.7)
http-accept (1.7.0)
http-cookie (1.0.3)
domain_name (~> 0.5)
Expand All @@ -31,6 +36,7 @@ GEM
multipart-post (2.0.0)
mustermann (1.0.2)
netrc (0.11.0)
public_suffix (3.0.2)
purdytest (2.0.0)
minitest (~> 5.5)
rack (2.0.4)
Expand All @@ -50,6 +56,7 @@ GEM
http-cookie (>= 1.0.2, < 2.0)
mime-types (>= 1.16, < 4.0)
netrc (~> 0.8)
safe_yaml (1.0.4)
sentry-raven (2.7.2)
faraday (>= 0.7.6, < 1.0)
sinatra (2.0.1)
Expand All @@ -74,6 +81,10 @@ GEM
unicorn (5.4.0)
kgio (~> 2.6)
raindrops (~> 0.7)
webmock (3.3.0)
addressable (>= 2.3.6)
crack (>= 0.3.2)
hashdiff

PLATFORMS
ruby
Expand All @@ -92,6 +103,7 @@ DEPENDENCIES
sentry-raven
sinatra
sinatra-contrib
webmock

BUNDLED WITH
1.16.0
26 changes: 26 additions & 0 deletions config.yml.example.s3
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
development: &defaults
maintenance: false
s3:
endpoint: "https://some-endpoint"
region: "region"
access_key_id: ""
secret_key_id: ""
bucket: "test-bucket"
redis:
host: localhost
port: 6379

test:
<<: *defaults
s3:
endpoint: "https://some-endpoint"
region: "region"
access_key_id: ""
secret_key_id: ""
bucket: "test-bucket"

staging:
<<: *defaults

production:
<<: *defaults
15 changes: 5 additions & 10 deletions config.yml.example → config.yml.example.swift
Original file line number Diff line number Diff line change
@@ -1,20 +1,15 @@
development: &defaults
maintenance: false
# # uncomment this section
# swift: &swift_defaults
# host: "https://swift.example.com"
# # Redis is needed for the swift backend
# redis:
# host: localhost
# port: 6379
swift: &swift_defaults
host: "https://swift.example.com"
redis:
host: localhost
port: 6379

test:
<<: *defaults
swift:
host: "https://swift.example.com"
redis:
host: localhost
port: 6379

staging:
<<: *defaults
Expand Down
Loading