Commit graph

286 commits

Author SHA1 Message Date
Evgeniy Kulikov
cfe2811efc Add owner field for ListObjects method
Signed-off-by: Evgeniy Kulikov <kim@nspcc.ru>
2020-08-22 05:43:53 +03:00
Evgeniy Kulikov
3244f54022 Change returned error for GetBucketInfo method
method should returns gRPC status errors

Signed-off-by: Evgeniy Kulikov <kim@nspcc.ru>
2020-08-22 05:43:06 +03:00
Evgeniy Kulikov
8eff7d4dd3 Refactoring DeleteObject/DeleteObjects methods
- methods should return api.DeleteErrors
- DeleteObjects should return only slice of errors
- don't add nil errors

Signed-off-by: Evgeniy Kulikov <kim@nspcc.ru>
2020-08-22 05:42:27 +03:00
Evgeniy Kulikov
960aa02bd3 Refactoring DeleteObject/DeleteObjects methods
- methods should return api.DeleteErrors
- DeleteObjects should return only slice of errors
- don't add nil errors

Signed-off-by: Evgeniy Kulikov <kim@nspcc.ru>
2020-08-22 05:41:58 +03:00
Evgeniy Kulikov
5eae2aac78 Change NotFound error for objectFindID
method should return gRPC status error

Signed-off-by: Evgeniy Kulikov <kim@nspcc.ru>
2020-08-22 05:39:12 +03:00
Evgeniy Kulikov
5258342881 Add Owner field into layer.ObjectInfo
Signed-off-by: Evgeniy Kulikov <kim@nspcc.ru>
2020-08-22 05:37:39 +03:00
Evgeniy Kulikov
d2d54cbdaa Refactoring getAPIErrorResponse method
should receive base error type instead of custom errors

Signed-off-by: Evgeniy Kulikov <kim@nspcc.ru>
2020-08-22 05:36:53 +03:00
Evgeniy Kulikov
0b533e189e Add custom http headers constants
Signed-off-by: Evgeniy Kulikov <kim@nspcc.ru>
2020-08-22 05:35:32 +03:00
Evgeniy Kulikov
f3b202700e Refactoring WriteErrorResponse method
- should receive error instead custom type
- change visibility of WriteResponse method

Signed-off-by: Evgeniy Kulikov <kim@nspcc.ru>
2020-08-22 05:34:50 +03:00
Evgeniy Kulikov
cd2cca8fb3 Change MimeTypes constants visibility
Signed-off-by: Evgeniy Kulikov <kim@nspcc.ru>
2020-08-22 05:32:48 +03:00
Evgeniy Kulikov
0bea843d90 Fix DeleteObject handler
DeleteObject should remove all objects with passed nice name

Signed-off-by: Evgeniy Kulikov <kim@nspcc.ru>
2020-08-20 22:41:52 +03:00
Evgeniy Kulikov
34f6eb7d55 Add note about multiple delete of objects
Could not find how to use it.
I propose open issue and describe how to use it and then implement method.

Signed-off-by: Evgeniy Kulikov <kim@nspcc.ru>
2020-08-20 22:35:39 +03:00
Evgeniy Kulikov
21591ebe65 Add method to find all ID's for the nice names
Signed-off-by: Evgeniy Kulikov <kim@nspcc.ru>
2020-08-20 22:33:59 +03:00
Evgeniy Kulikov
5bb2c34052 Cleanup unimplemented handlers
Signed-off-by: Evgeniy Kulikov <kim@nspcc.ru>
2020-08-20 02:37:06 +03:00
Evgeniy Kulikov
1d98c4ecc2 Implement GetObject handler
Signed-off-by: Evgeniy Kulikov <kim@nspcc.ru>
2020-08-20 02:36:46 +03:00
Evgeniy Kulikov
bfc4b8786f Implement HeadObject handler
Signed-off-by: Evgeniy Kulikov <kim@nspcc.ru>
2020-08-20 02:36:34 +03:00
Evgeniy Kulikov
9493f3d281 Implement PutObject handler
Signed-off-by: Evgeniy Kulikov <kim@nspcc.ru>
2020-08-20 02:36:17 +03:00
Evgeniy Kulikov
9746978b1d Implement DeleteObject handler
Signed-off-by: Evgeniy Kulikov <kim@nspcc.ru>
2020-08-20 02:36:00 +03:00
Evgeniy Kulikov
9ab0571d29 Implement CopyObject handler
Signed-off-by: Evgeniy Kulikov <kim@nspcc.ru>
2020-08-20 02:35:51 +03:00
Evgeniy Kulikov
c6d4b6d731 Implement MarshalXML for StringMap type
Signed-off-by: Evgeniy Kulikov <kim@nspcc.ru>
2020-08-20 02:34:47 +03:00
Evgeniy Kulikov
fb13d1fcb3 Move ListObjects and ListBuckets in same file
Signed-off-by: Evgeniy Kulikov <kim@nspcc.ru>
2020-08-20 02:33:43 +03:00
Evgeniy Kulikov
edd44ea981 Check that aws filename wasn't set
we should check that filename header wasn't set, otherwise we should not change custom filename

Signed-off-by: Evgeniy Kulikov <kim@nspcc.ru>
2020-08-20 02:32:42 +03:00
Evgeniy Kulikov
00a17d8316 CopyObject should contains custom headers
Signed-off-by: Evgeniy Kulikov <kim@nspcc.ru>
2020-08-20 02:31:04 +03:00
Evgeniy Kulikov
fb00af23fb Fixed possible NPE in PutObject
Signed-off-by: Evgeniy Kulikov <kim@nspcc.ru>
2020-08-20 02:30:18 +03:00
Evgeniy Kulikov
447a255d18 Add func to debug requests
- logging middleware
- response writer with status code

Signed-off-by: Evgeniy Kulikov <kim@nspcc.ru>
2020-08-20 02:28:16 +03:00
Evgeniy Kulikov
5df041f7d7 Add func to write headers only
Signed-off-by: Evgeniy Kulikov <kim@nspcc.ru>
2020-08-20 02:27:13 +03:00
Evgeniy Kulikov
cea8f9d4ca Add bucket info handler
Signed-off-by: Evgeniy Kulikov <kim@nspcc.ru>
2020-08-19 14:53:17 +03:00
Evgeniy Kulikov
92b039fa5e Add unsupported handlers
Signed-off-by: Evgeniy Kulikov <kim@nspcc.ru>
2020-08-19 14:52:44 +03:00
Evgeniy Kulikov
b14e2d54c8 Prepare list-objects handler
Signed-off-by: Evgeniy Kulikov <kim@nspcc.ru>
2020-08-11 17:37:20 +03:00
Evgeniy Kulikov
ccd481e4e2 Prepare list-buckets handler
Signed-off-by: Evgeniy Kulikov <kim@nspcc.ru>
2020-08-11 17:36:52 +03:00
Evgeniy Kulikov
d9f691a59a Refactoring API handlers
- add responses for list-objects and list-buckets
- set `implement me` errors more useful

Signed-off-by: Evgeniy Kulikov <kim@nspcc.ru>
2020-08-11 17:35:54 +03:00
Evgeniy Kulikov
b2a2b5478b Refactoring API
- api.Error should implement error interface
- add method that encodes the response into ResponseWriter

Signed-off-by: Evgeniy Kulikov <kim@nspcc.ru>
2020-08-11 17:34:06 +03:00
Evgeniy Kulikov
64429d736d Refactoring API layer
- logging RequestID
- should return error, when headers already received

Signed-off-by: Evgeniy Kulikov <kim@nspcc.ru>
2020-08-11 14:32:04 +03:00
Evgeniy Kulikov
59e26d45fd Refactoring API router
- method to fetch request id
- middleware to set request id and info
- fixes for getAPIErrorResponse (fix possible NPE)

Signed-off-by: Evgeniy Kulikov <kim@nspcc.ru>
2020-08-11 14:30:02 +03:00
Evgeniy Kulikov
26f1df2721 Refactoring request info
- simplify
- more usable

Signed-off-by: Evgeniy Kulikov <kim@nspcc.ru>
2020-08-11 14:27:31 +03:00
Evgeniy Kulikov
0161d2fbd3 [#13] Rename go module name according to NSPCC standards
- refactoring s3 gate structure
- cleanup unused code
- rename go module to `github.com/nspcc-dev/neofs-s3-gate`

closes #13

Signed-off-by: Evgeniy Kulikov <kim@nspcc.ru>
2020-08-06 15:02:13 +03:00