2020-02-20 16:15:13 +00:00
|
|
|
#include "webfuse/mocks/mock_authenticator.hpp"
|
2019-03-23 21:53:14 +00:00
|
|
|
|
2019-03-26 22:04:53 +00:00
|
|
|
#define WF_AUTHENTICATOR_COUNT 3
|
2019-03-23 21:53:14 +00:00
|
|
|
|
|
|
|
namespace
|
|
|
|
{
|
|
|
|
|
2019-03-26 22:04:53 +00:00
|
|
|
webfuse_test::Authenticator * g_authenticators[WF_AUTHENTICATOR_COUNT];
|
2019-03-23 21:53:14 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2019-03-26 22:04:53 +00:00
|
|
|
namespace webfuse_test
|
2019-03-23 21:53:14 +00:00
|
|
|
{
|
|
|
|
|
|
|
|
void set_authenticator(Authenticator * authenticator)
|
|
|
|
{
|
|
|
|
set_authenticator(0, authenticator);
|
|
|
|
}
|
|
|
|
|
|
|
|
void set_authenticator(size_t i, Authenticator * authenticator)
|
|
|
|
{
|
|
|
|
g_authenticators[i] = authenticator;
|
|
|
|
}
|
|
|
|
|
2020-06-10 20:18:34 +00:00
|
|
|
bool authenticate(struct wf_credentials const * creds, void * user_data)
|
2019-03-23 21:53:14 +00:00
|
|
|
{
|
|
|
|
return g_authenticators[0]->authenticate(creds, user_data);
|
|
|
|
}
|
|
|
|
|
2020-06-10 20:18:34 +00:00
|
|
|
bool authenticate_1(struct wf_credentials const * creds, void * user_data)
|
2019-03-23 21:53:14 +00:00
|
|
|
{
|
|
|
|
return g_authenticators[1]->authenticate(creds, user_data);
|
|
|
|
}
|
|
|
|
|
2020-06-10 20:18:34 +00:00
|
|
|
bool authenticate_2(struct wf_credentials const * creds, void * user_data)
|
2019-03-23 21:53:14 +00:00
|
|
|
{
|
|
|
|
return g_authenticators[2]->authenticate(creds, user_data);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|