1
0
mirror of https://github.com/falk-werner/webfuse-provider synced 2024-10-27 20:44:10 +00:00
falk-werner_webfuse-provider/lib/wsfs/adapter/session.h

65 lines
1.2 KiB
C
Raw Normal View History

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 21:53:14 +00:00
#ifndef WSFS_ADAPTER_SESSION_H
#define WSFS_ADAPTER_SESSION_H
#ifndef __cplusplus
#include <stdbool.h>
#include <stddef.h>
#else
#include <cstddef>
using std::size_t;
#endif
#include "wsfs/message_queue.h"
#ifdef __cplusplus
extern "C"
{
#endif
struct lws;
struct wsfs_message;
struct wsfs_credentials;
struct wsfs_authenticators;
struct wsfs_jsonrpc_server;
struct wsfs_session
{
struct lws * wsi;
bool is_authenticated;
struct wsfs_message_queue queue;
struct wsfs_authenticators * authenticators;
struct wsfs_jsonrpc_server * rpc;
};
extern void wsfs_session_init(
struct wsfs_session * session,
struct lws * wsi,
struct wsfs_authenticators * authenticators,
struct wsfs_jsonrpc_server * rpc);
extern void wsfs_session_authenticate(
struct wsfs_session * session,
struct wsfs_credentials * creds);
extern bool wsfs_session_send(
struct wsfs_session * session,
struct wsfs_message * message);
extern void wsfs_session_receive(
struct wsfs_session * session,
char const * data,
size_t length);
extern void wsfs_session_onwritable(
struct wsfs_session * session);
extern void wsfs_session_cleanup(
struct wsfs_session * session);
#ifdef __cplusplus
}
#endif
#endif