Request

extension Request
  • Returns a database sort direction for queries based on the Request’s order parameter. If the order is 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-For with the address it received the request from, and the web UI’s apiQuery passes that address along on its loopback API calls. So the rightmost X-Forwarded-For entry 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 }

UCD Authenticators