REDAC HybridController
Firmware for LUCIDAC/REDAC Teensy
|
A simple plaintext Username+Password authentification scheme backed against the EEPROM UserSettings. More...
#include <auth.h>
Public Member Functions | |
void | reset_defaults () |
reset to distributor defaults | |
bool | is_disabled () const |
bool | is_valid (const User &user, const std::string &pwd) |
bool | can_do (const User &user, SecurityLevel task) const |
void | fromJson (JsonObjectConst serialized_conf) |
void | toJson (JsonObject target) const |
void | status (JsonObject target) |
Static Public Attributes | |
static constexpr const char * | admin = "admin" |
The admin user is singular and has all permissions. | |
static constexpr const char * | user = "user" |
This is the default non-admin user. | |
Detailed Description
A simple plaintext Username+Password authentification scheme backed against the EEPROM UserSettings.
It lacks group managament but treats the username "admin" special as he can create new users. No users in the db mean the authentification is turned off.
Class also to be used within the UserSettings, syncs both with EEPROM and the distributor.
Member Function Documentation
◆ can_do()
|
inline |
Definition at line 71 of file auth.h.
References admin, net::auth::RequiresAdmin, net::auth::RequiresLogin, and user.
Referenced by net::auth::AuthentificationContext::can_do(), and net::auth::AuthentificationContext::hasBetterClearenceThen().
◆ fromJson()
FLASHMEM void net::auth::UserPasswordAuthentification::fromJson | ( | JsonObjectConst | serialized_conf | ) |
◆ is_disabled()
|
inline |
◆ is_valid()
|
inline |
◆ reset_defaults()
FLASHMEM void net::auth::UserPasswordAuthentification::reset_defaults | ( | ) |
reset to distributor defaults
Definition at line 29 of file auth.cpp.
References utils::HeapSingleton< VendorOTP >::get(), and LOG_ALWAYS.
Referenced by net::auth::Gatekeeper::reset_defaults().
◆ status()
FLASHMEM void net::auth::UserPasswordAuthentification::status | ( | JsonObject | target | ) |
◆ toJson()
FLASHMEM void net::auth::UserPasswordAuthentification::toJson | ( | JsonObject | target | ) | const |
Member Data Documentation
◆ admin
|
staticconstexpr |
◆ user
|
staticconstexpr |
This is the default non-admin user.
Definition at line 61 of file auth.h.
Referenced by can_do(), and is_valid().
The documentation for this class was generated from the following files: