1
0
mirror of https://github.com/falk-werner/webfuse-provider synced 2024-10-27 20:44:10 +00:00

change: make credentials const in wf_authenticate_fn (breaking change)

This commit is contained in:
Falk Werner 2020-06-10 22:18:34 +02:00
parent 16996e1f9a
commit b9eff8d100
5 changed files with 11 additions and 11 deletions

View File

@ -31,7 +31,7 @@ struct wf_credentials;
/// \see wf_server_protocol_add_authenticator /// \see wf_server_protocol_add_authenticator
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
typedef bool wf_authenticate_fn( typedef bool wf_authenticate_fn(
struct wf_credentials * credentials, struct wf_credentials const * credentials,
void * user_data); void * user_data);
#ifdef __cplusplus #ifdef __cplusplus

View File

@ -23,17 +23,17 @@ void set_authenticator(size_t i, Authenticator * authenticator)
g_authenticators[i] = authenticator; g_authenticators[i] = authenticator;
} }
bool authenticate(struct wf_credentials * creds, void * user_data) bool authenticate(struct wf_credentials const * creds, void * user_data)
{ {
return g_authenticators[0]->authenticate(creds, user_data); return g_authenticators[0]->authenticate(creds, user_data);
} }
bool authenticate_1(struct wf_credentials * creds, void * user_data) bool authenticate_1(struct wf_credentials const * creds, void * user_data)
{ {
return g_authenticators[1]->authenticate(creds, user_data); return g_authenticators[1]->authenticate(creds, user_data);
} }
bool authenticate_2(struct wf_credentials * creds, void * user_data) bool authenticate_2(struct wf_credentials const * creds, void * user_data)
{ {
return g_authenticators[2]->authenticate(creds, user_data); return g_authenticators[2]->authenticate(creds, user_data);
} }

View File

@ -12,22 +12,22 @@ class Authenticator
public: public:
virtual ~Authenticator() { } virtual ~Authenticator() { }
virtual bool authenticate( virtual bool authenticate(
struct wf_credentials * credentials, struct wf_credentials const * credentials,
void * user_data) = 0; void * user_data) = 0;
}; };
class MockAuthenticator: public Authenticator class MockAuthenticator: public Authenticator
{ {
public: public:
MOCK_METHOD2(authenticate, bool (struct wf_credentials * credentials, void * user_data)); MOCK_METHOD2(authenticate, bool (struct wf_credentials const * credentials, void * user_data));
}; };
void set_authenticator(Authenticator * authenticator); void set_authenticator(Authenticator * authenticator);
void set_authenticator(size_t index, Authenticator * authenticator); void set_authenticator(size_t index, Authenticator * authenticator);
bool authenticate(struct wf_credentials * creds, void * user_data); bool authenticate(struct wf_credentials const * creds, void * user_data);
bool authenticate_1(struct wf_credentials * creds, void * user_data); bool authenticate_1(struct wf_credentials const * creds, void * user_data);
bool authenticate_2(struct wf_credentials * creds, void * user_data); bool authenticate_2(struct wf_credentials const * creds, void * user_data);
} }

View File

@ -20,7 +20,7 @@ wf_mountpoint * create_mountpoint(
} }
bool authenticate( bool authenticate(
wf_credentials * credentials, wf_credentials const * credentials,
void * user_data) void * user_data)
{ {
(void) credentials; (void) credentials;

View File

@ -37,7 +37,7 @@ wf_test_integration_lowlevel_on_disconnected(
bool bool
wf_test_integration_lowlevel_authenticate( wf_test_integration_lowlevel_authenticate(
struct wf_credentials * credentials, struct wf_credentials const * credentials,
void * ) void * )
{ {
char const * username = wf_credentials_get(credentials, "username"); char const * username = wf_credentials_get(credentials, "username");