Skip to content

Commit

Permalink
Merge #88
Browse files Browse the repository at this point in the history
88: Migrate AWSAuth.jl into AWSCore.jl r=iamed2 a=mattBrzezinski

Overview
---
This merge request is part of a larger overall refactor. Recently this merge request went through in [HTTP.jl](JuliaWeb/HTTP.jl#443), it introduced the ability to add custom layers into the request stack. With that merge request being introduced we can now move the `AWS4AuthLayer` away from the `HTTP.jl` project.

We need to find a new home for `AWSAuthLayer`, at first glance it makes most sense to move this into the `AWSAuth.jl` package. However, looking at the state of the package, and open issues we can see why this might not be the best plan.

`AWSAuth.jl` has an open [issue](JuliaCloud/AWSAuth.jl#11) to move `AWSCredentials` from `AWSCore.jl` into it. However, if we did this we would introduce a circular dependency between `AWSAuth.jl` and `AWSCore.jl`.  To get around this circular dependency we would need to move [Services.jl](https://github.com/JuliaCloud/AWSCore.jl/blob/master/src/Services.jl) into its own package. I do not think this is the best decision as we are creating more packages and not solving the core issue with the state of these packages.

`AWSAuth.jl` is a tiny package, which is just a duplicate of the `AWS4AuthLayer` in `HTTP.jl`. I propose that we move this entire functionality into `AWSCore.jl`, and archive `AWSAuth.jl`. The addition of this is not a heavy lift into `AWSCore.jl` and helps centralize these AWS packages.

I think this is a good step forward and will help clean up the current state of the JuliaCloud packages. Afterwards we can start looking ahead and re-designing the architecture behind these packages.

Next Steps
---
If this merge request is approved, we can clean up `HTTP.jl` and remove the `AWS4AuthLayer` code from that package as it already exists in this one. We can then begin looking into refactoring this package and making it more modular.

[AWSAuth.jl](https://github.com/JuliaCloud/AWSAuth.jl) can be archived as it no longer has a purpose.

Links
---
- [AWSAuth.jl - Issue - Current state of the package](JuliaCloud/AWSAuth.jl#11)
- [HTTP.jl - CR - Add Custom Layers to request stack](JuliaWeb/HTTP.jl#443)
- [HTTP.jl - Issue - Move AWS4AuthLayer](JuliaWeb/HTTP.jl#355)

Issues deemed OOO that are logged:
---
- #90
- #91
- #92

Co-authored-by: Matt Brzezinski <[email protected]>
  • Loading branch information
bors[bot] and mattBrzezinski authored Oct 24, 2019
2 parents 82a615b + 830a19a commit 87c4529
Show file tree
Hide file tree
Showing 15 changed files with 1,676 additions and 879 deletions.
4 changes: 3 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "AWSCore"
uuid = "4f1ea46c-232b-54a6-9b17-cc2d0f3e6598"
version = "0.6.2"
version = "0.6.3"

[deps]
Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
Expand All @@ -11,12 +11,14 @@ IniFile = "83e8ac13-25f8-5344-8a64-a9f2b223428f"
JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
LazyJSON = "fc18253b-5e1b-504c-a4a2-9ece4944c004"
MbedTLS = "739be429-bea8-5141-9913-cc70e7f3736d"
Mocking = "78c3b35d-d492-501b-9361-3d52fe80e533"
Retry = "20febd7b-183b-5ae2-ac4a-720e7ce64774"
Sockets = "6462fe0b-24de-5631-8697-dd941f90decc"
SymDict = "2da68c74-98d7-5633-99d6-8493888d7b1e"
XMLDict = "228000da-037f-5747-90a9-8195ccbf91a5"

[compat]
Mocking = "0.7"
julia = "1"

[extras]
Expand Down
20 changes: 8 additions & 12 deletions src/AWSCore.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
module AWSCore


export AWSException, AWSConfig, AWSRequest,
aws_config, default_aws_config
export AWSException, AWSConfig, AWSRequest, SignatureV4, aws_config, default_aws_config,
http_get

using Base64
using Dates
Expand Down Expand Up @@ -49,14 +49,15 @@ It contains the following keys:
"""
const AWSRequest = SymbolDict


include("http.jl")
include("AWSException.jl")
include("AWSCredentials.jl")
include("deprecations.jl")
include("names.jl")
include("mime.jl")


include("signaturev4.jl")
include("sign.jl")
include("Services.jl")

#------------------------------------------------------------------------------#
# Configuration.
Expand Down Expand Up @@ -106,7 +107,6 @@ as follows. However, putting access credentials in source code is discouraged.
aws = aws_config(creds = AWSCredentials("AKIAXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"))
```
"""
function aws_config(;profile=nothing,
creds=AWSCredentials(profile=profile),
Expand All @@ -120,6 +120,8 @@ global _default_aws_config = nothing # Union{AWSConfig,Nothing}


"""
default_aws_config()
`default_aws_config` returns a global shared [`AWSConfig`](@ref) object
obtained by calling [`aws_config`](@ref) with no optional arguments.
"""
Expand All @@ -138,7 +140,6 @@ end
Convert nested `Vector{Pair}` maps in `args` into `Dict{String,Any}` maps.
"""
function aws_args_dict(args)

result = stringdict(args)

dictlike(t) = (t <: AbstractDict
Expand Down Expand Up @@ -562,11 +563,6 @@ global debug_level = 0
function set_debug_level(n)
global debug_level = n
end


include("Services.jl")


end # module AWSCore


Expand Down
Loading

0 comments on commit 87c4529

Please sign in to comment.