Module jls.net.AuthGuard
Protects a TCP server against unauthenticated connections.
The authentications on new IP are detected. Bad authentications are monitored and user is blocked. Connections attempts from IP without authentication are blocked.
Usage:
authGuard = AuthGuard:new()
authGuard:guard(httpServer)
-- use the guard during the login flow for granting or denying users
local function login(exchange, user, success)
if success then
if authGuard:grantUser(user, exchange) then
-- ok
else
HttpExchange.forbidden(exchange)
end
else
authGuard:denyUser(user)
HttpExchange.forbidden(exchange)
end
end
Class AuthGuard
| AuthGuard:new () | Creates a new authentication guard. |
Class AuthGuard
The authentication guard class.