auth.hpp 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. //
  2. // Copyright (c) 2019-2024 Ruben Perez Hidalgo (rubenperez038 at gmail dot com)
  3. //
  4. // Distributed under the Boost Software License, Version 1.0. (See accompanying
  5. // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  6. //
  7. #ifndef BOOST_MYSQL_IMPL_INTERNAL_AUTH_AUTH_HPP
  8. #define BOOST_MYSQL_IMPL_INTERNAL_AUTH_AUTH_HPP
  9. #include <boost/mysql/error_code.hpp>
  10. #include <boost/mysql/string_view.hpp>
  11. #include <boost/mysql/detail/config.hpp>
  12. #include <boost/core/span.hpp>
  13. #include <vector>
  14. namespace boost {
  15. namespace mysql {
  16. namespace detail {
  17. struct auth_response
  18. {
  19. std::vector<std::uint8_t> data;
  20. string_view plugin_name;
  21. };
  22. BOOST_ATTRIBUTE_NODISCARD
  23. BOOST_MYSQL_DECL
  24. error_code compute_auth_response(
  25. string_view plugin_name,
  26. string_view password,
  27. span<const std::uint8_t> challenge,
  28. bool secure_channel,
  29. auth_response& output
  30. );
  31. } // namespace detail
  32. } // namespace mysql
  33. } // namespace boost
  34. #ifdef BOOST_MYSQL_HEADER_ONLY
  35. #include <boost/mysql/impl/internal/auth/auth.ipp>
  36. #endif
  37. #endif