Swiftpack.co - nikola-mladenovic/AwsSwiftSign as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by nikola-mladenovic.
nikola-mladenovic/AwsSwiftSign 0.4.0
Swift library for signing AWS URLRequests
⭐️ 6
🕓 3 years ago
.package(url: "https://github.com/nikola-mladenovic/AwsSwiftSign.git", from: "0.4.0")

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 5.2 Platforms iOS | macOS | watchOS | tvOS | Linux SPM compatible

This package builds with Swift Package Manager. Ensure you have installed and activated the latest Swift 5.2 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")

// ...

GitHub

link
Stars: 6
Last commit: 3 years ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Release Notes

Swift 5.2 support
3 years ago

0.4.0

Released on 2019-07-08.

Added

  • Swift 5.2 support.

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics