MySQL 8.3.0
Source Code Documentation
event_tracking_authentication_service.h
Go to the documentation of this file.
1/* Copyright (c) 2022, 2023, 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 also distributed 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 included with MySQL.
13
14This program is distributed in the hope that it will be useful,
15but WITHOUT ANY WARRANTY; without even the implied warranty of
16MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17GNU General Public License, version 2.0, for more details.
18
19You should have received a copy of the GNU General Public License
20along with this program; if not, write to the Free Software
21Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
22
23#ifndef MYSQL_COMPONENTS_SERVICES_EVENT_TRACKING_AUTHENTICATION_SERVICE_H
24#define MYSQL_COMPONENTS_SERVICES_EVENT_TRACKING_AUTHENTICATION_SERVICE_H
25
28
29/**
30 @file mysql/components/services/event_tracking_authentication_service.h
31 Authentication event tracking.
32
33 @sa @ref EVENT_TRACKING_AUTHENTICATION_CONSUMER_EXAMPLE
34*/
35
36/**
37 @defgroup event_tracking_services_inventory Event tracking services
38 @ingroup group_components_services_inventory
39*/
40
41/** A handle to obtain details related to authentication event */
43
44/** A handle to obtain details related to authentication method */
46
47/**
48 @ingroup event_tracking_services_inventory
49
50 @anchor EVENT_TRACKING_AUTHENTICATION_SERVICE
51
52 A service to track and consume authentication events.
53
54 Producer of the event will broadcast notify all interested
55 consumers of the event.
56
57 @sa @ref EVENT_TRACKING_AUTHENTICATION_CONSUMER_EXAMPLE
58*/
59BEGIN_SERVICE_DEFINITION(event_tracking_authentication)
60
61/**
62 Process a authentication event
63
64 @param [in] common_handle Handle for common event trackign data
65 @param [in] handle Handle to retrieve additional data
66 about event. It is guaranteed to be
67 valid for the duration of the API.
68 @param [in] data Event specific data
69
70 @returns Status of processing the event
71 @retval false Success
72 @retval true Error
73*/
76
77END_SERVICE_DEFINITION(event_tracking_authentication)
78
79/**
80 @ingroup event_tracking_services_inventory
81
82 @anchor EVENT_TRACKING_AUTHENTICATION_INFORMATION
83
84 A service to fetch additional data about authentication event
85*/
86
87BEGIN_SERVICE_DEFINITION(event_tracking_authentication_information)
88
89/**
90 Initialize authentication event data handle
91
92 @param [out] handle Handle to authentication event data
93
94 @returns Status of handle creation
95 @retval false Success
96 @retval true Error
97*/
100
101/**
102 Deinitialize authentication event data handle
103
104 @param [in, out] handle Handle to be deinitialized
105
106 @returns Status of operation
107 @retval false Success
108 @retval true Error
109*/
112
113/**
114 Get information about given authentication event
115
116 Accepted names and corresponding value type
117
118 "authentcation_method_count" -> unsigned int *
119 "new_user" -> mysql_cstring_with_length *
120 "new_host" -> mysql_cstring_with_length *
121 "is_role" -> boolean *
122 "authentication_method_info" -> event_tracking_authentication_method_handle
123
124 @param [in] handle Event tracking information handle
125 @param [in] name Data identifier
126 @param [out] value Value of the identifier
127
128 @returns status of the operation
129 @retval false Success
130 @retval true Error
131*/
134 const char *name, void *value));
135
136END_SERVICE_DEFINITION(event_tracking_authentication_information)
137
138/**
139 @ingroup event_tracking_services_inventory
140
141 @anchor EVENT_TRACKING_AUTHENTICATION_METHOD
142
143 A service to fetch additional data about authentication method
144*/
145
146BEGIN_SERVICE_DEFINITION(event_tracking_authentication_method)
147
148/**
149 Get information about authentication method
150
151 Accepted names and corresponding value type
152
153 "name" -> mysql_cstring_with_length *
154
155 @param [in] handle Handle to authentication method structure
156 Valid until
157 @sa event_tracking_authentication_information_handle_imp
158 is valid
159 @param [in] index Location
160 @param [in] name Data identifier
161 @param [out] value Data value
162
163 @returns status of the operation
164 @retval false Success
165 @retval true Error
166*/
168 unsigned int index, const char *name, void *value));
169
170END_SERVICE_DEFINITION(event_tracking_authentication_method)
171
172#endif // !MYSQL_COMPONENTS_SERVICES_EVENT_TRACKING_AUTHENTICATION_SERVICE_H
static mysql_service_status_t deinit()
Component deinitialization.
Definition: audit_api_message_emit.cc:579
static mysql_service_status_t init()
Component initialization.
Definition: audit_api_message_emit.cc:570
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:45
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:42
void get(PSI_field *, PSI_longlong *) noexcept
Definition: pfs_plugin_column_bigint_v1_all_empty.cc:31
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:63
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:86
#define END_SERVICE_DEFINITION(name)
A macro to end the last Service definition started with the BEGIN_SERVICE_DEFINITION macro.
Definition: service.h:90
#define BEGIN_SERVICE_DEFINITION(name)
Declares a new Service.
Definition: service.h:85
#define DEFINE_SERVICE_HANDLE(name)
Defines an object type that is meant for carrying handles to the implementation-specific objects used...
Definition: service.h:128
#define DECLARE_BOOL_METHOD(name, args)
Declares a method that returns bool as a part of the Service definition.
Definition: service.h:111
case opt name
Definition: sslopt-case.h:32
Structure for Authentication event tracking.
Definition: event_tracking_authentication_defs.h:78