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

Support Swift 5.3 #12

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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