aboutsummaryrefslogtreecommitdiff
path: root/src/api/api_server.rs
Commit message (Collapse)AuthorAgeFilesLines
* Support for PostObject (#222)trinity-1686a2022-02-211-5/+10
| | | | | | | | | | | | | | | | | | Add support for [PostObject](https://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectPOST.html) - [x] routing PostObject properly - [x] parsing multipart body - [x] validating signature - [x] validating policy - [x] validating content length - [x] actually saving data Co-authored-by: trinity-1686a <trinity@deuxfleurs.fr> Co-authored-by: Trinity Pointard <trinity.pointard@gmail.com> Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/222 Reviewed-by: Alex <alex@adnab.me> Co-authored-by: trinity-1686a <trinity.pointard@gmail.com> Co-committed-by: trinity-1686a <trinity.pointard@gmail.com>
* Multipart improvementsAlex Auvolat2022-01-241-2/+6
| | | | | - support part_number for HeadObject - add checks in complete_multipart_upload
* Handle OPTIONS on website endpointbucket-corsAlex Auvolat2022-01-241-3/+3
|
* Implement {Put,Get,Delete}BucketCors and CORS in generalAlex Auvolat2022-01-241-5/+37
| | | | | | - OPTIONS request against API endpoint - Returning corresponding CORS headers on API calls - Returning corresponding CORS headers on website GET's
* use clamp instead of min(max())Trinity Pointard2022-01-241-4/+3
|
* Implement ListPartsQuentin Dufour2022-01-211-0/+19
|
* Add date verification to presigned urls (#196)trinity-1686a2022-01-181-0/+3
| | | | | | | | | | fix #96 fix #162 by returning Forbidden instead Bad Request Co-authored-by: Trinity Pointard <trinity.pointard@gmail.com> Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/196 Co-authored-by: trinity-1686a <trinity.pointard@gmail.com> Co-committed-by: trinity-1686a <trinity.pointard@gmail.com>
* refactor s3_router and api_server to make unused Endpoint parameters more ↵trinity-1686a2022-01-171-40/+29
| | | | obvious
* Support STREAMING-AWS4-HMAC-SHA256-PAYLOAD (#64) (#156)Jill2022-01-171-3/+3
| | | | | | | | Closes #64. Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/156 Co-authored-by: Jill <kokakiwi@deuxfleurs.fr> Co-committed-by: Jill <kokakiwi@deuxfleurs.fr>
* Implement GetBucketWebsiteAlex Auvolat2022-01-131-0/+1
|
* Implement UploadPartCopyAlex Auvolat2022-01-131-15/+20
|
* Implement ListMultipartUploads (#171)Quentin2022-01-121-12/+43
| | | | | | | | | | | | | | | | | | | | | | | Implement ListMultipartUploads, also refactor ListObjects and ListObjectsV2. It took me some times as I wanted to propose the following things: - Using an iterator instead of the loop+goto pattern. I find it easier to read and it should enable some optimizations. For example, when consuming keys of a common prefix, we do many [redundant checks](https://git.deuxfleurs.fr/Deuxfleurs/garage/src/branch/main/src/api/s3_list.rs#L125-L156) while the only thing to do is to [check if the following key is still part of the common prefix](https://git.deuxfleurs.fr/Deuxfleurs/garage/src/branch/feature/s3-multipart-compat/src/api/s3_list.rs#L476). - Try to name things (see ExtractionResult and RangeBegin enums) and to separate concerns (see ListQuery and Accumulator) - An IO closure to make unit tests possibles. - Unit tests, to track regressions and document how to interact with the code - Integration tests with `s3api`. In the future, I would like to move them in Rust with the aws rust SDK. Merging of the logic of ListMultipartUploads and ListObjects was not a goal but a consequence of the previous modifications. Some points that we might want to discuss: - ListObjectsV1, when using pagination and delimiters, has a weird behavior (it lists multiple times the same prefix) with `aws s3api` due to the fact that it can not use our optimization to skip the whole prefix. It is independant from my refactor and can be tested with the commented `s3api` tests in `test-smoke.sh`. It probably has the same weird behavior on the official AWS S3 implementation. - Considering ListMultipartUploads, I had to "abuse" upload id marker to support prefix skipping. I send an `upload-id-marker` with the hardcoded value `include` to emulate your "including" token. - Some ways to test ListMultipartUploads with existing software (my tests are limited to s3api for now). Co-authored-by: Quentin Dufour <quentin@deuxfleurs.fr> Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/171 Co-authored-by: Quentin <quentin@dufour.io> Co-committed-by: Quentin <quentin@dufour.io>
* Fix some error codesAlex Auvolat2022-01-051-1/+2
|
* Implement DeleteBucketAlex Auvolat2022-01-051-3/+4
|
* Implement CreateBucketAlex Auvolat2022-01-051-14/+7
|
* New buckets for 0.6.0: small changesAlex Auvolat2022-01-041-3/+1
| | | | | | | | | | | | - Fix bucket delete - fix merge of bucket creation date - Replace deletable with option in aliases Rationale: if two aliases point to conflicting bucket, resolving by making an arbitrary choice risks making data accessible when it shouldn't be. We'd rather resolve to deleting the alias until someone puts it back.
* New buckets for 0.6.0: small fixes, including:Alex Auvolat2022-01-041-5/+3
| | | | | | | | - ensure bucket names are correct aws s3 names - when making aliases, ensure timestamps of links in both ways are the same - fix small remarks by trinity - don't have a separate website_access field
* Model changesAlex Auvolat2022-01-041-3/+3
|
* New model for bucketsAlex Auvolat2022-01-041-26/+83
|
* BucketWebsite (#174)trinity-1686a2021-12-151-0/+5
| | | | | | | | | | | fix #77 this does not store anything but a on/off switch for website, and does not implement GetBucketWebsite as it would require storing more. GetBucketWebsite should be pretty easy to implement once data is stored though. Co-authored-by: Trinity Pointard <trinity.pointard@gmail.com> Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/174 Co-authored-by: trinity-1686a <trinity.pointard@gmail.com> Co-committed-by: trinity-1686a <trinity.pointard@gmail.com>
* add proper request router for s3 api (#163)trinity-1686a2021-12-061-151/+141
| | | | | | | | | | | | | fix #161 Current request router was organically grown, and is getting messier and messier with each addition. This router cover exaustively existing API endpoints (with exceptions listed in [#161(comment)](https://git.deuxfleurs.fr/Deuxfleurs/garage/issues/161#issuecomment-1773) either because new and old api endpoint can't feasabily be differentied, or it's more lambda than s3). Co-authored-by: Trinity Pointard <trinity.pointard@gmail.com> Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/163 Reviewed-by: Alex <alex@adnab.me> Co-authored-by: trinity-1686a <trinity.pointard@gmail.com> Co-committed-by: trinity-1686a <trinity.pointard@gmail.com>
* Improved handling of HTTP rangestrinity-1686a2021-11-291-3/+8
| | | | | | | | | | | - correct HTTP code when range syntax is invalid (fix #140) - when multiple ranges are given, simply ignore and send whole file Co-authored-by: Trinity Pointard <trinity.pointard@gmail.com> Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/157 Reviewed-by: Alex <alex@adnab.me> Co-authored-by: trinity-1686a <trinity.pointard@gmail.com> Co-committed-by: trinity-1686a <trinity.pointard@gmail.com>
* update doc and commentsTrinity Pointard2021-11-161-1/+2
|
* clippyTrinity Pointard2021-11-161-1/+1
|
* fix issue where list on vhost-bucket would list bucket instead of bucket contentTrinity Pointard2021-11-161-73/+29
|
* add support for vhost-style s3 bucketTrinity Pointard2021-11-161-9/+101
|
* Fix clippy lints (fix #121)Alex Auvolat2021-10-261-19/+16
|
* Add basic support for the "Versioning" commandQuentin Dufour2021-05-141-0/+3
|
* fix clippy warnings on apiTrinity Pointard2021-05-031-24/+24
|
* S3 API: support ListBucketsQuentin Dufour2021-05-031-2/+4
|
* Many S3 compatibility improvements:v0.2.1.5Alex Auvolat2021-04-281-8/+18
| | | | | | | | - return XML errors - implement AuthorizationHeaderMalformed error to redirect clients to correct location (used by minio client) - implement GetBucketLocation - fix DeleteObjects XML parsing and response
* document api crateTrinity Pointard2021-04-271-0/+1
|
* add support for caching headersTrinity Pointard2021-03-181-1/+1
|
* Time and metadata improvementsAlex Auvolat2021-03-151-1/+4
|
* Cargo fmtAlex Auvolat2021-02-231-3/+8
|
* More precise logging (warn only when returning a 500)Alex Auvolat2021-02-201-1/+5
|
* Add verification of part numbers in CompleteMultipartUpload (WIP #30)Alex Auvolat2021-02-201-2/+2
|
* Add compatibility listAlex Auvolat2021-02-191-1/+1
|
* Implement ListObjectsV2Alex Auvolat2021-02-191-24/+2
|
* Fix S3 ListObjects result and replace println!s by debug!s0.1.1bAlex Auvolat2021-01-161-2/+2
|
* Refactor error management in API parterror-refactoringAlex Auvolat2020-11-081-11/+8
|
* Modif parse_bucket_key to fail when bucket is ""feature/unit-testsAlex Auvolat2020-11-081-10/+19
|
* Add a second testQuentin2020-11-071-1/+12
|
* Fix formattingQuentin2020-11-071-2/+2
|
* Add a test for parse_bucket_keyQuentin2020-11-071-0/+17
|
* Validate content MD5 and SHA256 sums for PutObject and UploadPartAlex Auvolat2020-07-151-3/+12
|
* Apply cargo fmt; add trace output when request signature is badAlex Auvolat2020-07-081-4/+1
|
* Update to Hyper 0.13.6 that accepts non-Sync streams in wrap_stream.Alex Auvolat2020-07-071-6/+5
| | | | Simplifies code and makes it possible to publish on crates.io
* Rename garage_core to garage_modelAlex Auvolat2020-07-071-1/+1
|
* Implement HTTP ranges in getAlex Auvolat2020-05-041-21/+18
|