🔒 0.2.0

🔒 0.2.0

TestsTested
LangLanguage SwiftSwift
License BSD
ReleasedLast Release Sep 2015
SPMSupports SPM

Maintained by Kyle Fuller.


Downloads

Total14
Week0
Month0

Installs

Apps5
Test Targets1
powered by Segment

GitHub

Stars21
Watchers1
Forks2
Issues0
Contributors2
Pull Requests0

Code

Files1
LOCLines of Code 19


 
Depends on:
Nest~> 0.2.0
Inquiline~> 0.2.0
 

🔒 0.2.0

🔒

Nest example middleware to wrap your web application in HTTP auth.

NOTE: This is also the very first published Pod to use emoji as its name.

Installation

pod '🔒'

Usage

import Padlock

func application(env:Request) -> (Response) {
  return ("200 OK", [], "Hello World")
}

func isValidCredentials(username:String, password:String) -> Bool {
  return username == "kyle" && password == "nest"
}

let secureApplication = 🔒(isValidCredentials, application)

serve("127.0.0.1", 8080, secureApplication)

License

🔒 is licensed under the BSD license. See LICENSE for more information.