|
Leosac
0.8.0
Open Source Access Control
|
Go to the documentation of this file.
24 #include <nlohmann/json.hpp>
80 bool allowed(
const std::string &cmd);
void clear_authentication()
void hook_before_request()
A hook that is called before a request processing method will be invoked.
json get_leosac_version(const json &)
Retrieve the current version number of Leosac.
Auth::UserPtr current_user() const
Retrieve the user associated with the session, or nullptr.
std::shared_ptr< Token > TokenPtr
std::shared_ptr< User > UserPtr
APISession(WSServer &server)
std::unique_ptr< SecurityContext > security_
bool allowed(const std::string &cmd)
Is this API client allowed to perform the request cmd ?
void mark_authenticated(Auth::TokenPtr token)
Auth::UserId current_user_id() const
Retrieve the UserId of the user associated with this API session.
json logout(const json &req)
Log an user out.
json system_overview(const json &req)
Presents an overview of the system to the end user.
This is the header file for a generated source file, GitSHA1.cpp.
WSServer & server_
The API server.
The implementation class that runs the websocket server.
AuthStatus
Enumeration describing the authentication status of a client.
Auth::TokenPtr current_token() const
Retrieve the currently in-use token, or nullptr.
This is the application-level object that provide the API.
SecurityContext & security_context() const
json authenticate_with_token(const json &req)
Attempt to authenticate with a (previously generated) authentication token.
json create_auth_token(const json &req)
Generate an authentication token using the user credential, and logs the user in on success.
Auth::TokenPtr current_auth_token_
The token we are authenticated with.
void abort_session()
Abort the current websocket session.
A SecurityContext is used to query permission while doing an operation.