Skip to content
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

Support AWS Signature Version 4 (Refactored) #2

Merged
merged 8 commits into from
Jul 6, 2015

Conversation

windkit
Copy link
Contributor

@windkit windkit commented Jul 2, 2015

Brief Description

The flow is similar to Version 2 with two major differences

  • Payload SHA-256 is used for Signature
  • Chunked Upload

Related Pull Requests

Work in Progress

  • Unit Test

Using Authorization Header

Checksum Precomputed

http://docs.aws.amazon.com/AmazonS3/latest/API/sig-v4-header-based-auth.html

  • SHA-256 Checksum Provided in HTTP Header x-amz-content-sha256
  • Small Modification

Amazon Chunked Upload

http://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-streaming.html

  • "Rolling" Checksum of Chunks

Using Query Parameters

http://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-query-string-auth.html

Using HTTP Post

http://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-authentication-HTTPPOST.html

find_all/0, checksum/0
]).


-record(sign_v4_params, {credential :: binary(),
signature :: binary(),
signed_headers :: binary()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/binary()/list()/

and basically you need to dialyze for type checking before PL.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

? These parameters look binaries to me.
BTW, I will check how to use dialyzer

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

? These parameters look binaries to me.

yep.
you are right.

BTW, I will check how to use dialyzer

At first,
issue the below command only once in the repo root. ( basically when you cloned into local )

make build_plt

issue the below command if you want to dialyze. ( basically when you finished to implement before UT )

make dialyzer

@mocchira
Copy link
Member

mocchira commented Jul 2, 2015

@windkit LGTM. I'm waiting for UT and PR to leo_hex.

@windkit
Copy link
Contributor Author

windkit commented Jul 3, 2015

Sorry that I forgot to create the PR
leo-project/leo_commons#4

@windkit
Copy link
Contributor Author

windkit commented Jul 3, 2015

I am now writing the unit test, will work on transfer_deocde and unit test in leo_gateway afterwards

@windkit
Copy link
Contributor Author

windkit commented Jul 3, 2015

I have fixed the unit test for V2
(as interface of leo_s3_auth:authenticate and leo_s3_auth:get_signature are changed)

Unit Test for V4 Signing is added
http://docs.aws.amazon.com/AmazonS3/latest/API/sig-v4-header-based-auth.html

@mocchira
Copy link
Member

mocchira commented Jul 3, 2015

LGTM.

As you know that @yosukehara asked you benchmarking to compare the performance of v2 and v4,
Please share the result on the leo-project/notes repo.

  • note

    The purpose of this benchmark is to inform LeoFS users how the performance is affected when using v4, so the bench should conduct against the whole system with using basho_bench and typical use cases like R:W = 8:2, Write Only, Read Only.

@@ -24,7 +24,7 @@

{deps, [
{cowlib, ".*", {git, "https://github.com/extend/cowlib.git", {tag, "1.0.0"}}},
{leo_commons, ".*", {git, "https://github.com/leo-project/leo_commons.git", {tag, "1.1.2"}}},
{leo_commons, ".*", {git, "https://github.com/windkit/leo_commons.git", {branch, "develop"}}},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regarding leo_commons, I've merged your request. You could modify the row of leo_commons in the deps as below:

{leo_commons, ".*", {git, "https://github.com/leo-project/leo_commons.git", {branch, "develop"}}},

@yosukehara yosukehara merged commit 962fe09 into leo-project:1.4 Jul 6, 2015
@yosukehara
Copy link
Member

I've merged your request into the 1.4-branch. Again, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants