plugin_password_validation.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #ifndef MYSQL_PLUGIN_PASSWORD_VALIDATION_INCLUDED
  2. /* Copyright (C) 2014 Sergei Golubchik and MariaDB
  3. This program is free software; you can redistribute it and/or modify
  4. it under the terms of the GNU General Public License as published by
  5. the Free Software Foundation; version 2 of the License.
  6. This program is distributed in the hope that it will be useful,
  7. but WITHOUT ANY WARRANTY; without even the implied warranty of
  8. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  9. GNU General Public License for more details.
  10. You should have received a copy of the GNU General Public License
  11. along with this program; if not, write to the Free Software
  12. Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
  13. /**
  14. @file
  15. Password Validation Plugin API.
  16. This file defines the API for server password validation plugins.
  17. */
  18. #define MYSQL_PLUGIN_PASSWORD_VALIDATION_INCLUDED
  19. #include <mysql/plugin.h>
  20. #ifdef __cplusplus
  21. extern "C" {
  22. #endif
  23. #define MariaDB_PASSWORD_VALIDATION_INTERFACE_VERSION 0x0100
  24. /**
  25. Password validation plugin descriptor
  26. */
  27. struct st_mariadb_password_validation
  28. {
  29. int interface_version; /**< version plugin uses */
  30. /**
  31. Function provided by the plugin which should perform password validation
  32. and return 0 if the password has passed the validation.
  33. */
  34. int (*validate_password)(MYSQL_LEX_STRING *username,
  35. MYSQL_LEX_STRING *password);
  36. };
  37. #ifdef __cplusplus
  38. }
  39. #endif
  40. #endif