Skip to content
This repository has been archived by the owner on Mar 19, 2024. It is now read-only.

Commit

Permalink
Merge pull request #12 from Andrea-Scuderi/feature/swift_5_3
Browse files Browse the repository at this point in the history
Support Swift 5.3
  • Loading branch information
Andrea-Scuderi authored Sep 23, 2020
2 parents 1635c6a + e07a9e3 commit 9c5b6d2
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 12 deletions.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
SWIFT_VERSION?=5.2.3
SWIFT_VERSION?=5.3-amazonlinux2
DOCKER_OS?=amazonlinux2

DOCKER_TAG=nio-swift:$(SWIFT_VERSION)
SWIFT_DOCKER_IMAGE=$(DOCKER_TAG)
Expand Down
34 changes: 26 additions & 8 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"repositoryURL": "https://github.com/swift-server/async-http-client.git",
"state": {
"branch": null,
"revision": "037b70291941fe43de668066eb6fb802c5e181d2",
"version": "1.1.1"
"revision": "4b4d6605aa2e4f0c2ae3c7563795ae3bec259fff",
"version": "1.2.1"
}
},
{
Expand All @@ -19,31 +19,49 @@
"version": "1.0.0"
}
},
{
"package": "swift-log",
"repositoryURL": "https://github.com/apple/swift-log.git",
"state": {
"branch": null,
"revision": "173f567a2dfec11d74588eea82cecea555bdc0bc",
"version": "1.4.0"
}
},
{
"package": "swift-nio",
"repositoryURL": "https://github.com/apple/swift-nio.git",
"state": {
"branch": null,
"revision": "e876fb37410e0036b98b5361bb18e6854739572b",
"version": "2.16.0"
"revision": "96db8838be60fcbb993fa738e1120fb7f4b99c43",
"version": "2.22.1"
}
},
{
"package": "swift-nio-extras",
"repositoryURL": "https://github.com/apple/swift-nio-extras.git",
"state": {
"branch": null,
"revision": "b4dbfacff47fb8d0f9e0a422d8d37935a9f10570",
"version": "1.4.0"
"revision": "e5b5d191a80667a14827bfeb0ae4a511f7677942",
"version": "1.7.0"
}
},
{
"package": "swift-nio-ssl",
"repositoryURL": "https://github.com/apple/swift-nio-ssl.git",
"state": {
"branch": null,
"revision": "ae213938e151964aa691f0e902462fbe06baeeb6",
"version": "2.7.1"
"revision": "ea1dfd64193bf5af4490635a4a44c4fb43b1e1ae",
"version": "2.9.1"
}
},
{
"package": "swift-nio-transport-services",
"repositoryURL": "https://github.com/apple/swift-nio-transport-services.git",
"state": {
"branch": null,
"revision": "bb56586c4cab9a79dce6ec4738baddb5802c5de7",
"version": "1.9.0"
}
}
]
Expand Down
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
# aws-lambda-swift-sprinter-nio-plugin


[![Swift 5](https://img.shields.io/badge/Swift-5.0-blue.svg)](https://swift.org/download/) [![Swift 5.1](https://img.shields.io/badge/Swift-5.1-blue.svg)](https://swift.org/download/) [![Swift 5.2](https://img.shields.io/badge/Swift-5.2-blue.svg)](https://swift.org/download/) ![](https://img.shields.io/badge/version-1.0.0-green) [![Build Status](https://travis-ci.com/swift-sprinter/aws-lambda-swift-sprinter-nio-plugin.svg?branch=master)](https://travis-ci.com/swift-sprinter/aws-lambda-swift-sprinter-nio-plugin) [![codecov](https://codecov.io/gh/swift-sprinter/aws-lambda-swift-sprinter-nio-plugin/branch/master/graph/badge.svg)](https://codecov.io/gh/swift-sprinter/aws-lambda-swift-sprinter-nio-plugin)
[![Swift 5](https://img.shields.io/badge/Swift-5.3-blue.svg)](https://swift.org/download/) ![](https://img.shields.io/badge/version-1.0.0-green) [![Build Status](https://travis-ci.com/swift-sprinter/aws-lambda-swift-sprinter-nio-plugin.svg?branch=master)](https://travis-ci.com/swift-sprinter/aws-lambda-swift-sprinter-nio-plugin) [![codecov](https://codecov.io/gh/swift-sprinter/aws-lambda-swift-sprinter-nio-plugin/branch/master/graph/badge.svg)](https://codecov.io/gh/swift-sprinter/aws-lambda-swift-sprinter-nio-plugin)

The project implements an HTTPS client plugin for the [LambdaSwiftSprinter](https://github.com/swift-sprinter/aws-lambda-swift-sprinter-core) framework.

The plugin is based on swift-nio 2.0 and uses the third part library [async-http-client](https://github.com/swift-server/async-http-client.git)


- Allow the handler to make an HTTPS call. Swift's implementation relies on ``libgnutls`` which expects to find its root certificates in ``/etc/ssl/certs/ca-certificates.crt`` directory. That directory is absent on Amazon Linux. **Currently calls to HTTPS endpoint will fail with an error** : ``error setting certificate verify locations:\n CAfile: /etc/ssl/certs/ca-certificates.crt\n CApath: /etc/ssl/certs``
This library fix this issue by using `swift-nio 2`.
- Allow the handler to make an HTTPS call using swift-nio

# Usage

Expand Down
3 changes: 3 additions & 0 deletions docker/5.3-amazonlinux2/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM swift:5.3-amazonlinux2 as builder

RUN yum -y install zip
3 changes: 3 additions & 0 deletions docker/5.3-amazonlinux2/bootstrap
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh
EXECUTABLE=$LAMBDA_TASK_ROOT/"$(echo $_HANDLER | cut -d. -f1)"
$EXECUTABLE
12 changes: 12 additions & 0 deletions docker/5.3-amazonlinux2/swift-shared-libraries.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/usr/lib/swift/linux/libBlocksRuntime.so
/usr/lib/swift/linux/libFoundation.so
/usr/lib/swift/linux/libFoundationNetworking.so
/usr/lib/swift/linux/libFoundationXML.so
/usr/lib/swift/linux/libdispatch.so
/usr/lib/swift/linux/libicudataswift.so.65
/usr/lib/swift/linux/libicui18nswift.so.65
/usr/lib/swift/linux/libicuucswift.so.65
/usr/lib/swift/linux/libswiftCore.so
/usr/lib/swift/linux/libswiftDispatch.so
/usr/lib/swift/linux/libswiftGlibc.so
/usr/lib/swift/linux/libswiftSwiftOnoneSupport.so

0 comments on commit 9c5b6d2

Please sign in to comment.