droplet 1.3.0
A multipurpose Discord bot with the hacker in mind
Loading...
Searching...
No Matches
AuthUtils.hpp File Reference
#include <cstddef>
#include <string>
#include <string_view>
#include "Poco/Net/HTTPServerRequest.h"
Include dependency graph for AuthUtils.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  AuthUtil

Enumerations

enum class  AuthClearance {
  NONE = 0 , PUBLIC = 10 , PRIVATE = 100 , SECRET = 1000 ,
  TOP_SECRET = 10000 , BLACK = 100000
}

Functions

bool constant_time_equal (std::string_view a, std::string_view b) noexcept
bool jwt_secret_is_strong (std::string_view secret) noexcept
std::string hashPassword (const std::string &password)
bool verifyPassword (const std::string &password, const std::string &storedHash)
bool jwt_grants_clearance (const std::string &jwt, const std::string &hmac_secret, int min_clearance)

Variables

constexpr std::size_t k_jwt_secret_min_bytes {32}
constexpr std::size_t k_password_min_length {8}

Enumeration Type Documentation

◆ AuthClearance

enum class AuthClearance
strong
Enumerator
NONE 
PUBLIC 
PRIVATE 
SECRET 
TOP_SECRET 
BLACK 

Function Documentation

◆ constant_time_equal()

bool constant_time_equal ( std::string_view a,
std::string_view b )
nodiscardnoexcept

◆ hashPassword()

std::string hashPassword ( const std::string & password)
nodiscard

◆ jwt_grants_clearance()

bool jwt_grants_clearance ( const std::string & jwt,
const std::string & hmac_secret,
int min_clearance )
nodiscard

◆ jwt_secret_is_strong()

bool jwt_secret_is_strong ( std::string_view secret)
nodiscardnoexcept

◆ verifyPassword()

bool verifyPassword ( const std::string & password,
const std::string & storedHash )
nodiscard

Variable Documentation

◆ k_jwt_secret_min_bytes

std::size_t k_jwt_secret_min_bytes {32}
constexpr

◆ k_password_min_length

std::size_t k_password_min_length {8}
constexpr