xref: /openbmc/phosphor-user-manager/phosphor-ldap-config/utils.hpp (revision 78d850422ead4618b3c8fafafecf58c4b8c9f9ca)
159287f09SNagaraju Goruganti #pragma once
259287f09SNagaraju Goruganti 
359287f09SNagaraju Goruganti #include <string>
459287f09SNagaraju Goruganti 
559287f09SNagaraju Goruganti namespace phosphor
659287f09SNagaraju Goruganti {
759287f09SNagaraju Goruganti namespace ldap
859287f09SNagaraju Goruganti {
959287f09SNagaraju Goruganti 
1059287f09SNagaraju Goruganti /** @brief checks that the given URI is valid LDAP's URI.
1159287f09SNagaraju Goruganti  *      LDAP's URL begins with "ldap://" and LDAPS's URL begins with "ldap://"
1259287f09SNagaraju Goruganti  *  @param[in] URI - URI which needs to be validated.
1359287f09SNagaraju Goruganti  *  @param[in] scheme - LDAP's scheme, scheme equals to "ldaps" to validate
1459287f09SNagaraju Goruganti  *       against LDAPS type URI, for LDAP type URI it is equals to "ldap".
1559287f09SNagaraju Goruganti  *  @returns true if it is valid otherwise false.
1659287f09SNagaraju Goruganti  */
17*78d85042SNan Zhou bool isValidLDAPURI(const std::string& uri, const char* scheme);
1859287f09SNagaraju Goruganti 
1959287f09SNagaraju Goruganti } // namespace ldap
2059287f09SNagaraju Goruganti } // namespace phosphor
21