The Lua module will implement the following, which directly correspond to the UserStore trait:
get_user(username): return a User table, or nil
login(username, password): login the user, return a User table if success, nil on error
registration_available: return true if registration is available, false otherwise. Default implementation will return true if the register method is available.
register(username, password): registers a user, returns User struct if success, nil on error.
User store implemented as a Lua module.
Parameters are:
* `file`: Path to the Lua file.
* `params`: Variables to be passed into Lua.
The Lua module will implement the following, which directly correspond to the `UserStore` trait:
* `get_user(username)`: return a `User` table, or `nil`
* `login(username, password)`: login the user, return a `User` table if success, `nil` on error
* `registration_available`: return `true` if registration is available, `false` otherwise. Default implementation will return `true` if the `register` method is available.
* `register(username, password)`: registers a user, returns `User` struct if success, `nil` on error.
malacoda
added this to the Phase I milestone 2 years ago
This will most likely supplant #8 (and maybe even #9 and #10 which themselves could have been implemented with #8) since the Lua module can massage the return value of the command (or web service etc) into a user struct.
This will most likely supplant #8 (and maybe even #9 and #10 which themselves could have been implemented with #8) since the Lua module can massage the return value of the command (or web service etc) into a user struct.
User store implemented as a Lua module.
Parameters are:
file
: Path to the Lua file.params
: Variables to be passed into Lua.The Lua module will implement the following, which directly correspond to the
UserStore
trait:get_user(username)
: return aUser
table, ornil
login(username, password)
: login the user, return aUser
table if success,nil
on errorregistration_available
: returntrue
if registration is available,false
otherwise. Default implementation will returntrue
if theregister
method is available.register(username, password)
: registers a user, returnsUser
struct if success,nil
on error.This will most likely supplant #8 (and maybe even #9 and #10 which themselves could have been implemented with #8) since the Lua module can massage the return value of the command (or web service etc) into a user struct.