1
0
mirror of https://github.com/falk-werner/webfuse-provider synced 2024-09-28 11:20:50 +00:00
falk-werner_webfuse-provider/test/mock_authenticator.hpp
Falk Werner 48185776b6
Feature/authentication (#14)
* makes wsfs_server_config opaque

* feature: try to create mount point, if not present

* fixes server start failure due to existing mountpoint

* added basic authentication infrastructure

* makes wsfs_server_config opaque

* feature: try to create mount point, if not present

* fixes server start failure due to existing mountpoint

* added basic authentication infrastructure

* added unit tests for credentials

* added unit tests for authenticators

* propagates authenticators to server protocol

* enabled username authentication in daemon example

* adds example to compute password hash

* adds infrastructure to execute commands

* added userdb to encapsulate authentication stuff

* adds session and session_manager

* fixes warning about unused param

* moves some logic from server_protocol to session

* makes wsfs_server_config opaque

* feature: try to create mount point, if not present

* fixes server start failure due to existing mountpoint

* added basic authentication infrastructure

* makes wsfs_server_config opaque

* added unit tests for credentials

* added unit tests for authenticators

* propagates authenticators to server protocol

* enabled username authentication in daemon example

* adds example to compute password hash

* adds infrastructure to execute commands

* added userdb to encapsulate authentication stuff

* adds session and session_manager

* fixes warning about unused param

* moves some logic from server_protocol to session

* updates libcrypto to version 1.1.0
2019-03-23 22:53:14 +01:00

35 lines
830 B
C++

#ifndef MOCK_AUTHENTICATOR_H
#define MOCK_AUTHENTICATOR_H
#include <gmock/gmock.h>
#include "wsfs/adapter/authenticator.h"
namespace wsfs_test
{
class Authenticator
{
public:
virtual ~Authenticator() { }
virtual bool authenticate(
struct wsfs_credentials * credentials,
void * user_data) = 0;
};
class MockAuthenticator: public Authenticator
{
public:
MOCK_METHOD2(authenticate, bool (struct wsfs_credentials * credentials, void * user_data));
};
void set_authenticator(Authenticator * authenticator);
void set_authenticator(size_t index, Authenticator * authenticator);
bool authenticate(struct wsfs_credentials * creds, void * user_data);
bool authenticate_1(struct wsfs_credentials * creds, void * user_data);
bool authenticate_2(struct wsfs_credentials * creds, void * user_data);
}
#endif