mirror of
https://github.com/falk-werner/webfused
synced 2026-03-02 04:09:19 +00:00
add authenticator to server config
This commit is contained in:
@@ -16,3 +16,9 @@ wfd_authenticator_authenticate(
|
||||
credentials, authenticator.data);
|
||||
}
|
||||
|
||||
char const *
|
||||
wfd_authenticator_get_type(
|
||||
struct wfd_authenticator authenticator)
|
||||
{
|
||||
return authenticator.vtable->get_type(authenticator.data);
|
||||
}
|
||||
|
||||
@@ -12,10 +12,15 @@ typedef void
|
||||
wfd_authenticator_dispose_fn(
|
||||
void * data);
|
||||
|
||||
typedef char const *
|
||||
wfd_authenticator_get_type_fn(
|
||||
void * data);
|
||||
|
||||
struct wfd_authenticator_vtable
|
||||
{
|
||||
wfd_authenticator_dispose_fn * dispose;
|
||||
wf_authenticate_fn * authenticate;
|
||||
wfd_authenticator_get_type_fn * get_type;
|
||||
};
|
||||
|
||||
struct wfd_authenticator
|
||||
@@ -33,6 +38,10 @@ wfd_authenticator_authenticate(
|
||||
struct wfd_authenticator authenticator,
|
||||
struct wf_credentials * credentials);
|
||||
|
||||
extern char const *
|
||||
wfd_authenticator_get_type(
|
||||
struct wfd_authenticator authenticator);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -48,11 +48,20 @@ wfd_file_authenticator_authenticate(
|
||||
return result;
|
||||
}
|
||||
|
||||
static char const *
|
||||
wfd_file_authenticator_get_type(
|
||||
void * data)
|
||||
{
|
||||
(void) data;
|
||||
return "username";
|
||||
}
|
||||
|
||||
static struct wfd_authenticator_vtable
|
||||
wfd_file_authenticator_vtable =
|
||||
{
|
||||
.dispose = &wfd_file_authenticator_dispose,
|
||||
.authenticate = &wfd_file_authenticator_authenticate
|
||||
.authenticate = &wfd_file_authenticator_authenticate,
|
||||
.get_type = &wfd_file_authenticator_get_type
|
||||
};
|
||||
|
||||
bool
|
||||
|
||||
Reference in New Issue
Block a user