-
Returns a database sort direction for queries based on the Request’s
orderparameter. If theorderis not passed or invalid, we return nil so the caller can fall back to a default.Declaration
Swift
public func orderDirection() -> DatabaseQuery.Sort.Direction? -
The client’s IP address, for rate limiting.
In production, Traefik replaces any client-supplied
X-Forwarded-Forwith the address it received the request from, and the web UI’sapiQuerypasses that address along on its loopback API calls. So the rightmostX-Forwarded-Forentry is the client. This relies on Traefik not being configured to trust forwarded headers from clients (forwardedHeaders), and on Swiftarr’s port not being reachable except through Traefik.Declaration
Swift
var rateLimitClientIP: String { get }
-
Declaration
Swift
var userCache: UserCache { get } -
Declaration
Swift
struct UserCache -
Declaration
Swift
public var webSocketStore: WebSocketStorage { get } -
Declaration
Swift
public class WebSocketStorage -
Extends Request.Redis for Site
Most of the Redis extensions are in the API-level RedisWrapper file, but some usage of Redis is specific to the Site code. This file takes Redis primitives and ‘wraps’ them in methods that describe the operation what we’re actually doing.
See moreDeclaration
Swift
extension Request.Redis
View on GitHub