21 #include "core/audit/WSAPICall_odb.h" 31 , database_operations_(0)
37 ASSERT_LOG(database,
"Database cannot be null.");
41 database->persist(audit);
122 std::stringstream ss;
127 ss <<
"Websocket API call by user " <<
author->username() <<
" to " 132 ss <<
"Websocket API call by anonymous to " <<
method() <<
" took " virtual void database_operations(uint16_t nb_operation) override
The number of database queries.
APIStatusCode status_code_
Status code of the response.
virtual void response_content(const std::string &string) override
Acts like an odb::transaction, with the exception that it will becomes the active transaction at cons...
This is the header file for a generated source file, GitSHA1.cpp.
virtual std::string generate_description() const override
Generate a description for this event.
std::string uuid_
The UUID of the request.
virtual APIStatusCode status_code() const override
std::string response_content_
Copy of the JSON content of the response.
virtual void author(Auth::UserPtr user) override
Set the author of the entry.
size_t duration_
How long did it take for the Audit object to be finalized.
virtual bool finalized() const override
Is this entry finalized.
APIStatusCode
Those are the Leosac API status code.
uint16_t database_operations_
Count the number of database operation that happened while processing this API call.
static WSAPICallPtr create(const DBPtr &database)
std::string source_endpoint_
The source IP:Port of the client who made the request.
virtual const std::string & method() const override
#define ASSERT_LOG(cond, msg)
virtual const std::string & source_endpoint() const override
virtual const std::string & uuid() const override
virtual const std::string & status_string() const override
Auth::UserLPtr author_
The user at the source of the entry.
std::string request_content_
Copy of the JSON content of the request.
std::shared_ptr< WSAPICall > WSAPICallPtr
std::shared_ptr< odb::database > DBPtr
virtual void request_content(const std::string &string) override
The (JSON) content of the request.
std::string status_string_
The status string of the response.
Provides the implementation of IWSAPICall.
void database(DBPtr db)
Set the database pointer.
The Audit namespace provides classes and facilities to keep track of what's happening on the Leosac d...