perfect.org
Documentation
|
API Documentation
PerfectLib
Perfect-CouchDB
Perfect-CURL
Perfect-Filemaker
Perfect-GoogleAnalytics-MeasurementProtocol
Perfect-HTTP
Perfect-HTTPServer
Perfect-Logger
Perfect-MongoDB
Perfect-Mustache
Perfect-MySQL
Perfect-MariaDB
Perfect-Net
Perfect-Notifications
Perfect-PostgreSQL
Perfect-Redis
Perfect-RequestLogger
Perfect-Session
Perfect-Session-SQLite
Perfect-Session-CouchDB
Perfect-Session-MySQL
Perfect-Session-PostgreSQL
Perfect-SQLite
Perfect-Thread
Perfect-WebSockets
Perfect-XML
Perfect-Zip
Turnstile-Perfect
Perfect-Turnstile-CouchDB
Perfect-Turnstile-MySQL
Perfect-Turnstile-PostgreSQL
Perfect-Turnstile-SQLite
StORM
CouchDB-StORM
MySQL-StORM
Postgres-StORM
SQLite-StORM
Module: Turnstile-Perfect
struct
AuthenticationConfig
Sets up the matrix of which routes are checked for authentication, and which are not.
var
inclusions = [String]()
An array of routes that are checked for valid authentication.
var
exclusions = [String]()
An array of routes that will not be checked.
var
denied: String?
Unimplemented. Will optionally provide a location for access denied redirection.
func
init()
func
mutating func include(_ str: String)
Add a route as a string to the array of inclusions
func
mutating func include(_ arr: [String])
Add a an array of strings (as routes) to the array of inclusions
func
mutating func exclude(_ str: String)
Add a route as a string to the array of exclusions
func
mutating func exclude(_ arr: [String])
Add a an array of strings (as routes) to the array of exclusions
struct
AuthFilter: HTTPRequestFilter
Contains the filtering mechanism for determining valid authentication on routes.
func
init(_ cfg: AuthenticationConfig)
Accept an auth config via init.
func
filter(request: HTTPRequest, response: HTTPResponse, callback: (HTTPRequestFilterResult) -> ())
Perform the filtering, with a callback allowing continuation of request, or galting immediately.
extension
HTTPRequest
var
internal(set) public var user: Subject
Extends the HTTPRequest with a user object.
struct
MustacheHandler: MustachePageHandler
Adds a MustacheHandler shortcut/convenience method
func
extendValuesForResponse(context contxt: MustacheWebEvaluationContext, collector: MustacheEvaluationOutputCollector)
func
init(context: [String: Any] = [String: Any]())
extension
HTTPResponse
func
render(template: String, context: [String: Any] = [String: Any]())
func
redirect(path: String)
class
TurnstileFilter
The filter container class for Turnstile
func
init(turnstile: Turnstile)
extension
TurnstileFilter
func
filter(request: HTTPRequest, response: HTTPResponse, callback: (HTTPRequestFilterResult) -> ())
Checks for required filter check, and filter routing.
extension
TurnstileFilter
func
filterHeaders(response: HTTPResponse, callback: (HTTPResponseFilterResult) -> ())
Called once before headers are sent to the client. If needed, sets the cookie with the session id.
func
filterBody(response: HTTPResponse, callback: (HTTPResponseFilterResult) -> ())
Called zero or more times for each bit of body data which is sent to the client.
class
TurnstilePerfect
Base Turnstile Perfect class
var
requestFilter: (HTTPRequestFilter, HTTPFilterPriority)
var
responseFilter: (HTTPResponseFilter, HTTPFilterPriority)
func
init(sessionManager: SessionManager = MemorySessionManager(), realm: Realm = WebMemoryRealm())
initializes with the Session Manager (default is memory, to be overridden by child modules)