MCPcopy Create free account
hub / github.com/audacity/audacity / AuthorisePassword

Method AuthorisePassword

libraries/lib-cloud-audiocom/OAuthService.cpp:232–259  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

230}
231
232void OAuthService::AuthorisePassword(
233 const ServiceConfig& config, std::string_view userName,
234 std::string_view password, AudiocomTrace trace,
235 std::function<void(std::string_view)> completedHandler)
236{
237 using namespace rapidjson;
238
239 Document document;
240 document.SetObject();
241
242 WriteCommonFields(document, "password", "all");
243
244 document.AddMember(
245 "username", StringRef(userName.data(), userName.size()),
246 document.GetAllocator());
247
248 document.AddMember(
249 "password", StringRef(password.data(), password.size()),
250 document.GetAllocator());
251
252 rapidjson::StringBuffer buffer;
253 rapidjson::Writer<rapidjson::StringBuffer> writer(buffer);
254 document.Accept(writer);
255
256 DoAuthorise(
257 config, { buffer.GetString(), buffer.GetSize() }, trace,
258 std::move(completedHandler), false);
259}
260
261void OAuthService::AuthoriseRefreshToken(
262 const ServiceConfig& config, std::string_view token, AudiocomTrace trace,

Callers

nothing calls this directly

Calls 6

WriteCommonFieldsFunction · 0.85
moveFunction · 0.85
dataMethod · 0.45
sizeMethod · 0.45
GetStringMethod · 0.45
GetSizeMethod · 0.45

Tested by

no test coverage detected