-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
NEW API: GetObjectAttributes #18732
NEW API: GetObjectAttributes #18732
Conversation
25254ee
to
6a21d41
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor stuff...
Co-authored-by: Klaus Post <klauspost@gmail.com>
Co-authored-by: Klaus Post <klauspost@gmail.com>
Co-authored-by: Klaus Post <klauspost@gmail.com>
Co-authored-by: Klaus Post <klauspost@gmail.com>
Co-authored-by: Klaus Post <klauspost@gmail.com>
Co-authored-by: Klaus Post <klauspost@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Related PRs
About
GetObjectAttributes is a combination of
HeadObject
andListParts
.Within
minio-go
HeadObject
is represented by StatObject andListParts
is represented by ListObjectParts.We however did not need to use
ListObjectParts
sinceStatObject
functions like a combination ofHeadObject
andListParts
.We were able to extract all required information by just using
StatObject
.Notes
This is my first time integrating an S3 API into
minio
, so I would appriciate a high level of scrutiny.There are a few things that are present in the headObjectHandler that were not implemented in the
GetObjectAttributes
API:If any of these are relevant for this API then I would appriciate some assistance from someone that understands these
mechanisms better.
Things to consider
Some error returns are not compatible with Amazons
GetObjectAttributes
API, but should be consistent with otherminio
APIs.Post PR work
GetObjectAttributes
has not been implemented in mc (not sure we will do that though).Testing
The testing for this new API is done using the functional test suite in the
minio-go
repository.Running the suite will use the
play.min.io
credentials by default, which will not work since this API has not been deployed on that environment.Including or not including
s3:ListBucket
can change the error response when objects/versions are not found.Details can be found under "permissions" within the S3 documentation.
How to test
Make sure you have the right code versions checked out
Set up minio with HTTPS
To run all the tests related to
GetObjectAttributes
we need HTTPS enabled forminio
.The best way to do that locally is to use certgen and the
--certs-dir
flag.Create Policies
You need to create a policy which contains
S3:GetObjectAttributes
andS3:GetObjectVersionAttributes
.Modify the functional_tests.go file
Modification of the
functional_test.go
file is required since it is designed to run against an internal testing site.Modify the main function so that the three functions related to
GetObjectAttributes
API are placed above theisfullMode()
check.Remember to include an
os.Exit(1)
so you don't run the entire suite.Set environment variables and run the tests
Types of changes