Skip to content

Commit dada580

Browse files
Swift 5.1
1 parent 6767d1c commit dada580

File tree

4 files changed

+11
-8
lines changed

4 files changed

+11
-8
lines changed

AwsSign.podspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ Pod::Spec.new do |s|
99
s.source = { :git => "https://github.com/nikola-mladenovic/AwsSwiftSign.git", :tag => s.version.to_s }
1010
s.source_files = 'Source/*.swift'
1111
s.swift_version = "4.2"
12-
s.pod_target_xcconfig = { 'SWIFT_VERSION' => '4.2' }
12+
s.pod_target_xcconfig = { 'SWIFT_VERSION' => '5.1' }
1313

1414
s.ios.deployment_target = '10.0'
1515
s.osx.deployment_target = '10.10'
1616
s.tvos.deployment_target = '9.0'
1717
s.watchos.deployment_target = '2.2'
1818

19-
s.dependency 'CryptoSwift', '~> 0.12'
19+
s.dependency 'CryptoSwift', '~> 1.3'
2020

2121
end

Package.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
// swift-tools-version:4.2
1+
// swift-tools-version:5.1
22

33
import PackageDescription
44

55
let package = Package(
66
name: "AwsSign",
77
products: [.library(name: "AwsSign", targets: ["AwsSign"])],
8-
dependencies: [.package(url: "https://github.com/krzyzanowskim/CryptoSwift.git", from: "0.12.0")],
8+
dependencies: [.package(url: "https://github.com/krzyzanowskim/CryptoSwift.git", from: "1.3.0")],
99
targets: [.target(name: "AwsSign", dependencies: ["CryptoSwift"], path: "Source")],
10-
swiftLanguageVersions: [.v4_2]
10+
swiftLanguageVersions: [.v5]
1111
)

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ AwsSign is a Swift library that enables you to sign `URLRequest`s using Signatur
44

55
<p>
66
<a href="https://developer.apple.com/swift/" target="_blank">
7-
<img src="https://img.shields.io/badge/Swift-4.2-orange.svg?style=flat" alt="Swift 4.2">
7+
<img src="https://img.shields.io/badge/Swift-5.1-orange.svg?style=flat" alt="Swift 5.1">
88
</a>
99
<a href="https://developer.apple.com/swift/" target="_blank">
1010
<img src="https://img.shields.io/badge/Platforms-iOS%20%7C%20macOS%20%7C%20watchOS%20%7C%20tvOS%20%7C%20Linux-4E4E4E.svg?colorA=EF5138" alt="Platforms iOS | macOS | watchOS | tvOS | Linux">
@@ -14,7 +14,7 @@ AwsSign is a Swift library that enables you to sign `URLRequest`s using Signatur
1414
</a>
1515
</p>
1616

17-
This package builds with Swift Package Manager. Ensure you have installed and activated the latest Swift 4.2 tool chain.
17+
This package builds with Swift Package Manager. Ensure you have installed and activated the latest Swift 5.1 tool chain.
1818

1919
## Quick Start
2020

Source/AwsSign.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
import Foundation
2+
#if canImport(FoundationNetworking)
3+
import FoundationNetworking
4+
#endif
25
import CryptoSwift
36

47
public extension URLRequest {
@@ -20,7 +23,7 @@ public extension URLRequest {
2023
return (full: date, short: String(shortDate))
2124
}
2225

23-
public mutating func sign(accessKeyId: String, secretAccessKey: String) throws {
26+
mutating func sign(accessKeyId: String, secretAccessKey: String) throws {
2427
guard let url = url, let host = url.host, let method = httpMethod else { throw SignError.generalError(reason: "URLRequest doesn't have a proper URL") }
2528
let hostComponents = host.components(separatedBy: ".")
2629
guard hostComponents.count > 3 else { throw SignError.generalError(reason: "Incorrect host format. The host should contain service name and region, e.g sns.us-east-1.amazonaws.com") }

0 commit comments

Comments
 (0)