MySQL 8.4.2
Source Code Documentation
authentication_oci_client_plugin.cc File Reference
#include "my_config.h"
#include <mysql/service_mysql_alloc.h>
#include <my_compiler.h>
#include <my_dir.h>
#include <my_sys.h>
#include <mysql.h>
#include <mysql/client_plugin.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <fstream>
#include <iostream>
#include <ostream>
#include "sql-common/oci/signing_key.h"
#include "sql-common/oci/ssl.h"
#include "sql-common/oci/utilities.h"

Functions

void log_error (const std::string &message)
 Log error message to client. More...
 
void free_plugin_option (char *&option)
 Free plugin option. More...
 
oci::OCI_config_file parse_oci_config_file (std::string &err_msg)
 Parse the system variables for the location of the ~/.oci/config file. More...
 
static int try_parse_and_set_config_file (std::string &err_msg)
 Try to parse and assess the currently effective config file. More...
 
static int oci_authenticate_client_plugin (MYSQL_PLUGIN_VIO *vio, MYSQL *)
 client auth function More...
 
static int initialize_plugin (char *, size_t, int, va_list)
 
static int oci_authenticate_client_option (const char *option, const void *val)
 oci_authenticate_client_option plugin API to allow server to pass optional data for plugin to process More...
 
 mysql_declare_client_plugin (AUTHENTICATION) "authentication_oci_client"
 

Variables

static char * s_oci_config_location = nullptr
 
static char * s_authentication_oci_client_config_profile = nullptr
 
static oci::OCI_config_files_oci_config_file = nullptr
 
static std::string s_expanded_path {}
 
static const int s_max_token_size = 10000
 
 MYSQL_CLIENT_PLUGIN_AUTHOR_ORACLE
 
OCI Client Authentication Plugin
 
OCI Client Authentication COMMUNITY
 
OCI Client Authentication nullptr
 
OCI Client Authentication initialize_plugin
 
OCI Client Authentication deinitialize_plugin
 
OCI Client Authentication oci_authenticate_client_option
 
OCI Client Authentication oci_authenticate_client_plugin
 
OCI Client Authentication nullptr mysql_end_client_plugin
 

Function Documentation

◆ free_plugin_option()

void free_plugin_option ( char *&  option)
inline

Free plugin option.

Parameters
[in]optionPlugin option to be freed

◆ initialize_plugin()

static int initialize_plugin ( char *  ,
size_t  ,
int  ,
va_list   
)
static

◆ log_error()

void log_error ( const std::string &  message)

Log error message to client.

Parameters
[in]messageMessage to be displayed

◆ mysql_declare_client_plugin()

mysql_declare_client_plugin ( AUTHENTICATION  )

◆ oci_authenticate_client_option()

static int oci_authenticate_client_option ( const char *  option,
const void *  val 
)
static

oci_authenticate_client_option plugin API to allow server to pass optional data for plugin to process

◆ oci_authenticate_client_plugin()

static int oci_authenticate_client_plugin ( MYSQL_PLUGIN_VIO vio,
MYSQL  
)
static

client auth function

read stuff via the VIO. try to read first get (login) data from the MYSQL handle: mysql->user, mysql->passwd return CR_OK on success, CR_ERROR on failure

Step 1: Receive the nonce from the server.

Step 2: Sign the nonce with the private key.

Step 3: Prepare the response.

Step 4: Send the encrypted nonce back to the server for verification.

◆ parse_oci_config_file()

oci::OCI_config_file parse_oci_config_file ( std::string &  err_msg)

Parse the system variables for the location of the ~/.oci/config file.

Extract the key_file= value from the ~/.oci/config file.

◆ try_parse_and_set_config_file()

static int try_parse_and_set_config_file ( std::string &  err_msg)
static

Try to parse and assess the currently effective config file.

Return values
0: success
1: parsing failed or not initialized

Variable Documentation

◆ COMMUNITY

OCI Client Authentication COMMUNITY

◆ deinitialize_plugin

OCI Client Authentication deinitialize_plugin

◆ initialize_plugin

OCI Client Authentication initialize_plugin

◆ MYSQL_CLIENT_PLUGIN_AUTHOR_ORACLE

MYSQL_CLIENT_PLUGIN_AUTHOR_ORACLE

◆ mysql_end_client_plugin

OCI Client Authentication nullptr mysql_end_client_plugin

◆ nullptr

OCI Client Authentication nullptr

◆ oci_authenticate_client_option

OCI Client Authentication oci_authenticate_client_option

◆ oci_authenticate_client_plugin

OCI Client Authentication oci_authenticate_client_plugin

◆ Plugin

OCI Client Authentication Plugin

◆ s_authentication_oci_client_config_profile

char* s_authentication_oci_client_config_profile = nullptr
static

◆ s_expanded_path

std::string s_expanded_path {}
static

◆ s_max_token_size

const int s_max_token_size = 10000
static

◆ s_oci_config_file

oci::OCI_config_file* s_oci_config_file = nullptr
static

◆ s_oci_config_location

char* s_oci_config_location = nullptr
static