Add tests. Cleanup formatting.
This commit is contained in:
1 parent
5ef2e0b929
commit
0b4a73e2b7
10 files changed
+159
-105
No files matched your search
@@ -25,15 +25,15 @@ extern "C"
|
||||
// Stuff we're "exporting" for the dynamic loading.
|
||||
extern "C"
|
||||
{
|
||||
int mosquitto_plugin_version(int supported_version_count, const int * supported_versions);
|
||||
int mosquitto_plugin_version(int supported_version_count, const int *supported_versions);
|
||||
int mosquitto_plugin_init(
|
||||
mosquitto_plugin_id_t * identifier,
|
||||
void ** userdata,
|
||||
struct mosquitto_opt * options,
|
||||
mosquitto_plugin_id_t *identifier,
|
||||
void **userdata,
|
||||
struct mosquitto_opt *options,
|
||||
int option_count);
|
||||
int mosquitto_plugin_cleanup(void * userdata, struct mosquitto_opt * options, int option_count);
|
||||
int mosquitto_plugin_cleanup(void *userdata, struct mosquitto_opt *options, int option_count);
|
||||
}
|
||||
// My functions
|
||||
int j7s_auth_basic_auth_callback(int event, void * event_data, void * userdata);
|
||||
int j7s_acl_check_callback(int event, void * event_data, void * userdata);
|
||||
int j7s_disconnect_callback(int event, void * event_data, void * userdata);
|
||||
int j7s_auth_basic_auth_callback(int event, void *event_data, void *userdata);
|
||||
int j7s_acl_check_callback(int event, void *event_data, void *userdata);
|
||||
int j7s_disconnect_callback(int event, void *event_data, void *userdata);
|
||||
@@ -17,17 +17,14 @@
|
||||
#include <string>
|
||||
#include <tuple>
|
||||
|
||||
std::optional<std::string> read_key(const std::string & key_file);
|
||||
std::optional<std::string> read_key(const std::string &key_file);
|
||||
|
||||
std::tuple<bool, std::chrono::time_point<std::chrono::system_clock>> validate(
|
||||
const std::string & token,
|
||||
const std::string & username,
|
||||
const std::string & pub_key);
|
||||
const std::string &token, const std::string &username, const std::string &pub_key);
|
||||
|
||||
std::string gen_token(
|
||||
const std::string & issuer,
|
||||
const std::string & username,
|
||||
const std::string & pub_key,
|
||||
const std::string & priv_key,
|
||||
const std::chrono::time_point<std::chrono::system_clock> & issue_time,
|
||||
const std::chrono::time_point<std::chrono::system_clock> & expr_time);
|
||||
const std::string &username,
|
||||
const std::string &pub_key,
|
||||
const std::string &priv_key,
|
||||
const std::chrono::time_point<std::chrono::system_clock> &issue_time,
|
||||
const std::chrono::time_point<std::chrono::system_clock> &expr_time);
|
||||
Reference in new issue
Block a user