MySQL 9.1.0
Source Code Documentation
authentication_webauthn_clientopt-vars.h
Go to the documentation of this file.
1/* Copyright (c) 2023, 2024, Oracle and/or its affiliates.
2
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License, version 2.0,
5 as published by the Free Software Foundation.
6
7 This program is designed to work with certain software (including
8 but not limited to OpenSSL) that is licensed under separate terms,
9 as designated in a particular file or component or in included license
10 documentation. The authors of MySQL hereby grant you an additional
11 permission to link the program and your derivative works with the
12 separately licensed software that they have either included with
13 the program or referenced in the documentation.
14
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License, version 2.0, for more details.
19
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
23
24#ifndef AUTHENTICATION_WEBAUTH_CLIENTOPT_VARS_H
25#define AUTHENTICATION_WEBAUTH_CLIENTOPT_VARS_H
26
27#include <cstdio>
28#include "mysql.h"
29
30using std::snprintf;
32
34
36 size_t error_size) {
39 struct st_mysql_client_plugin *webauthn_client_plugin =
40 mysql_client_find_plugin(mysql, "authentication_webauthn_client",
42 if (!webauthn_client_plugin) {
43 snprintf(error, error_size,
44 "Failed to load authentication_webauthn_client.");
45 return 1;
46 }
47
50 webauthn_client_plugin,
51 "authentication_webauthn_client_preserve_privacy",
53 snprintf(error, error_size,
54 "Failed to set value 'TRUE' for "
55 "--plugin-authentication-webauthn-client-preserve-privacy");
56 return 1;
57 }
58 }
59
61 if (mysql_plugin_options(webauthn_client_plugin, "device",
63 snprintf(error, error_size,
64 "Failed to set device id for the webauthn client plugin");
65 return 1;
66 }
67 }
68 }
69 return 0;
70}
71#endif /* AUTHENTICATION_WEBAUTH_CLIENTOPT_VARS_H */
static int set_authentication_webauthn_options(MYSQL *mysql, char *error, size_t error_size)
Definition: authentication_webauthn_clientopt-vars.h:35
static unsigned int opt_authentication_webauthn_client_device
Definition: authentication_webauthn_clientopt-vars.h:33
bool opt_authentication_webauthn_client_preserve_privacy
Definition: authentication_webauthn_clientopt-vars.h:31
int mysql_plugin_options(struct st_mysql_client_plugin *plugin, const char *option, const void *value)
set plugin options
Definition: client_plugin.cc:657
struct st_mysql_client_plugin * mysql_client_find_plugin(struct MYSQL *mysql, const char *name, int type)
finds an already loaded plugin by name, or loads it, if necessary
Definition: client_plugin.cc:630
#define MYSQL_CLIENT_AUTHENTICATION_PLUGIN
Definition: client_plugin.h:80
This file defines the client API to MySQL and also the ABI of the dynamically linked libmysqlclient.
void error(const char *format,...)
Definition: instrumented_condition_variable.h:32
Definition: mysql.h:300
Definition: client_plugin.h:114