Leosac  0.8.0
Open Source Access Control
Leosac::Module::WebSockAPI::AuditGet Class Reference

Query the audit log. More...

#include <AuditGet.hpp>

+ Inheritance diagram for Leosac::Module::WebSockAPI::AuditGet:
+ Collaboration diagram for Leosac::Module::WebSockAPI::AuditGet:

Public Member Functions

 AuditGet (RequestContext ctx)
 
- Public Member Functions inherited from Leosac::Module::WebSockAPI::MethodHandler
 MethodHandler (RequestContext ctx)
 
virtual ~MethodHandler ()=default
 
json process (const ClientMessage &msg)
 The public process() method. More...
 
UserSecurityContextsecurity_context ()
 
ExecutionContext exec_context ()
 Returns a representation of the execution context of this request. More...
 

Static Public Member Functions

static MethodHandlerUPtr create (RequestContext)
 
- Static Public Member Functions inherited from Leosac::Module::WebSockAPI::MethodHandler
static MethodHandlerUPtr create (RequestContext)
 An example method that should be implemented in all subclasses. More...
 

Protected Member Functions

std::vector< ActionActionParamrequired_permission (const json &req) const override
 Return a list of "Action" / "ActionParam" that must pass before the request is processed. More...
 

Private Member Functions

virtual json process_impl (const json &req) override
 The API method implementation. More...
 
std::string build_request_string (const json &req, int page, int page_size) const
 
std::string build_in_clause (const json &req) const
 Build the "WHERE typeid IN (...)" string based on the enabled types. More...
 
bool is_stringtype_sane (const std::string &str) const
 Check that a given string representing an audit type is sane. More...
 

Additional Inherited Members

- Public Types inherited from Leosac::Module::WebSockAPI::MethodHandler
using Factory = MethodHandlerUPtr(*)(RequestContext)
 
- Protected Attributes inherited from Leosac::Module::WebSockAPI::MethodHandler
RequestContext ctx_
 

Detailed Description

Query the audit log.

Request:

Response:

  • data: [JSON API data]
  • meta:
    • count: The number of entries that match the request.
    • totalPage: The number of page for to retrieve all items that match the request.

Definition at line 53 of file AuditGet.hpp.

Constructor & Destructor Documentation

◆ AuditGet()

AuditGet::AuditGet ( RequestContext  ctx)

Definition at line 40 of file AuditGet.cpp.

Member Function Documentation

◆ build_in_clause()

std::string AuditGet::build_in_clause ( const json req) const
private

Build the "WHERE typeid IN (...)" string based on the enabled types.

Definition at line 127 of file AuditGet.cpp.

◆ build_request_string()

std::string AuditGet::build_request_string ( const json req,
int  page,
int  page_size 
) const
private

Definition at line 104 of file AuditGet.cpp.

◆ create()

MethodHandlerUPtr AuditGet::create ( RequestContext  ctx)
static

Definition at line 45 of file AuditGet.cpp.

◆ is_stringtype_sane()

bool AuditGet::is_stringtype_sane ( const std::string &  str) const
private

Check that a given string representing an audit type is sane.

Definition at line 117 of file AuditGet.cpp.

◆ process_impl()

json AuditGet::process_impl ( const json req)
overrideprivatevirtual

The API method implementation.

Returns
A json object that will be assigned to the content key in the JSON message sent to the client.

Implements Leosac::Module::WebSockAPI::MethodHandler.

Definition at line 50 of file AuditGet.cpp.

◆ required_permission()

std::vector< ActionActionParam > AuditGet::required_permission ( const json req) const
overrideprotectedvirtual

Return a list of "Action" / "ActionParam" that must pass before the request is processed.

Implements Leosac::Module::WebSockAPI::MethodHandler.

Definition at line 95 of file AuditGet.cpp.


The documentation for this class was generated from the following files: