Audacity 3.2.0
Classes | Functions | Variables
audacity::cloud::audiocom::anonymous_namespace{OAuthService.cpp} Namespace Reference

Classes

class  OAuthServiceSettingsResetHandler
 

Functions

void WriteClientFields (rapidjson::Document &document)
 
void WriteAccessFields (rapidjson::Document &document, std::string_view grantType, std::string_view scope)
 
void WriteCommonFields (rapidjson::Document &document, std::string_view grantType, std::string_view scope)
 
template<typename Elem , typename First , typename ... Others>
void append (std::basic_string< Elem > &dest, First &&first, Others &&...others)
 
template<typename First , typename ... Others>
auto concat (First &&first, Others &&...others)
 

Variables

StringSetting refreshToken { L"/cloud/audiocom/refreshToken", "" }
 
const std::string_view uriPrefix = "audacity://link"
 
const std::string_view usernamePrefix = "username="
 
const std::string_view passwordPrefix = "password="
 
const std::string_view tokenPrefix = "token="
 
const std::string_view authClientPrefix = "authclient="
 
const std::string_view responseTypePrefix = "response_type="
 
const std::string_view clientIdPrefix = "client_id="
 
const std::string_view authorizationCodePrefix = "authorization_code="
 
const std::string_view codePrefix = "code="
 
const std::string_view urlPrefix = "url="
 
const std::string_view userPrefix = "user="
 
static PreferencesResetHandler::Registration< OAuthServiceSettingsResetHandlerresetHandler
 

Function Documentation

◆ append()

template<typename Elem , typename First , typename ... Others>
void audacity::cloud::audiocom::anonymous_namespace{OAuthService.cpp}::append ( std::basic_string< Elem > &  dest,
First &&  first,
Others &&...  others 
)

Definition at line 94 of file OAuthService.cpp.

95{
96 dest.append(first);
97 if constexpr (sizeof...(others) != 0)
98 append(dest, std::forward<Others>(others)...);
99}
void append(std::basic_string< Elem > &dest, First &&first, Others &&...others)

References append().

Referenced by append(), concat(), and EQCurveReader::LoadCurves().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ concat()

template<typename First , typename ... Others>
auto audacity::cloud::audiocom::anonymous_namespace{OAuthService.cpp}::concat ( First &&  first,
Others &&...  others 
)

Definition at line 102 of file OAuthService.cpp.

103{
104 std::basic_string<typename First::value_type> dest(first);
105 append(dest, std::forward<Others>(others)...);
106 return dest;
107}

References append().

Referenced by audacity::cloud::audiocom::OAuthService::MakeAudioComAuthorizeURL(), and audacity::cloud::audiocom::OAuthService::MakeOAuthRequestURL().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ WriteAccessFields()

void audacity::cloud::audiocom::anonymous_namespace{OAuthService.cpp}::WriteAccessFields ( rapidjson::Document &  document,
std::string_view  grantType,
std::string_view  scope 
)

Definition at line 74 of file OAuthService.cpp.

75{
76 using namespace rapidjson;
77
78 document.AddMember(
79 "grant_type", StringRef(grantType.data(), grantType.size()),
80 document.GetAllocator());
81
82 document.AddMember(
83 "scope", StringRef(scope.data(), scope.size()), document.GetAllocator());
84}
static CommandContext::TargetFactory::SubstituteInUnique< InteractiveOutputTargets > scope

References anonymous_namespace{wxCommandTargets.cpp}::scope.

Referenced by WriteCommonFields().

Here is the caller graph for this function:

◆ WriteClientFields()

void audacity::cloud::audiocom::anonymous_namespace{OAuthService.cpp}::WriteClientFields ( rapidjson::Document &  document)

Definition at line 56 of file OAuthService.cpp.

57{
58 using namespace rapidjson;
59
60 const auto clientID = GetServiceConfig().GetOAuthClientID();
61 const auto clientSecret = GetServiceConfig().GetOAuthClientSecret();
62
63 document.AddMember(
64 "client_id",
65 Value(clientID.data(), clientID.size(), document.GetAllocator()),
66 document.GetAllocator());
67
68 document.AddMember(
69 "client_secret",
70 Value(clientSecret.data(), clientSecret.size(), document.GetAllocator()),
71 document.GetAllocator());
72}
std::string GetOAuthClientSecret() const
OAuth2 client secret.
std::string GetOAuthClientID() const
OAuth2 client ID.
const ServiceConfig & GetServiceConfig()
Returns the instance of the ServiceConfig.

References audacity::cloud::audiocom::ServiceConfig::GetOAuthClientID(), audacity::cloud::audiocom::ServiceConfig::GetOAuthClientSecret(), and audacity::cloud::audiocom::GetServiceConfig().

Referenced by audacity::cloud::audiocom::OAuthService::Register(), and WriteCommonFields().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ WriteCommonFields()

void audacity::cloud::audiocom::anonymous_namespace{OAuthService.cpp}::WriteCommonFields ( rapidjson::Document &  document,
std::string_view  grantType,
std::string_view  scope 
)

Definition at line 86 of file OAuthService.cpp.

88{
89 WriteClientFields(document);
90 WriteAccessFields(document, grantType, scope);
91}
void WriteAccessFields(rapidjson::Document &document, std::string_view grantType, std::string_view scope)

References anonymous_namespace{wxCommandTargets.cpp}::scope, WriteAccessFields(), and WriteClientFields().

Referenced by audacity::cloud::audiocom::OAuthService::AuthoriseCode(), audacity::cloud::audiocom::OAuthService::AuthorisePassword(), audacity::cloud::audiocom::OAuthService::AuthoriseRefreshToken(), and audacity::cloud::audiocom::OAuthService::Authorize().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ authClientPrefix

const std::string_view audacity::cloud::audiocom::anonymous_namespace{OAuthService.cpp}::authClientPrefix = "authclient="

◆ authorizationCodePrefix

const std::string_view audacity::cloud::audiocom::anonymous_namespace{OAuthService.cpp}::authorizationCodePrefix = "authorization_code="

◆ clientIdPrefix

const std::string_view audacity::cloud::audiocom::anonymous_namespace{OAuthService.cpp}::clientIdPrefix = "client_id="

◆ codePrefix

const std::string_view audacity::cloud::audiocom::anonymous_namespace{OAuthService.cpp}::codePrefix = "code="

◆ passwordPrefix

const std::string_view audacity::cloud::audiocom::anonymous_namespace{OAuthService.cpp}::passwordPrefix = "password="

◆ refreshToken

StringSetting audacity::cloud::audiocom::anonymous_namespace{OAuthService.cpp}::refreshToken { L"/cloud/audiocom/refreshToken", "" }

◆ resetHandler

PreferencesResetHandler::Registration<OAuthServiceSettingsResetHandler> audacity::cloud::audiocom::anonymous_namespace{OAuthService.cpp}::resetHandler
static

Definition at line 593 of file OAuthService.cpp.

◆ responseTypePrefix

const std::string_view audacity::cloud::audiocom::anonymous_namespace{OAuthService.cpp}::responseTypePrefix = "response_type="

◆ tokenPrefix

const std::string_view audacity::cloud::audiocom::anonymous_namespace{OAuthService.cpp}::tokenPrefix = "token="

◆ uriPrefix

const std::string_view audacity::cloud::audiocom::anonymous_namespace{OAuthService.cpp}::uriPrefix = "audacity://link"

◆ urlPrefix

const std::string_view audacity::cloud::audiocom::anonymous_namespace{OAuthService.cpp}::urlPrefix = "url="

◆ usernamePrefix

const std::string_view audacity::cloud::audiocom::anonymous_namespace{OAuthService.cpp}::usernamePrefix = "username="

◆ userPrefix

const std::string_view audacity::cloud::audiocom::anonymous_namespace{OAuthService.cpp}::userPrefix = "user="