Latest 0.1.0
Homepage https://github.com/nikola-mladenovic/AwsSwiftSign
License Apache License, Version 2.0
Platforms ios 10.0, osx 10.10, tvos 9.0, watchos 2.2
Dependencies CryptoSwift
Authors

AwsSign – Swift

AwsSign is a Swift library that enables you to sign URLRequests using Signature Version 4 process. More details on this are available from the AWS documentation.


Swift 4.0


Platforms iOS | macOS | watchOS | tvOS | Linux


SPM compatible

This package builds with Swift Package Manager. Ensure you have installed and activated the latest Swift 4.0 tool chain.

Quick Start

To use AwsSign, modify the Package.swift file and add following dependency:

.package(url: "https://github.com/nikola-mladenovic/AwsSwiftSign.git", .branch("master"))

Then import the AwsSign library into the swift source code:

import AwsSign

Usage

The current release provides a URLRequest extension, containing mutating func sign(accessKeyId: String, secretAccessKey: String) throws method, which you can use on your request instance to perform Signature Version 4 process:

var request = URLRequest(url: URL(string: "https://sns.us-east-1.amazonaws.com?Action=Publish&Message=foo")!)
request.httpMethod = "POST"
request.addValue("application/json", forHTTPHeaderField: "Content-Type")

try! request.sign(accessKeyId: "593ca2ad2782e4000a586d28", secretAccessKey: "ASDI/YZZfLXLna3xEn7JTIJhyH/YZZfLXLna3xEn7JTIJhyH")

// ...

Latest podspec

{
    "name": "AwsSwiftSign",
    "version": "0.1.0",
    "summary": "Swift library for signing AWS URLRequests",
    "homepage": "https://github.com/nikola-mladenovic/AwsSwiftSign",
    "license": {
        "type": "Apache License, Version 2.0",
        "file": "LICENSE"
    },
    "authors": {
        "Nikola Mladenovic": "[email protected]"
    },
    "source": {
        "git": "https://github.com/nikola-mladenovic/AwsSwiftSign.git",
        "tag": "0.1.0"
    },
    "source_files": "Source/*.swift",
    "swift_version": "4.0",
    "pod_target_xcconfig": {
        "SWIFT_VERSION": "4.0"
    },
    "platforms": {
        "ios": "10.0",
        "osx": "10.10",
        "tvos": "9.0",
        "watchos": "2.2"
    },
    "dependencies": {
        "CryptoSwift": [
            "~> 0.8"
        ]
    }
}

Pin It on Pinterest

Share This