Skip to content

Commit

Permalink
rm locate_credentials() call from signature_v4() (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
leeper committed Aug 7, 2018
1 parent c50e9a5 commit 54e2390
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: aws.signature
Type: Package
Title: Amazon Web Services Request Signatures
Version: 0.4.4
Date: 2018-07-26
Version: 0.4.5
Date: 2018-08-07
Authors@R: c(person("Thomas J.", "Leeper",
role = c("aut", "cre"),
email = "[email protected]",
Expand Down
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# aws.signature 0.4.5

* Removed `locate_credentials()` call from internal `signature_v4()` function. (#33)
*

# aws.signature 0.4.4

* Allow use of ECS metadata where available. (h/t @jon-mago #23, #30)
Expand Down
5 changes: 2 additions & 3 deletions R/signature_v4.R
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,8 @@ function(secret = NULL,
service,
string_to_sign,
verbose = FALSE) {
credentials <- locate_credentials(secret = secret, region = region, verbose = verbose)
kDate <- digest::hmac(paste0("AWS4", credentials[["secret"]]), date, "sha256", raw = TRUE)
kRegion <- digest::hmac(kDate, credentials[["region"]], "sha256", raw = TRUE)
kDate <- digest::hmac(paste0("AWS4", secret), date, "sha256", raw = TRUE)
kRegion <- digest::hmac(kDate, region, "sha256", raw = TRUE)
kService <- digest::hmac(kRegion, service, "sha256", raw = TRUE)
kSigning <- digest::hmac(kService, "aws4_request", "sha256", raw = TRUE)
signature <- digest::hmac(kSigning, string_to_sign, "sha256")
Expand Down

0 comments on commit 54e2390

Please sign in to comment.