Fix o365 channels for clang

dependabot/npm_and_yarn/Src/WebController/UI/websocket-extensions-0.1.4
Pawel Kurowski 2020-05-15 13:47:59 +02:00
parent e8468a5697
commit 76d816ee4f
7 changed files with 30 additions and 7 deletions

View File

@ -33,7 +33,7 @@ namespace FSecure::C3::Interfaces::Channels
/// Get channel capability. /// Get channel capability.
/// @returns ByteView view of channel capability. /// @returns ByteView view of channel capability.
static ByteView GetCapability(); static const char* GetCapability();
protected: protected:
/// Remove one item from server. /// Remove one item from server.
@ -53,7 +53,7 @@ namespace FSecure::C3::Interfaces::Channels
{ {
auto fileList = ListData(); auto fileList = ListData();
for (auto& element : fileList.at(OBF("value"))) for (auto& element : fileList.at(OBF("value")))
RemoveItem(element.at(OBF("id")).get<std::string>()); RemoveItem(element.at(OBF("id")));
} }
/// Requests a new access token using the refresh token /// Requests a new access token using the refresh token
@ -171,7 +171,7 @@ std::atomic<std::chrono::steady_clock::time_point> FSecure::C3::Interfaces::Chan
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
template <typename Derived> template <typename Derived>
FSecure::ByteView FSecure::C3::Interfaces::Channels::Office365<Derived>::GetCapability() const char* FSecure::C3::Interfaces::Channels::Office365<Derived>::GetCapability()
{ {
return R"_( return R"_(
{ {

View File

@ -21,6 +21,13 @@ FSecure::Crypto::String FSecure::C3::Interfaces::Channels::OneDrive365RestFile::
FSecure::Crypto::String FSecure::C3::Interfaces::Channels::OneDrive365RestFile::TokenEndpoint = OBF("https://login.windows.net/organizations/oauth2/v2.0/token"); FSecure::Crypto::String FSecure::C3::Interfaces::Channels::OneDrive365RestFile::TokenEndpoint = OBF("https://login.windows.net/organizations/oauth2/v2.0/token");
FSecure::Crypto::String FSecure::C3::Interfaces::Channels::OneDrive365RestFile::Scope = OBF("files.readwrite.all"); FSecure::Crypto::String FSecure::C3::Interfaces::Channels::OneDrive365RestFile::Scope = OBF("files.readwrite.all");
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
FSecure::C3::Interfaces::Channels::OneDrive365RestFile::OneDrive365RestFile(ByteView arguments)
: Office365<OneDrive365RestFile>(arguments)
{
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
size_t FSecure::C3::Interfaces::Channels::OneDrive365RestFile::OnSendToChannel(ByteView data) size_t FSecure::C3::Interfaces::Channels::OneDrive365RestFile::OnSendToChannel(ByteView data)
{ {

View File

@ -7,8 +7,9 @@ namespace FSecure::C3::Interfaces::Channels
class OneDrive365RestFile : public Channel<OneDrive365RestFile>, public Office365<OneDrive365RestFile> class OneDrive365RestFile : public Channel<OneDrive365RestFile>, public Office365<OneDrive365RestFile>
{ {
public: public:
/// Use Office365 constructor. /// Public constructor.
using Office365<OneDrive365RestFile>::Office365; /// @param arguments factory arguments.
OneDrive365RestFile(ByteView arguments);
/// OnSend callback implementation. /// OnSend callback implementation.
/// @param blob data to send to Channel. /// @param blob data to send to Channel.

View File

@ -20,6 +20,13 @@ FSecure::Crypto::String FSecure::C3::Interfaces::Channels::Outlook365RestTask::L
FSecure::Crypto::String FSecure::C3::Interfaces::Channels::Outlook365RestTask::TokenEndpoint = OBF("https://login.windows.net/organizations/oauth2/v2.0/token/"); FSecure::Crypto::String FSecure::C3::Interfaces::Channels::Outlook365RestTask::TokenEndpoint = OBF("https://login.windows.net/organizations/oauth2/v2.0/token/");
FSecure::Crypto::String FSecure::C3::Interfaces::Channels::Outlook365RestTask::Scope = OBF("https://outlook.office365.com/.default"); FSecure::Crypto::String FSecure::C3::Interfaces::Channels::Outlook365RestTask::Scope = OBF("https://outlook.office365.com/.default");
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
FSecure::C3::Interfaces::Channels::Outlook365RestTask::Outlook365RestTask(ByteView arguments)
: Office365<Outlook365RestTask>(arguments)
{
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
size_t FSecure::C3::Interfaces::Channels::Outlook365RestTask::OnSendToChannel(ByteView data) size_t FSecure::C3::Interfaces::Channels::Outlook365RestTask::OnSendToChannel(ByteView data)
{ {

View File

@ -8,8 +8,9 @@ namespace FSecure::C3::Interfaces::Channels
class Outlook365RestTask : public Channel<Outlook365RestTask>, public Office365<Outlook365RestTask> class Outlook365RestTask : public Channel<Outlook365RestTask>, public Office365<Outlook365RestTask>
{ {
public: public:
/// Use Office365 constructor. /// Public constructor.
using Office365<Outlook365RestTask>::Office365; /// @param arguments factory arguments.
Outlook365RestTask(ByteView arguments);
/// OnSend callback implementation. /// OnSend callback implementation.
/// @param blob data to send to Channel. /// @param blob data to send to Channel.

View File

@ -8,6 +8,12 @@ FSecure::Crypto::String::String(std::string_view sv)
} }
FSecure::Crypto::String::String(const char* str)
: String(std::string_view{ str })
{
}
FSecure::SecureString FSecure::Crypto::String::Decrypt() FSecure::SecureString FSecure::Crypto::String::Decrypt()
{ {
auto tmp = m_Data.empty() ? ByteVector{} : DecryptFromAnonymous(m_Data, m_Key); auto tmp = m_Data.empty() ? ByteVector{} : DecryptFromAnonymous(m_Data, m_Key);

View File

@ -12,6 +12,7 @@ namespace FSecure::Crypto
public: public:
String() = default; String() = default;
String(std::string_view sv); String(std::string_view sv);
String(const char* str); // for clang
String& operator=(std::string_view sv); String& operator=(std::string_view sv);
SecureString Decrypt(); SecureString Decrypt();