MySQL 8.4.0
Source Code Documentation
event_tracking_authentication_service.h
Go to the documentation of this file.
1/* Copyright (c) 2022, 2024, Oracle and/or its affiliates.
2
3This program is free software; you can redistribute it and/or modify
4it under the terms of the GNU General Public License, version 2.0,
5as published by the Free Software Foundation.
6
7This program is designed to work with certain software (including
8but not limited to OpenSSL) that is licensed under separate terms,
9as designated in a particular file or component or in included license
10documentation. The authors of MySQL hereby grant you an additional
11permission to link the program and your derivative works with the
12separately licensed software that they have either included with
13the program or referenced in the documentation.
14
15This program is distributed in the hope that it will be useful,
16but WITHOUT ANY WARRANTY; without even the implied warranty of
17MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18GNU General Public License, version 2.0, for more details.
19
20You should have received a copy of the GNU General Public License
21along with this program; if not, write to the Free Software
22Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
23
24#ifndef MYSQL_COMPONENTS_SERVICES_EVENT_TRACKING_AUTHENTICATION_SERVICE_H
25#define MYSQL_COMPONENTS_SERVICES_EVENT_TRACKING_AUTHENTICATION_SERVICE_H
26
29
30/**
31 @file mysql/components/services/event_tracking_authentication_service.h
32 Authentication event tracking.
33
34 @sa @ref EVENT_TRACKING_AUTHENTICATION_CONSUMER_EXAMPLE
35*/
36
37/**
38 @defgroup event_tracking_services_inventory Event tracking services
39 @ingroup group_components_services_inventory
40*/
41
42/** A handle to obtain details related to authentication event */
44
45/** A handle to obtain details related to authentication method */
47
48/**
49 @ingroup event_tracking_services_inventory
50
51 @anchor EVENT_TRACKING_AUTHENTICATION_SERVICE
52
53 A service to track and consume authentication events.
54
55 Producer of the event will broadcast notify all interested
56 consumers of the event.
57
58 @sa @ref EVENT_TRACKING_AUTHENTICATION_CONSUMER_EXAMPLE
59*/
60BEGIN_SERVICE_DEFINITION(event_tracking_authentication)
61
62/**
63 Process a authentication event
64
65 @param [in] common_handle Handle for common event trackign data
66 @param [in] handle Handle to retrieve additional data
67 about event. It is guaranteed to be
68 valid for the duration of the API.
69 @param [in] data Event specific data
70
71 @returns Status of processing the event
72 @retval false Success
73 @retval true Error
74*/
77
78END_SERVICE_DEFINITION(event_tracking_authentication)
79
80/**
81 @ingroup event_tracking_services_inventory
82
83 @anchor EVENT_TRACKING_AUTHENTICATION_INFORMATION
84
85 A service to fetch additional data about authentication event
86*/
87
88BEGIN_SERVICE_DEFINITION(event_tracking_authentication_information)
89
90/**
91 Initialize authentication event data handle
92
93 @param [out] handle Handle to authentication event data
94
95 @returns Status of handle creation
96 @retval false Success
97 @retval true Error
98*/
101
102/**
103 Deinitialize authentication event data handle
104
105 @param [in, out] handle Handle to be deinitialized
106
107 @returns Status of operation
108 @retval false Success
109 @retval true Error
110*/
113
114/**
115 Get information about given authentication event
116
117 Accepted names and corresponding value type
118
119 "authentcation_method_count" -> unsigned int *
120 "new_user" -> mysql_cstring_with_length *
121 "new_host" -> mysql_cstring_with_length *
122 "is_role" -> boolean *
123 "authentication_method_info" -> event_tracking_authentication_method_handle
124
125 @param [in] handle Event tracking information handle
126 @param [in] name Data identifier
127 @param [out] value Value of the identifier
128
129 @returns status of the operation
130 @retval false Success
131 @retval true Error
132*/
135 const char *name, void *value));
136
137END_SERVICE_DEFINITION(event_tracking_authentication_information)
138
139/**
140 @ingroup event_tracking_services_inventory
141
142 @anchor EVENT_TRACKING_AUTHENTICATION_METHOD
143
144 A service to fetch additional data about authentication method
145*/
146
147BEGIN_SERVICE_DEFINITION(event_tracking_authentication_method)
148
149/**
150 Get information about authentication method
151
152 Accepted names and corresponding value type
153
154 "name" -> mysql_cstring_with_length *
155
156 @param [in] handle Handle to authentication method structure
157 Valid until
158 @sa event_tracking_authentication_information_handle_imp
159 is valid
160 @param [in] index Location
161 @param [in] name Data identifier
162 @param [out] value Data value
163
164 @returns status of the operation
165 @retval false Success
166 @retval true Error
167*/
169 unsigned int index, const char *name, void *value));
170
171END_SERVICE_DEFINITION(event_tracking_authentication_method)
172
173#endif // !MYSQL_COMPONENTS_SERVICES_EVENT_TRACKING_AUTHENTICATION_SERVICE_H
static mysql_service_status_t deinit()
Component deinitialization.
Definition: audit_api_message_emit.cc:580
static mysql_service_status_t init()
Component initialization.
Definition: audit_api_message_emit.cc:571
Data for authentication event tracking.
struct event_tracking_authentication_method_handle_imp * event_tracking_authentication_method_handle
A handle to obtain details related to authentication method.
Definition: event_tracking_authentication_service.h:46
struct event_tracking_authentication_information_handle_imp * event_tracking_authentication_information_handle
A handle to obtain details related to authentication event.
Definition: event_tracking_authentication_service.h:43
void get(PSI_field *, PSI_longlong *) noexcept
Definition: pfs_plugin_column_bigint_v1_all_empty.cc:32
static int handle(int sql_errno, const char *sqlstate, const char *message, void *state)
Bridge function between the C++ API offered by this module and the C API of the parser service.
Definition: services.cc:64
static bool notify(SvcTypes svc_type, Notification_context &ctx)
Auxiliary function to engage the service registry to notify a set of listeners.
Definition: notification.cc:87
#define END_SERVICE_DEFINITION(name)
A macro to end the last Service definition started with the BEGIN_SERVICE_DEFINITION macro.
Definition: service.h:91
#define BEGIN_SERVICE_DEFINITION(name)
Declares a new Service.
Definition: service.h:86
#define DEFINE_SERVICE_HANDLE(name)
Defines an object type that is meant for carrying handles to the implementation-specific objects used...
Definition: service.h:129
#define DECLARE_BOOL_METHOD(name, args)
Declares a method that returns bool as a part of the Service definition.
Definition: service.h:112
case opt name
Definition: sslopt-case.h:29
Structure for Authentication event tracking.
Definition: event_tracking_authentication_defs.h:79