20#ifndef REMOTE_PROVIDER_UTILS_H
21#define REMOTE_PROVIDER_UTILS_H
54 wxString& aError,
const wxString& aLabel );
70 void error(
const nlohmann::json::json_pointer& aPointer,
const nlohmann::json& aInstance,
71 const std::string& aMessage )
override;
74 wxString FirstError()
const;
Collects JSON-schema validation errors so the caller can inspect them after a validation pass.
void error(const nlohmann::json::json_pointer &aPointer, const nlohmann::json &aInstance, const std::string &aMessage) override
std::vector< wxString > m_errors
KICOMMON_API wxString NormalizedUrlOrigin(const wxString &aUrl)
Return a normalized scheme://host:port origin string for aUrl.
KICOMMON_API bool IsLoopbackHost(const wxString &aHost)
Return true when aHost resolves to a loopback address (localhost, 127.0.0.1, or ::1).
KICOMMON_API bool ValidateRemoteUrlSecurity(const wxString &aUrl, bool aAllowInsecureLocalhost, wxString &aError, const wxString &aLabel)
Validate that aUrl uses HTTPS, or HTTP on a loopback address when aAllowInsecureLocalhost is true.
KICOMMON_API wxString RemoteProviderJsonString(const nlohmann::json &aObject, const char *aKey)
Extract an optional string value from a JSON object, returning an empty wxString when the key is abse...
KICOMMON_API wxString UrlEncode(const wxString &aValue)
Percent-encode a string for use in URL query parameters (RFC 3986 unreserved characters are passed th...