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

Commit

Permalink
Merge pull request #136 from nodes-vapor/feature/use-github-actions
Browse files Browse the repository at this point in the history
Use Github Actions
  • Loading branch information
siemensikkema authored Oct 23, 2020
2 parents 0414255 + 733ea85 commit e8bbf52
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 72 deletions.
67 changes: 0 additions & 67 deletions .circleci/config.yml

This file was deleted.

37 changes: 37 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: test
on:
pull_request:
push:
branches:
- master
jobs:
macos:
runs-on: macos-latest
env:
DEVELOPER_DIR: /Applications/Xcode_12.app/Contents/Developer
steps:
- uses: actions/checkout@v2
- run: brew install openssl
- run: brew install libressl
- run: xcrun swift test --enable-test-discovery --sanitize=thread -Xcxx "-I/usr/local/opt/openssl/include" -Xlinker "-L/usr/local/opt/openssl/lib"
linux-4_2:
runs-on: ubuntu-latest
container:
image: swift:4.2
steps:
- uses: actions/checkout@v2
- run: apt-get -qq update && apt-get install -y libssl-dev
- run: swift test
linux:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
image:
- swift:5.2-focal
- swift:5.3-focal
container: ${{ matrix.image }}
steps:
- uses: actions/checkout@v2
- run: apt-get -qq update && apt-get install -y libssl-dev
- run: swift test --enable-test-discovery --sanitize=thread
11 changes: 6 additions & 5 deletions Sources/JWTKeychain/Extensions/Router.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,31 @@ public extension Router {
on container: Container
) throws {
let config: JWTKeychainConfig<U> = try container.make()
let controller = config.controller
let middlewares: JWTKeychainMiddlewares<U> = try container.make()
let access = self.grouped(middlewares.accessMiddlewares)

if let registerPath = config.endpoints.register {
self.post(registerPath, use: config.controller.register)
self.post(registerPath) { req in try controller.register(req: req) }
}

if let loginPath = config.endpoints.login {
self.post(loginPath, use: config.controller.logIn)
self.post(loginPath) { req in try controller.logIn(req: req) }
}

if let mePath = config.endpoints.me {
access.get(mePath, use: config.controller.me)
access.get(mePath) { req in try controller.me(req: req) }
}

if let updatePath = config.endpoints.update {
access.patch(updatePath, use: config.controller.update)
access.patch(updatePath) { req in try controller.update(req: req) }
}

if
let refreshMiddlewares = middlewares.refreshMiddlewares,
let tokenPath = config.endpoints.token
{
self.grouped(refreshMiddlewares).post(tokenPath, use: config.controller.token)
self.grouped(refreshMiddlewares).post(tokenPath) { req in try config.controller.token(req: req) }
}
}
}

0 comments on commit e8bbf52

Please sign in to comment.