|
KiCad PCB EDA Suite
|
Go to the source code of this file.
Classes | |
| class | COLLECTING_JSON_ERROR_HANDLER |
| Collects JSON-schema validation errors so the caller can inspect them after a validation pass. More... | |
Functions | |
| KICOMMON_API wxString | UrlEncode (const wxString &aValue) |
| Percent-encode a string for use in URL query parameters (RFC 3986 unreserved characters are passed through unchanged). | |
| 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 absent or the value is not a string. | |
| 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 | 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).
IPv6 bracket notation is handled.
Definition at line 64 of file remote_provider_utils.cpp.
Referenced by ValidateRemoteUrlSecurity().
| KICOMMON_API wxString NormalizedUrlOrigin | ( | const wxString & | aUrl | ) |
Return a normalized scheme://host:port origin string for aUrl.
Empty when the URL cannot be parsed.
Definition at line 100 of file remote_provider_utils.cpp.
Referenced by REMOTE_PROVIDER_CLIENT::ExchangeBootstrapNonce(), and REMOTE_PROVIDER_METADATA::FromJson().
| 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 absent or the value is not a string.
Definition at line 53 of file remote_provider_utils.cpp.
Referenced by REMOTE_PROVIDER_METADATA::FromJson(), REMOTE_PROVIDER_OAUTH_SERVER_METADATA::FromJson(), REMOTE_PROVIDER_PART_MANIFEST::FromJson(), PANEL_REMOTE_SYMBOL::handleRpcMessage(), PANEL_REMOTE_SYMBOL::receive3DModel(), PANEL_REMOTE_SYMBOL::receiveComponent(), PANEL_REMOTE_SYMBOL::receiveComponentManifest(), PANEL_REMOTE_SYMBOL::receiveFootprint(), PANEL_REMOTE_SYMBOL::receiveSPICEModel(), and PANEL_REMOTE_SYMBOL::receiveSymbol().
| KICOMMON_API wxString UrlEncode | ( | const wxString & | aValue | ) |
Percent-encode a string for use in URL query parameters (RFC 3986 unreserved characters are passed through unchanged).
Definition at line 26 of file remote_provider_utils.cpp.
Referenced by OAUTH_SESSION::BuildAuthorizationUrl(), REMOTE_PROVIDER_CLIENT::ExchangeAuthorizationCode(), REMOTE_PROVIDER_CLIENT::RefreshAccessToken(), and REMOTE_PROVIDER_CLIENT::RevokeToken().
| 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.
On failure, aError is populated with a diagnostic that includes aLabel.
Definition at line 78 of file remote_provider_utils.cpp.
References _, and IsLoopbackHost().
Referenced by REMOTE_PROVIDER_CLIENT::ExchangeBootstrapNonce(), REMOTE_PROVIDER_METADATA::FromJson(), REMOTE_PROVIDER_OAUTH_SERVER_METADATA::FromJson(), and REMOTE_PROVIDER_PART_MANIFEST::FromJson().