mirror of
https://github.com/falk-werner/webfuse-provider
synced 2026-03-02 04:09:18 +00:00
changed credentials API
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
#include <webfuse/provider/operation/open.h>
|
||||
#include <webfuse/provider/operation/close.h>
|
||||
#include <webfuse/provider/operation/read.h>
|
||||
#include <webfuse/provider/credentials.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
@@ -228,25 +229,15 @@ extern WFP_API void wfp_client_config_set_onread(
|
||||
wfp_read_fn * handler);
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/// \brief Enabled authentication with username and password.
|
||||
///
|
||||
/// Sets username and password for built-in username authentication.
|
||||
/// \brief Enabled authentication.
|
||||
///
|
||||
/// \param config pointer to client configuration
|
||||
/// \param username pointer to username
|
||||
/// \param password pointer to password
|
||||
/// \param get_credentials pointer to function providing credentials when
|
||||
// needed.
|
||||
//------------------------------------------------------------------------------
|
||||
extern WFP_API void wfp_client_config_set_username_credentials(
|
||||
extern WFP_API void wfp_client_config_enable_authentication(
|
||||
struct wfp_client_config * config,
|
||||
char const * username,
|
||||
char const * password);
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
//------------------------------------------------------------------------------
|
||||
extern WFP_API void wfp_client_config_set_generic_credentials(
|
||||
struct wfp_client_config * config,
|
||||
char const * credentials_type,
|
||||
char const * contents[]);
|
||||
wfp_get_credentials_fn * get_credentials);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
30
include/webfuse/provider/credentials.h
Normal file
30
include/webfuse/provider/credentials.h
Normal file
@@ -0,0 +1,30 @@
|
||||
#ifndef WF_PROVIDER_CREDENTIALS_H
|
||||
#define WF_PROVIDER_CREDENTIALS_H
|
||||
|
||||
#include <webfuse/provider/api.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
struct wfp_credentials;
|
||||
|
||||
typedef void wfp_get_credentials_fn(
|
||||
struct wfp_credentials * credentials,
|
||||
void * user_data);
|
||||
|
||||
extern WFP_API void wfp_credentials_set_type(
|
||||
struct wfp_credentials * credentials,
|
||||
char const * type);
|
||||
|
||||
extern WFP_API void wfp_credentials_add(
|
||||
struct wfp_credentials * credentials,
|
||||
char const * key,
|
||||
char const * value);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -14,6 +14,7 @@
|
||||
#include <webfuse/provider/client_config.h>
|
||||
#include <webfuse/provider/client_protocol.h>
|
||||
#include <webfuse/provider/dirbuffer.h>
|
||||
#include <webfuse/provider/credentials.h>
|
||||
|
||||
#include <webfuse/provider/operation/error.h>
|
||||
#include <webfuse/provider/operation/lookup.h>
|
||||
|
||||
Reference in New Issue
Block a user