Switch to AWS v4 signatures #5

Merged
basti merged 9 commits from feature/aws_v4_signatures into master 2023-11-21 14:19:38 +00:00
Showing only changes of commit 209fcca5ea - Show all commits
+3 -3
View File
@@ -49,14 +49,14 @@ module RemoteStorage
def do_head_request(url, &block)
deal_with_unauthorized_requests do
auth_headers = auth_headers_for("HEAD", url, {})
auth_headers = auth_headers_for("HEAD", url)
RestClient.head(url, auth_headers, &block)
end
end
def do_delete_request(url)
deal_with_unauthorized_requests do
auth_headers = auth_headers_for("DELETE", url, {})
auth_headers = auth_headers_for("DELETE", url)
RestClient.delete(url, auth_headers)
end
end
@@ -75,7 +75,7 @@ module RemoteStorage
return found
end
def auth_headers_for(http_method, url, headers, data = nil)
def auth_headers_for(http_method, url, headers = {}, data = nil)
basti marked this conversation as resolved Outdated
Outdated
Review

The headers param could be made optional as well, then you wouldn't need to add an empty hash for the calls in do_head_request and do_delete_request.

auth_headers_for(http_method, url, headers = {}, data = nil)
The `headers` param could be made optional as well, then you wouldn't need to add an empty hash for the calls in `do_head_request` and `do_delete_request`. ```rb auth_headers_for(http_method, url, headers = {}, data = nil) ```
signature = s3_signer.sign_request(
http_method: http_method, url: url, headers: headers, body: data
)