@@ -102,34 +102,13 @@ class credentials
102102 // / <returns>A string containing the user name.</returns>
103103 const utility::string_t &username () const { return m_username; }
104104
105- // / <summary>
106- // / The password for the user name associated with the credentials.
107- // / </summary>
108- // / <returns>A string containing the password.</returns>
109- CASABLANCA_DEPRECATED (" This API is deprecated for security reasons to avoid unnecessary password copies stored in plaintext." )
110- utility::string_t password () const
111- {
112- #if defined(_WIN32) && !defined(CPPREST_TARGET_XP)
113- return utility::string_t (*m_password.decrypt ());
114- #else
115- return m_password;
116- #endif
117- }
118-
119105 // / <summary>
120106 // / Checks if credentials have been set
121107 // / </summary>
122108 // / <returns><c>true</c> if user name and password is set, <c>false</c> otherwise.</returns>
123109 bool is_set () const { return !m_username.empty (); }
124110
125- private:
126- friend class http ::client::details::winhttp_client;
127- friend class http ::client::details::winrt_client;
128- friend class http ::client::details::asio_context;
129- friend class websockets ::client::details::winrt_callback_client;
130- friend class websockets ::client::details::wspp_callback_client;
131-
132- details::plaintext_string decrypt () const
111+ details::plaintext_string _decrypt () const
133112 {
134113 // Encryption APIs not supported on XP
135114#if defined(_WIN32) && !defined(CPPREST_TARGET_XP)
@@ -139,6 +118,7 @@ class credentials
139118#endif
140119 }
141120
121+ private:
142122 ::utility::string_t m_username;
143123
144124#if defined(_WIN32) && !defined(CPPREST_TARGET_XP)
0 commit comments