MySQL 9.3.0
Source Code Documentation
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
request_context.h
Go to the documentation of this file.
1/*
2 Copyright (c) 2022, 2025, Oracle and/or its affiliates.
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License, version 2.0,
6 as published by the Free Software Foundation.
7
8 This program is designed to work with certain software (including
9 but not limited to OpenSSL) that is licensed under separate terms,
10 as designated in a particular file or component or in included license
11 documentation. The authors of MySQL hereby grant you an additional
12 permission to link the program and your derivative works with the
13 separately licensed software that they have either included with
14 the program or referenced in the documentation.
15
16 This program is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 GNU General Public License for more details.
20
21 You should have received a copy of the GNU General Public License
22 along with this program; if not, write to the Free Software
23 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24*/
25
26#ifndef ROUTER_SRC_REST_MRS_SRC_MRS_REST_HANDLER_REQUESTCONTEXT_H_
27#define ROUTER_SRC_REST_MRS_SRC_MRS_REST_HANDLER_REQUESTCONTEXT_H_
28
29#include <memory>
30#include <optional>
31#include <string>
32
34#include "helper/http/url.h"
35#include "http/base/request.h"
38#include "mrs/http/cookie.h"
43
44namespace mrs {
45namespace rest {
46
55 using Matcher = ::http::server::MatcherInterface;
56
58 : auth_manager_{auth_manager} {}
60 interface::AuthorizeManager *auth_manager = nullptr)
61 : request{r},
62 auth_manager_{auth_manager},
63 accepts{get_in_headers().find_cstr("Accept")} {}
64
65 Request *request{nullptr};
66 std::shared_ptr<Session> session;
70 std::shared_ptr<interface::AuthorizeHandler> selected_handler;
71
75 std::shared_ptr<Matcher> redirection_validator;
76
79};
80
81} // namespace rest
82} // namespace mrs
83
84#endif // ROUTER_SRC_REST_MRS_SRC_MRS_REST_HANDLER_REQUESTCONTEXT_H_
Definition: cache_manager.h:41
MySqlCacheManager::CachedObject CachedObject
Definition: mysql_cache_manager.h:92
Definition: url.h:44
headers of a HTTP response/request.
Definition: headers.h:43
Definition: request.h:44
virtual const Uri & get_uri() const =0
virtual const Headers & get_input_headers() const =0
Definition: cookie.h:38
Definition: header_accept.h:53
Definition: session_manager.h:64
Definition: authorize_manager.h:58
Definition: matcher.h:35
mrs::http::HeaderAccept HeaderAccept
Definition: handler_db_object_table.cc:80
Request::Headers Headers
Definition: request.cc:34
helper::http::Url Url
Definition: sasl_handler.cc:75
mrs::database::entry::AuthUser AuthUser
Definition: scram_handler.cc:54
AuthorizeManager::Session Session
Definition: authorize_manager.cc:75
Definition: authorize_manager.h:48
const mysql_service_registry_t * r
Definition: pfs_example_plugin_employee.cc:86
RestClient::Request Request
Definition: rest_client.cc:29
Definition: request_context.h:47
std::shared_ptr< Session > session
Definition: request_context.h:66
RequestContext(Request *r, interface::AuthorizeManager *auth_manager=nullptr)
Definition: request_context.h:59
std::shared_ptr< Matcher > redirection_validator
Definition: request_context.h:75
HeaderAccept accepts
Definition: request_context.h:72
AuthUser user
Definition: request_context.h:73
Request * request
Definition: request_context.h:65
interface::AuthorizeManager * auth_manager_
Definition: request_context.h:69
bool post_authentication
Definition: request_context.h:74
Url get_http_url()
Definition: request_context.h:77
std::shared_ptr< interface::AuthorizeHandler > selected_handler
Definition: request_context.h:70
SqlSessionCached sql_session_cache
Definition: request_context.h:68
RequestContext(interface::AuthorizeManager *auth_manager=nullptr)
Definition: request_context.h:57
const Headers & get_in_headers()
Definition: request_context.h:78
::mrs::database::entry::AuthUser AuthUser
Definition: request_context.h:49
http::Cookie cookies
Definition: request_context.h:67