Skip to content

Commit

Permalink
Wrap signer changes to avoid breaking change
Browse files Browse the repository at this point in the history
  • Loading branch information
adam-fowler committed Aug 13, 2021
1 parent 9d02922 commit 98c7f11
Showing 1 changed file with 25 additions and 2 deletions.
27 changes: 25 additions & 2 deletions Sources/SotoSignerV4/signer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,18 @@ public struct AWSSigner {
method: HTTPMethod = .GET,
headers: HTTPHeaders = HTTPHeaders(),
body: BodyData? = nil,
omitSecurityToken: Bool = false,
date: Date = Date()
) -> HTTPHeaders {
return signHeaders(url: url, method: method, headers: headers, body: body, omitSecurityToken: false, date: date)
}

/// Generate signed headers, for a HTTP request
public func signHeaders(
url: URL,
method: HTTPMethod = .GET,
headers: HTTPHeaders = HTTPHeaders(),
body: BodyData? = nil,
omitSecurityToken: Bool,
date: Date = Date()
) -> HTTPHeaders {
let bodyHash = AWSSigner.hashedPayload(body)
Expand Down Expand Up @@ -117,7 +128,19 @@ public struct AWSSigner {
headers: HTTPHeaders = HTTPHeaders(),
body: BodyData? = nil,
expires: TimeAmount,
omitSecurityToken: Bool = false,
date: Date = Date()
) -> URL {
return signURL(url: url, method: method, headers: headers, body: body, expires: expires, omitSecurityToken: false, date: date)
}

/// Generate a signed URL, for a HTTP request
public func signURL(
url: URL,
method: HTTPMethod = .GET,
headers: HTTPHeaders = HTTPHeaders(),
body: BodyData? = nil,
expires: TimeAmount,
omitSecurityToken: Bool,
date: Date = Date()
) -> URL {
var headers = headers
Expand Down

0 comments on commit 98c7f11

Please sign in to comment.