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

Bugfix/copy object bugs #1200

Merged
merged 6 commits into from
Jul 30, 2015
Merged

Bugfix/copy object bugs #1200

merged 6 commits into from
Jul 30, 2015

Conversation

shino
Copy link
Contributor

@shino shino commented Jul 28, 2015

This PR fixes a few bugs around PUT Copy / Multipart Upload Copy APIs.

  • Fix bugs of the resource value in error response XML when source is
    not existent or not accessible, source bucket/key should be displayed
    there instead of target bucket/key. The bug description is at
    PUT Copy shows target key when source is not found [JIRA: RCS-215] #1169, but this PR does not
    cover error response XML structure compatibility with S3.
  • Fix Copy requests without Content-Length request headers (Handling a request has no Content-Length on Upload Part - Copy [JIRA: RCS-187] #939).
    Before this PR, such requests fails with 5xx errors. This PR allows
    requests without CL header in Copy API calls. Additionally, Copy API
    calls with CL more than zero is made to explicitly errors.
  • Fix typo bug in upload ID seek, this makes error response of
    unknown upload ID correct (or more understandable.)

@kuenishi
Copy link
Contributor

Rebasing or merging develop needed.

diff --cc riak_test/src/rtcs.erl
index 744446b,dccc445..0000000
--- a/riak_test/src/rtcs.erl
+++ b/riak_test/src/rtcs.erl
@@@ -1013,17 -1020,17 +1020,28 @@@ pbc({multibag, _} = Flavor, ObjectKind
      rtcs_bag:pbc(Flavor, ObjectKind, RiakNodes, Opts).

  make_authorization(Method, Resource, ContentType, Config, Date) ->
++<<<<<<< HEAD
 +    make_authorization(Method, Resource, ContentType, Config, Date, []).
 +
 +%% AmzHeaders are assumed already normalized and sorted
 +make_authorization(Method, Resource, ContentType, Config, Date, AmzHeaders) ->
 +    StsAmzHeaderPart = [[K, $:, V, $\n] || {K, V} <- AmzHeaders],
 +    StringToSign = [Method, $\n, [], $\n, ContentType, $\n, Date, $\n,
 +                    StsAmzHeaderPart, Resource],
 +    lager:debug("StringToSign~n~s~n", [StringToSign]),
++=======
+     make_authorization(s3, Method, Resource, ContentType, Config, Date).
+ 
+ make_authorization(Type, Method, Resource, ContentType, Config, Date) ->
+     StringToSign = [Method, $\n, [], $\n, ContentType, $\n, Date, $\n, Resource],
++>>>>>>> develop
      Signature =
          base64:encode_to_string(sha_mac(Config#aws_config.secret_access_key, StringToSign)),
-     lists:flatten(["AWS ", Config#aws_config.access_key_id, $:, Signature]).
+     Prefix = case Type of
+                  s3 -> "AWS";
+                  velvet -> "MOSS"
+              end,
+     lists:flatten([Prefix, " ", Config#aws_config.access_key_id, $:, Signature]).

@shino
Copy link
Contributor Author

shino commented Jul 30, 2015

Rebased on current develop and force pushed.

end
end.

%% `valid_entity_length' helper.
Copy link
Contributor

Choose a reason for hiding this comment

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

It would be good to have @doc prefix to let edoc know.

borshop added a commit that referenced this pull request Jul 30, 2015
Bugfix/copy object bugs

Reviewed-by: kuenishi
@shino
Copy link
Contributor Author

shino commented Jul 30, 2015

@borshop merge

@borshop borshop merged commit 223c7ba into develop Jul 30, 2015
@shino shino deleted the bugfix/copy-object-bugs branch July 30, 2015 05:14
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.

None yet

3 participants