MySQL 9.3.0
Source Code Documentation
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
handler_authorize_status.h
Go to the documentation of this file.
1/*
2 Copyright (c) 2021, 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_MYSQL_REST_SERVICE_SRC_MRS_ENDPOINT_HANDLER_AUTHENTICATION_AUTHORIZE_STATUS_H_
27#define ROUTER_SRC_MYSQL_REST_SERVICE_SRC_MRS_ENDPOINT_HANDLER_AUTHENTICATION_AUTHORIZE_STATUS_H_
28
29#include <optional>
30#include <string>
31#include <vector>
32
34#include "helper/media_type.h"
39
40namespace mrs {
41namespace endpoint {
42namespace handler {
43
45 public:
46 HandlerAuthorizeStatus(const Protocol protocol, const std::string &url_host,
47 const UniversalId service_id,
48 const std::string &service_path,
49 const std::string &rest_path_matcher,
50 const std::string &options,
51 interface::AuthorizeManager *auth_manager);
52
54 bool may_check_access() const override;
55
56 UniversalId get_service_id() const override;
57 UniversalId get_db_object_id() const override;
58 UniversalId get_schema_id() const override;
59 const std::string &get_service_path() const override;
60 const std::string &get_schema_path() const override;
61 const std::string &get_db_object_path() const override;
62
63 uint32_t get_access_rights() const override;
64
65 HttpResult handle_get(RequestContext *ctxt) override;
67 const std::vector<uint8_t> &document) override;
69 HttpResult handle_put(RequestContext *ctxt) override;
70
71 protected:
74 using AuthRole = database::entry::AuthRole;
75
76 virtual void fill_authorization(Object &ojson, const AuthUser &user,
77 const std::vector<AuthRole> &roles);
78 static void fill_the_user_data(Object &ojson, const AuthUser &user,
79 const std::vector<AuthRole> &roles);
80 static std::string append_status_parameters(
81 const std::string &redirection_url, const http::Error &error);
82
84 const std::string service_path_;
85 std::string copy_url_;
86 std::string copy_path_;
87};
88
89} // namespace handler
90} // namespace endpoint
91} // namespace mrs
92
93#endif // ROUTER_SRC_MYSQL_REST_SERVICE_SRC_MRS_ENDPOINT_HANDLER_AUTHENTICATION_AUTHORIZE_STATUS_H_
Definition: protocol.h:33
The handler class is the interface for dynamically loadable storage engines.
Definition: handler.h:4618
Definition: serializer_to_text.h:47
Definition: handler_authorize_base.h:35
Definition: handler_authorize_status.h:44
HttpResult handle_get(RequestContext *ctxt) override
Definition: handler_authorize_status.cc:119
static void fill_the_user_data(Object &ojson, const AuthUser &user, const std::vector< AuthRole > &roles)
Definition: handler_authorize_status.cc:94
uint32_t get_access_rights() const override
Definition: handler_authorize_status.cc:89
bool may_check_access() const override
Definition: handler_authorize_status.cc:149
database::entry::AuthRole AuthRole
Definition: handler_authorize_status.h:74
UniversalId service_id_
Definition: handler_authorize_status.h:83
const std::string service_path_
Definition: handler_authorize_status.h:84
HttpResult handle_put(RequestContext *ctxt) override
Definition: handler_authorize_status.cc:145
static std::string append_status_parameters(const std::string &redirection_url, const http::Error &error)
Authorization requires_authentication() const override
Definition: handler_authorize_status.cc:57
UniversalId get_schema_id() const override
Definition: handler_authorize_status.cc:65
HttpResult handle_post(RequestContext *ctxt, const std::vector< uint8_t > &document) override
Definition: handler_authorize_status.cc:136
UniversalId get_db_object_id() const override
Definition: handler_authorize_status.cc:70
database::entry::AuthUser AuthUser
Definition: handler_authorize_status.h:73
std::string copy_url_
Definition: handler_authorize_status.h:85
const std::string & get_db_object_path() const override
Definition: handler_authorize_status.cc:84
const std::string & get_service_path() const override
Definition: handler_authorize_status.cc:75
const std::string & get_schema_path() const override
Definition: handler_authorize_status.cc:79
virtual void fill_authorization(Object &ojson, const AuthUser &user, const std::vector< AuthRole > &roles)
Definition: handler_authorize_status.cc:108
HandlerAuthorizeStatus(const Protocol protocol, const std::string &url_host, const UniversalId service_id, const std::string &service_path, const std::string &rest_path_matcher, const std::string &options, interface::AuthorizeManager *auth_manager)
Definition: handler_authorize_status.cc:46
UniversalId get_service_id() const override
Definition: handler_authorize_status.cc:61
std::string copy_path_
Definition: handler_authorize_status.h:86
HttpResult handle_delete(RequestContext *ctxt) override
Definition: handler_authorize_status.cc:141
Definition: error.h:37
Definition: authorize_manager.h:58
Authorization
Definition: rest_handler.h:142
MysqlCacheManager::Object Object
Definition: mysql_cache_manager.cc:101
mrs::database::entry::AuthUser AuthUser
Definition: scram_handler.cc:54
ContentFileEndpoint::UniversalId UniversalId
Definition: content_file_endpoint.cc:39
Definition: authorize_manager.h:48
Definition: options.cc:57
Definition: http_result.h:37
Definition: request_context.h:47