Skip to content
This repository has been archived by the owner on Mar 16, 2021. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
Merged by hand, many of these changes were already made.
  • Loading branch information
samoconnor committed Jan 13, 2018
1 parent 86365c3 commit 0d40976
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/AWS4AuthRequest.jl
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module AWS4AuthRequest

using Base64
using Dates
using Unicode
using ..Base64
using ..Dates
using ..Unicode
using MbedTLS: digest, MD_SHA256, MD_MD5
import ..Layer, ..request, ..Headers
using ..URIs
Expand All @@ -27,10 +27,12 @@ export AWS4AuthLayer
function request(::Type{AWS4AuthLayer{Next}},
uri::URI, req, body; kw...) where Next

@static if VERSION > v"0.7.0-DEV.2915"
if !haskey(kw, :aws_access_key_id) &&
!haskey(ENV, "AWS_ACCESS_KEY_ID")
kw = merge(dot_aws_credentials(), kw)
end
end

sign_aws4!(req.method, uri, req.headers, req.body; kw...)

Expand Down Expand Up @@ -117,6 +119,7 @@ function sign_aws4!(method::String,
))
end

@static if VERSION > v"0.7.0-DEV.2915"

using IniFile

Expand Down Expand Up @@ -148,5 +151,6 @@ function dot_aws_credentials()::NamedTuple
aws_secret_access_key = String(get(ini, p, "aws_secret_access_key")))
end

end

end # module AWS4AuthRequest

0 comments on commit 0d40976

Please sign in to comment.