Commit Graph

184 Commits

Author SHA1 Message Date
Greg Karékinian 71d138894e Validate the Content-Type on PUT requests
Return a 415
(https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/415) when the
Content-Type does not look like a valid MIME type (in the type/subtype
format)

Refs #137
2020-04-15 13:49:33 +02:00
basti ab673f1d43 Merge pull request #134 from 5apps/feature/82-content_range_poc
Content-Range support
2020-01-08 14:53:10 -05:00
Greg Karékinian 1824766a03 Implement Range support for the Swift provider, with specs 2020-01-06 14:03:26 +01:00
Greg Karékinian 331fdbe1c7 Add specs for public resources, including getting partial content 2020-01-03 18:17:19 +01:00
Greg Karékinian 01927fd5ca Remove global expectations that were deprecated in minitest 5.12.0
They will be removed from minitest 6

Changelog:
https://github.com/seattlerb/minitest/blob/master/History.rdoc#5120--2019-09-22
2019-11-13 16:36:29 +01:00
Garret Alfert 394c802ec2 Fix spec
ETag is used from Redis metadata now, not from the storage server's
response.
2018-11-26 11:57:41 +01:00
Greg Karékinian d05cd4a760 Do not do an extra HEAD request after a PUT for Last-Modified
Use the Date header from a PUT request as the Last-Modified time that we
store in Redis
2018-07-18 19:37:05 +02:00
Greg Karékinian b4ad4c4793 Set the Content-Length on a HEAD requests
We get it as part of the Redis metadata

RFC: https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.13
2018-05-22 12:44:24 +02:00
Garret Alfert 533c9b6346 Set Content-type header on HEAD requests
Fixes #121
2018-05-22 11:59:55 +02:00
Greg Karékinian be33b0e195 Replace placeholder comment that I forgot to replace 2018-05-09 19:08:32 +02:00
Greg Karékinian df65190df8 Simply the request stubs, add comments
Remove the stubs that are not required, making everything easier to
understand
2018-05-09 18:42:04 +02:00
Greg Karékinian f14ef4dc21 Consider that the metadata has changed when the Last-Modified changes
Also adds a spec for it
2018-04-30 16:39:12 +02:00
Greg Karékinian ca0127d6a6 Rename the S3 provider to just S3 2018-04-30 15:46:18 +02:00
Greg Karékinian 5da0d0b5c3 Delete unused methods 2018-04-30 15:44:49 +02:00
Greg Karékinian 454f02dfaf Rename the spec root description 2018-04-30 15:44:28 +02:00
Greg Karékinian 21f3a9f60f Remove all duplication the specs
S3 and Swift now run the same specs. The only difference is the before
block that defines the stubbed HTTP requests and the responses from the
Swift and S3 servers
2018-04-26 13:17:43 +02:00
Greg Karékinian 21dad2aba7 Get the metadata from Redis on a HEAD request
No need to hit the storage backend, we can set the response headers from
the data in Redis
2018-04-26 13:17:43 +02:00
Greg Karékinian 7bd45543f6 Set headers from the Redis metadata on a GET that results in a 304
Also add specs to check for the response headers
2018-04-26 13:17:43 +02:00
Greg Karékinian f083022e6d Get the ETag from Redis on a GET request
This prevents doing a network request when we would return a 304 anyway
2018-04-26 13:17:43 +02:00
Greg Karékinian 86dc45f444 Add support for S3 through the REST API
This is currently using the old S3 authentication
(https://s3.amazonaws.com/doc/s3-developer-guide/RESTAuthentication.html),
in order to support Exoscale Storage

Refs #112
2018-04-26 13:17:43 +02:00
Greg Karékinian ac6bec48c4 Remove all Riak code and its dependencies
Closes #75
2018-04-16 11:54:32 +02:00
basti 60c508fba9 Add Last-Modified date to document items in listings
Not in RS spec draft yet, see https://github.com/remotestorage/spec/issues/158 for discussion.
2018-03-12 16:32:00 +02:00
Greg Karékinian fac033cff5 Use all keys from the config file's redis section in the specs
You can pass a db index, and the code was using it, but not the specs
2018-03-08 12:59:03 +01:00
Garret Alfert 18670021b1 Handle out of sync metadata in Redis on PUTs
When the IF-MATCH comparison fails, we check the actual metadata on
the Swift server to be sure.
2018-01-05 06:49:42 +01:00
Garret Alfert 24ae9ad893 Allow for weak ETAGs with leading quote
The remoteStorage client currently surrounds all ETAGs with quotes, so
instead of W\"etag" it looks like "W\"etag".
2018-01-03 22:06:03 +01:00
Garret Alfert 8ffd15bb61 Ignore weak ETAG prefix when comparing MATCH headers
Our metadata only contains the actual ETAG value, so we need
to use only that when comparing it.
2018-01-03 21:31:25 +01:00
Greg Karékinian b68c5d8409 Merge pull request #94 from 5apps/feature/86-respond_with_201_on_create
Respond with status 201 when creating new objects
2016-08-08 14:47:07 +02:00
Garret Alfert 7a8694fd55 Respond with status 201 when creating new objects
closes #86
2016-08-05 17:43:47 +02:00
Garret Alfert 5891cb9cf0 Make sure to delete existing metadata on DELETE
fixes #80
2016-08-05 17:17:59 +02:00
Greg Karékinian ad0ea12059 Return 401 when getting an empty bearer token
For example:

Authorization: Bearer

The cause of the empty bearer also needs to be investigated
2016-07-20 17:27:44 +02:00
Garret Alfert 995ba52886 Log user's storage size in Redis 2016-06-13 13:18:10 +02:00
Garret Alfert c1d60586ec Improve some spec wordings 2016-06-03 01:08:52 +02:00
Garret Alfert 28b6a7f22d Merge branch 'master' into feature/update_to_recent_rs_spec
# Conflicts:
#	spec/swift/app_spec.rb
2016-06-02 22:21:16 +02:00
Garret Alfert a349db5243 Spec for directory listing of non-existing directories 2016-06-02 18:57:40 +02:00
Garret Alfert 576e4a9afb Specs for response headers on GET requests 2016-06-02 18:57:37 +02:00
Garret Alfert 16e51038b1 Send ETag of deleted item in header 2016-06-02 18:56:45 +02:00
Garret Alfert ed8061b594 Use content type "application/ld+json" for directory listings 2016-06-02 18:54:47 +02:00
Garret Alfert c897959029 Send "Precondition Failed" message body with 412 responses 2016-06-02 18:49:44 +02:00
Garret Alfert cc91b5c4cd Send "Not Found" message body with 404 responses (refs #42) 2016-06-02 13:19:06 +02:00
Garret Alfert 83d8f29a04 Send "Conflict" message body with 409 responses (closes #409) 2016-06-02 13:18:59 +02:00
Garret Alfert 9a9a9c79e5 Send "Unauthorized" message body with 401 responses (refs #42) 2016-06-02 13:18:51 +02:00
Garret Alfert df87deaf0b Don't fail when order of array is different 2016-03-04 22:48:50 +01:00
Garret Alfert 648f86e0f3 Fix typo in specs 2016-03-04 22:40:04 +01:00
Garret Alfert 1d39445ba9 Fix deleting metadata for empty subdirectories 2016-03-04 22:17:33 +01:00
Garret Alfert 5378826c6a Also use content checksum for ETag calculation
Timestamp is not enough, as it might be the same
for two consequent PUTs.
2016-03-04 22:17:25 +01:00
Garret Alfert 3590b7dedc Determine correct metadata key for objects in root dir 2016-03-04 20:47:41 +01:00
Garret Alfert 43ff83d26b Don't allow PUTS with Content-Range header 2016-03-04 19:33:00 +01:00
Garret Alfert fd3293025d ETags are quoted, doh 2016-03-04 19:32:36 +01:00
Garret Alfert d08bc45489 Don't use or create any directory objects in Swift 2016-03-04 15:33:28 +01:00
Garret Alfert 9b7b224f79 Use more explicit key name for items 2016-03-02 18:06:42 +01:00