![]() |
MySQL 9.3.0
Source Code Documentation
|
#include <handler.h>
Public Types | |
using | HttpUri = ::http::base::Uri |
using | Protocol = ::mrs::endpoint::handler::Protocol |
![]() | |
enum class | Authorization { kNotNeeded , kRequires , kCheck } |
using | SqlSession = mysqlrouter::MySQLSession |
using | RequestContext = mrs::rest::RequestContext |
using | Parameters = mrs::interface::Parameters |
using | HttpResult = mrs::interface::HttpResult |
Public Member Functions | |
Handler (const Protocol protocol, const std::string &url_host, const std::vector< std::string > &rest_path_matcher, const std::optional< std::string > &options, interface::AuthorizeManager *auth_manager) | |
~Handler () override | |
void | initialize (const Configuration &configuration) override |
const std::string & | get_url_host () const override |
const std::string & | get_protocol () const override |
bool | may_check_access () const override |
void | authorization (RequestContext *ctxt) override |
bool | request_begin (RequestContext *ctxt) override |
void | request_end (RequestContext *ctxt) override |
bool | request_error (RequestContext *ctxt, const http::Error &e) override |
Error handler. More... | |
const interface::Options & | get_options () const override |
void | throw_unauthorize_when_check_auth_fails (RequestContext *) |
uint32_t | check_privileges (const std::vector< database::entry::AuthPrivilege > &privileges, const UniversalId &service_id, const std::string &service_path, const UniversalId &schema_id, const std::string &schema_path, const UniversalId &db_object_id, const std::string &db_object_path) |
![]() | |
virtual | ~RestHandler ()=default |
virtual void | initialize (const Configuration &configuration)=0 |
virtual Authorization | requires_authentication () const =0 |
virtual const std::string & | get_service_path () const =0 |
virtual const std::string & | get_schema_path () const =0 |
virtual const std::string & | get_db_object_path () const =0 |
virtual UniversalId | get_service_id () const =0 |
virtual UniversalId | get_db_object_id () const =0 |
virtual UniversalId | get_schema_id () const =0 |
virtual uint32_t | get_access_rights () const =0 |
virtual HttpResult | handle_get (RequestContext *ctxt)=0 |
virtual HttpResult | handle_post (RequestContext *ctxt, const std::vector< uint8_t > &document)=0 |
virtual HttpResult | handle_delete (RequestContext *ctxt)=0 |
virtual HttpResult | handle_put (RequestContext *ctxt)=0 |
Protected Member Functions | |
const std::string & | empty_path () const |
Protected Attributes | |
interface::Options | options_ |
const std::string | url_host_ |
std::vector< std::string > | rest_path_matcher_ |
std::vector< void * > | handler_id_ |
interface::AuthorizeManager * | authorization_manager_ |
const std::string | protocol_ |
std::shared_ptr< Configuration > | configuration_ |
bool | log_level_is_debug_ |
bool | log_level_is_info_ |
using mrs::rest::Handler::HttpUri = ::http::base::Uri |
Handler::Handler | ( | const Protocol | protocol, |
const std::string & | url_host, | ||
const std::vector< std::string > & | rest_path_matcher, | ||
const std::optional< std::string > & | options, | ||
interface::AuthorizeManager * | auth_manager | ||
) |
|
override |
|
overridevirtual |
Implements mrs::interface::RestHandler.
uint32_t Handler::check_privileges | ( | const std::vector< database::entry::AuthPrivilege > & | privileges, |
const UniversalId & | service_id, | ||
const std::string & | service_path, | ||
const UniversalId & | schema_id, | ||
const std::string & | schema_path, | ||
const UniversalId & | db_object_id, | ||
const std::string & | db_object_path | ||
) |
|
protected |
|
overridevirtual |
Implements mrs::interface::RestHandler.
|
overridevirtual |
Implements mrs::interface::RestHandler.
|
overridevirtual |
Implements mrs::interface::RestHandler.
|
override |
|
overridevirtual |
Implements mrs::interface::RestHandler.
|
overridevirtual |
Implements mrs::interface::RestHandler.
|
overridevirtual |
Implements mrs::interface::RestHandler.
|
overridevirtual |
Error handler.
Method that allows customization of error handling.
Implements mrs::interface::RestHandler.
void Handler::throw_unauthorize_when_check_auth_fails | ( | RequestContext * | ctxt | ) |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |