MySQL 9.3.0
Source Code Documentation
option_parser.h
Go to the documentation of this file.
1/*
2 Copyright (c) 2023, 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_AUTHENTICATION_HELPER_OPTION_PARSER_H_
27#define ROUTER_SRC_REST_MRS_SRC_MRS_AUTHENTICATION_HELPER_OPTION_PARSER_H_
28
30
31#include <string>
32#include <vector>
33
34namespace mrs {
35namespace authentication {
36
38 public:
40
41 UserOptionsParser(const std::string &auth_string);
42
44
45 bool is_valid() const;
46 Result decode();
47
48 private:
49 template <typename T>
50 static std::string as_string(const std::vector<T> &v) {
51 return std::string(v.begin(), v.end());
52 }
53
54 void parse();
55
56 std::string auth_string_;
57 bool is_hmac_sha256{false};
58 bool has_iterations_{false};
59};
60
61} // namespace authentication
62} // namespace mrs
63
64#endif // ROUTER_SRC_REST_MRS_SRC_MRS_AUTHENTICATION_HELPER_OPTION_PARSER_H_
Definition: key_stored_informations.h:35
Definition: option_parser.h:37
std::string auth_string_
Definition: option_parser.h:56
void parse()
Definition: option_parser.cc:70
UserOptionsParser(const std::string &auth_string)
Definition: option_parser.cc:37
Result decode()
Definition: option_parser.cc:64
static std::string as_string(const std::vector< T > &v)
Definition: option_parser.h:50
bool is_valid() const
Definition: option_parser.cc:40
bool has_iterations_
Definition: option_parser.h:58
Result ksi
Definition: option_parser.h:43
bool is_hmac_sha256
Definition: option_parser.h:57
constexpr const char auth_string[]
Definition: sql_mfa.cc:42
Definition: authorize_manager.h:48