Add userToken Auth

This commit is contained in:
brindosch
2019-08-29 18:17:06 +02:00
parent 7f444a5a92
commit 034bd164a2
5 changed files with 113 additions and 4 deletions

View File

@@ -61,6 +61,19 @@ public:
///
const bool & isLocalAdminAuthRequired() { return _localAdminAuthRequired; };
///
/// @brief Check if Hyperion user has default password
/// @return True if so, else false
///
const bool hasHyperionDefaultPw() { return isUserAuthorized("Hyperion","hyperion"); };
///
/// @brief Get the current valid token for user. Make sure this call is allowed!
/// @param For the defined user
/// @return The token
///
const QString getUserToken(const QString & usr = "Hyperion");
///
/// @brief Reset Hyperion user
/// @return True on success else false
@@ -89,6 +102,14 @@ public:
///
bool isTokenAuthorized(const QString& token);
///
/// @brief Check if token is authorized
/// @param usr The username
/// @param token The token
/// @return True if authorized else false
///
bool isUserTokenAuthorized(const QString& usr, const QString& token);
///
/// @brief Change password of user
/// @param user The username