Commit Graph

35 Commits

Author SHA1 Message Date
slasher
5c7898354f style(all): format all codes with golangci tools
closes #3371

@formatter:off

Signed-off-by: slasher <shenjie1@oppo.com>
2024-05-14 09:54:13 +08:00
slasher
1d84f74acd chore(format): format all code with gofumpt
Signed-off-by: slasher <shenjie1@oppo.com>
2024-01-12 14:21:16 +08:00
zhaochenyang
4566e8810e feat(ci): add sast tools gosec and semgrep
Signed-off-by: zhaochenyang <zhaochenyang@oppo.com>
2023-12-06 17:05:54 +08:00
yhjiango
c8e92fb0f0 feat(objectnode): support local and external audit log
Signed-off-by: yhjiango <jiangyunhua@oppo.com>
2023-11-01 14:46:14 +08:00
tangdeyi
dd46c24873 fix(objectnode): fix read body entirely into memory and without an upper boundary
Signed-off-by: tangdeyi <tangdeyi@oppo.com>
2023-10-20 17:06:26 +08:00
tangdeyi
14f0f67c73 feat(objnode): s3 api qos
Signed-off-by: tangdeyi <tangdeyi@oppo.com>
2023-08-31 16:36:14 +08:00
yhjiango
4401624f96 feat(objectnode): s3 sts and signature auth
1. sts federation token
2. signature auth code refactor

Signed-off-by: yhjiango <jiangyunhua@oppo.com>
2023-08-30 20:05:32 +08:00
tangdeyi
d11e9142a2 feat(objectnode): object lock
Signed-off-by: tangdeyi <tangdeyi@oppo.com>
2023-08-30 20:05:32 +08:00
tangdeyi
3eddf3e623 fix(objectnode): Options CORS
Signed-off-by: tangdeyi <tangdeyi@oppo.com>
2023-05-18 10:48:57 +08:00
tangdeyi
831ea00d5d fix(objectnode): enhance s3 compatibility
1.CORS supports preflight request;
2.S3-compatible err reply;
3.Small parts upload bugfix;
4.Specific status code when panic;
5.UploadPartCopy;

Signed-off-by: tangdeyi <tangdeyi@oppo.com>
2023-05-18 10:48:57 +08:00
Patrick Wu
c8bf55ae69 S3 bugfix
Signed-off-by: Patrick Wu <wuchunhuan@oppo.com>
2023-03-04 16:13:35 +08:00
leonrayang
9a30b9f884 update: update to CubeFS
Signed-off-by: leonrayang <chl696@sina.com>
2022-08-22 18:16:09 +08:00
Mofei Zhang
fb9750c480 Fix: key encoding issue of S3 ListObjects API.
Parse parameter 'encoding-type' from request. It this parameter
specified and match with 'url', then encode content keys by using url
encoding function.

Signed-off-by: Mofei Zhang <mofei2816@gmail.com>
2020-09-27 18:20:27 +08:00
yuboLee
ce4f466f0f Fix: some bugs about object tagging and bucket tagging
Signed-off-by: yuboLee <pangbolee@gmail.com>
2020-07-10 12:17:40 +08:00
yuboLee
37b5aa3ede Fix: ListBuckets and headBucket result is empty using java sdk
Signed-off-by: yuboLee <pangbolee@gmail.com>
2020-07-07 15:37:33 +08:00
yuboLee
fcc3fadc80
Merge branch 'master' into fix_list_multiuploads 2020-06-02 08:53:16 +08:00
yuboLee
41ae6707a5 Fix: fix the bug of listing multipart uploads, and add check for request part info
Enhancement: add test case for listMultipartUploads and copyObject

Signed-off-by: yuboLee <pangbolee@gmail.com>
2020-06-01 17:56:15 +08:00
wenjia322
5b587bf0ce enhancement: add 'Expires' and 'Cache-Control' when putObject/copyObject/getObject/headObject
Signed-off-by: wenjia322 <buaa1214wwj@126.com>
2020-05-29 10:57:13 +08:00
wenjia322
ae3688cc2a feature: add 'corsMiddleware' and 'optionObject'
Signed-off-by: wenjia322 <buaa1214wwj@126.com>
2020-05-22 15:16:38 +08:00
Mofei Zhang
df4b7f9a42
Fix: parallel-safe issue in conn pool and metanode conn serve
1. Fix: parallel-safe issue in conn pool and metanode conn serve
2. Fix: nil pointer issue when list parts for non-exist uploadId
3. Enhancement: validate read size while read from connnect.
4. Enhancement: clean up useless data on failure while upload part.
5. Enhancement: generate ETag if do not exist when listing.
6. Enhancement: include error message when formatting packet to string.
7. Enhancement: improve compatile with old version SDK.
8. Enhancement:  success when retry add exist multipart part.

Signed-off-by: Mofei Zhang <mofei2816@gmail.com>
Signed-off-by: 张墨飞 <zhangmofei@jd.com>
2020-05-21 12:28:18 +08:00
yuboLee
b74bf88b2f Fix: rewrite copy object function
Signed-off-by: yuboLee <pangbolee@gmail.com>
2020-05-19 11:19:02 +08:00
yuboLee
14d3d64ab4 Enhancement: add support for parallel download
Signed-off-by: yuboLee <pangbolee@gmail.com>
2020-05-08 17:39:05 +08:00
Mofei Zhang
01240bd867
Enhancement: partial support user-defined metadata
The PutObject interface supports setting user-defined metadata. The
GetObject and HeadObject interfaces can correctly return the stored
user-defined metadata.

Signed-off-by: Mofei Zhang <mofei2816@gmail.com>
2020-05-06 00:52:04 +08:00
Mofei Zhang
a4ec2c88d5
Enhancement: improve tagging storage and add tests
1. Add tests for tagging operations.
2. Support setup tagging when put an object.
3. Fix routing issue on DeleteObjectTagging interface.
4. Improve tagging encoding for storage.

Signed-off-by: Mofei Zhang <mofei2816@gmail.com>
2020-05-05 22:38:34 +08:00
Mofei Zhang
323e529ee0
Enhancement: make ETag versioned
When ETag is stored, it is versioned by encoding, which can make
the file system interface and object storage interface more closely
integrated.

Referring to the Amazon AWS S3 Developer Guide:
"Amazon S3 response includes an ETag that uniquely identifies the
combined object data. This ETag will not necessarily be an MD5 hash
of the object data."

When a new object is written to ChubaoFS through the object storage
interface, ChubaoFS calculates the ETag value for it, and uses the
modification time of the object as its version information when
encoding and storing.

If this file is modified by the file system interface, the ETag of
this file will be invalid because the version information will be
inconsistent with modification time.

After the object storage interface finds that the ETag is invalid,
it will automatically generate a new ETag matching its modification
time.

Signed-off-by: Mofei Zhang <mofei2816@gmail.com>
2020-05-05 12:56:00 +08:00
Mofei Zhang
184ca0b428
Ehancement: improve compatibility with nginx
Http's Expect header is a special header. When nginx is used as the
reverse proxy in the front end of ObjectNode, nginx will process the
Expect header information in advance, send the http status code 100 to
the client, and will not forward this header information to ObjectNode.
At this time, if the client request uses the Expect header when signing,
it will cause the ObjectNode to verify the signature.
A workaround is used here to solve this problem. Add the following
configuration in Nginx:

proxy_set_header X-Forwarded-Expect $ http_Expect

In this way, nginx will not only automatically handle the Expect
handshake, but also send the original value of Expect to the ObjectNode
through X-Forwared-Expect. ObjectNode only needs to use the value of
X-Forwared-Expect.

Signed-off-by: Mofei Zhang <mofei2816@gmail.com>
2020-04-30 15:12:53 +08:00
Mofei Zhang
6455000a1f
Fix: issue on fetching etag data
At the same time, get etag information from the two extended attributes
'oss:etag' and 'oss:tag'.

Signed-off-by: Mofei Zhang <mofei2816@gmail.com>
2020-04-29 21:15:02 +08:00
Mofei Zhang
0296e5709c
Fix: create time format of list buckets
Fix create time format of list buckets API to
"2006-01-02T15:04:05.000Z" as UTC time.

Signed-off-by: Mofei Zhang <mofei2816@gmail.com>
2020-04-25 22:04:05 +08:00
Mofei Zhang
7a57837f74
Fix: third-party license information
Adjust the format of the license header information of the third-party
code used to make the format more compliant. The NOTICE file supplements
the third-party code NOTIC information and explains the use of the code.

Signed-off-by: Mofei Zhang <mofei2816@gmail.com>
2020-04-14 19:29:39 +08:00
yuboLee
c28e4a8b0c Enhancement: add conditional parameter support
Implemented the following conditional parameters in the GetObject
and HeadObject interfaces:
- If-Match
- If-Modified-Since
- If-None-Match
- If-Unmodified-Since

Signed-off-by: yuboLee <pangbolee@gmail.com>
2020-04-10 15:17:49 +08:00
Mofei Zhang
509d96c3d1
Enhancement: folder operations in S3 APIs
Supports folder operations in the same way as Amazon AWS S3.
  - Get folder meta info by HeadObject interface.
  - Create folder when header specifies Content-Type as
    application/directory and Content-Length as 0 on PutObject interface.
  - Delete an empty folder by DeleteObject interface.
  - The GetObject interface responds normally when the target is an
    existing directory.
  - Differentiate folders and files on the ListObject interface through the
    CommonPrefix property (already supported).

Following object storage interface haven been implemented folder operations:
  - HeadObject
  - GetObject
  - DeleteObject
  - DeleteObjects
  - ListObjects
  - ListObjectsV2

Signed-off-by: Mofei Zhang <mofei2816@gmail.com>
2020-03-30 17:01:45 +08:00
Mervin
7cbb5a21d9
Enhancement: support CORS request
Signed-off-by: Mervin <mofei2816@gmail.com>
2020-03-10 21:46:19 +08:00
Mervin
fbbe1e0a7e
Refactor: param parse in object storage interface handlers
Signed-off-by: Mervin <mofei2816@gmail.com>
2020-03-10 00:49:13 +08:00
Mofei Zhang
0009306a10
Enhancement: object storage api for object tagging operations
Signed-off-by: Mofei Zhang <mofei2816@gmail.com>
2020-02-04 21:11:32 +08:00
Mofei Zhang
d609fedb5c feature: object storage interface
Add ObjectNode provides S3-compatibile APIs.
Fusion Storage interface expose two interface (POSIX and S3-compatible) for file operation.

Signed-off-by: Mofei Zhang <mofei2816@gmail.com>
2019-12-17 17:36:53 +08:00