|
KiCad PCB EDA Suite
|
#include <remote_provider_client.h>
Static Public Member Functions | |
| static wxString | MetadataDiscoveryUrl (const wxString &aProviderUrl) |
Private Member Functions | |
| bool | SendRequest (const REMOTE_PROVIDER_HTTP_REQUEST &aRequest, REMOTE_PROVIDER_HTTP_RESPONSE &aResponse, REMOTE_PROVIDER_ERROR &aError) const |
| bool | FetchJson (const REMOTE_PROVIDER_HTTP_REQUEST &aRequest, nlohmann::json &aJson, REMOTE_PROVIDER_ERROR &aError) const |
| bool | ParseTokenResponse (const REMOTE_PROVIDER_HTTP_RESPONSE &aResponse, OAUTH_TOKEN_SET &aTokens, REMOTE_PROVIDER_ERROR &aError) const |
Private Attributes | |
| REMOTE_PROVIDER_HTTP_HANDLER | m_handler |
Definition at line 67 of file remote_provider_client.h.
| REMOTE_PROVIDER_CLIENT::REMOTE_PROVIDER_CLIENT | ( | ) |
Definition at line 92 of file remote_provider_client.cpp.
References m_handler.
|
explicit |
Definition at line 98 of file remote_provider_client.cpp.
| bool REMOTE_PROVIDER_CLIENT::DiscoverProvider | ( | const wxString & | aProviderUrl, |
| REMOTE_PROVIDER_METADATA & | aMetadata, | ||
| REMOTE_PROVIDER_ERROR & | aError ) const |
Definition at line 120 of file remote_provider_client.cpp.
References REMOTE_PROVIDER_ERROR::Clear(), FetchJson(), REMOTE_PROVIDER_METADATA::FromJson(), GET, REMOTE_PROVIDER_HTTP_REQUEST::headers, INVALID_RESPONSE, REMOTE_PROVIDER_ERROR::message, MetadataDiscoveryUrl(), REMOTE_PROVIDER_HTTP_REQUEST::method, REMOTE_PROVIDER_ERROR::type, and REMOTE_PROVIDER_HTTP_REQUEST::url.
Referenced by DIALOG_REMOTE_SYMBOL_CONFIG::onRefreshProvider().
| bool REMOTE_PROVIDER_CLIENT::ExchangeAuthorizationCode | ( | const REMOTE_PROVIDER_OAUTH_SERVER_METADATA & | aMetadata, |
| const OAUTH_SESSION & | aSession, | ||
| const wxString & | aCode, | ||
| OAUTH_TOKEN_SET & | aTokens, | ||
| REMOTE_PROVIDER_ERROR & | aError ) const |
Definition at line 188 of file remote_provider_client.cpp.
References REMOTE_PROVIDER_HTTP_REQUEST::body, REMOTE_PROVIDER_ERROR::Clear(), OAUTH_SESSION::client_id, OAUTH_SESSION::code_verifier, REMOTE_PROVIDER_HTTP_REQUEST::headers, REMOTE_PROVIDER_HTTP_REQUEST::method, ParseTokenResponse(), POST, OAUTH_SESSION::redirect_uri, SendRequest(), REMOTE_PROVIDER_OAUTH_SERVER_METADATA::token_endpoint, REMOTE_PROVIDER_HTTP_REQUEST::url, and UrlEncode().
| bool REMOTE_PROVIDER_CLIENT::ExchangeBootstrapNonce | ( | const REMOTE_PROVIDER_METADATA & | aMetadata, |
| const wxString & | aAccessToken, | ||
| wxString & | aNonceUrl, | ||
| REMOTE_PROVIDER_ERROR & | aError ) const |
Definition at line 320 of file remote_provider_client.cpp.
References _, REMOTE_PROVIDER_METADATA::allow_insecure_localhost, REMOTE_PROVIDER_HTTP_REQUEST::body, REMOTE_PROVIDER_ERROR::Clear(), FetchJson(), REMOTE_PROVIDER_HTTP_REQUEST::headers, INVALID_RESPONSE, REMOTE_PROVIDER_ERROR::message, REMOTE_PROVIDER_HTTP_REQUEST::method, NormalizedUrlOrigin(), REMOTE_PROVIDER_METADATA::panel_url, POST, REMOTE_PROVIDER_METADATA::session_bootstrap_url, REMOTE_PROVIDER_ERROR::type, REMOTE_PROVIDER_HTTP_REQUEST::url, and ValidateRemoteUrlSecurity().
|
private |
Definition at line 416 of file remote_provider_client.cpp.
References _, REMOTE_PROVIDER_HTTP_RESPONSE::body, INVALID_RESPONSE, REMOTE_PROVIDER_ERROR::message, SendRequest(), and REMOTE_PROVIDER_ERROR::type.
Referenced by DiscoverProvider(), ExchangeBootstrapNonce(), FetchManifest(), and FetchOAuthServerMetadata().
| bool REMOTE_PROVIDER_CLIENT::FetchManifest | ( | const REMOTE_PROVIDER_METADATA & | aProvider, |
| const wxString & | aPartId, | ||
| const wxString & | aAccessToken, | ||
| REMOTE_PROVIDER_PART_MANIFEST & | aManifest, | ||
| REMOTE_PROVIDER_ERROR & | aError ) const |
Definition at line 278 of file remote_provider_client.cpp.
References _, REMOTE_PROVIDER_METADATA::allow_insecure_localhost, AUTH_REQUIRED, REMOTE_PROVIDER_ERROR::Clear(), FetchJson(), REMOTE_PROVIDER_PART_MANIFEST::FromJson(), GET, GetSignInState(), REMOTE_PROVIDER_HTTP_REQUEST::headers, INVALID_RESPONSE, REMOTE_PROVIDER_ERROR::message, REMOTE_PROVIDER_HTTP_REQUEST::method, REQUIRED, REMOTE_PROVIDER_ERROR::type, and REMOTE_PROVIDER_HTTP_REQUEST::url.
| bool REMOTE_PROVIDER_CLIENT::FetchOAuthServerMetadata | ( | const REMOTE_PROVIDER_METADATA & | aProvider, |
| REMOTE_PROVIDER_OAUTH_SERVER_METADATA & | aMetadata, | ||
| REMOTE_PROVIDER_ERROR & | aError ) const |
Definition at line 150 of file remote_provider_client.cpp.
References REMOTE_PROVIDER_METADATA::allow_insecure_localhost, REMOTE_PROVIDER_METADATA::auth, REMOTE_PROVIDER_ERROR::Clear(), FetchJson(), REMOTE_PROVIDER_OAUTH_SERVER_METADATA::FromJson(), GET, REMOTE_PROVIDER_HTTP_REQUEST::headers, INVALID_RESPONSE, REMOTE_PROVIDER_ERROR::message, REMOTE_PROVIDER_AUTH_METADATA::metadata_url, REMOTE_PROVIDER_HTTP_REQUEST::method, OAUTH2, REMOTE_PROVIDER_AUTH_METADATA::type, REMOTE_PROVIDER_ERROR::type, and REMOTE_PROVIDER_HTTP_REQUEST::url.
| REMOTE_PROVIDER_SIGNIN_STATE REMOTE_PROVIDER_CLIENT::GetSignInState | ( | const REMOTE_PROVIDER_METADATA & | aProvider, |
| const wxString & | aAccessToken ) const |
Definition at line 265 of file remote_provider_client.cpp.
References REMOTE_PROVIDER_METADATA::auth, AVAILABLE, NOT_REQUIRED, OAUTH2, REQUIRED, and REMOTE_PROVIDER_AUTH_METADATA::type.
Referenced by FetchManifest().
|
static |
Definition at line 104 of file remote_provider_client.cpp.
Referenced by DiscoverProvider().
|
private |
Definition at line 440 of file remote_provider_client.cpp.
References _, OAUTH_TOKEN_SET::access_token, REMOTE_PROVIDER_HTTP_RESPONSE::body, OAUTH_TOKEN_SET::expires_at, OAUTH_TOKEN_SET::id_token, INVALID_RESPONSE, REMOTE_PROVIDER_ERROR::message, OAUTH_TOKEN_SET::refresh_token, OAUTH_TOKEN_SET::scope, OAUTH_TOKEN_SET::token_type, and REMOTE_PROVIDER_ERROR::type.
Referenced by ExchangeAuthorizationCode(), and RefreshAccessToken().
| bool REMOTE_PROVIDER_CLIENT::RefreshAccessToken | ( | const REMOTE_PROVIDER_OAUTH_SERVER_METADATA & | aMetadata, |
| const wxString & | aClientId, | ||
| const wxString & | aRefreshToken, | ||
| OAUTH_TOKEN_SET & | aTokens, | ||
| REMOTE_PROVIDER_ERROR & | aError ) const |
Definition at line 216 of file remote_provider_client.cpp.
References REMOTE_PROVIDER_HTTP_REQUEST::body, REMOTE_PROVIDER_ERROR::Clear(), REMOTE_PROVIDER_HTTP_REQUEST::headers, REMOTE_PROVIDER_HTTP_REQUEST::method, ParseTokenResponse(), POST, SendRequest(), REMOTE_PROVIDER_OAUTH_SERVER_METADATA::token_endpoint, REMOTE_PROVIDER_HTTP_REQUEST::url, and UrlEncode().
| bool REMOTE_PROVIDER_CLIENT::RevokeToken | ( | const REMOTE_PROVIDER_OAUTH_SERVER_METADATA & | aMetadata, |
| const wxString & | aClientId, | ||
| const wxString & | aToken, | ||
| REMOTE_PROVIDER_ERROR & | aError ) const |
Definition at line 242 of file remote_provider_client.cpp.
References REMOTE_PROVIDER_HTTP_REQUEST::body, REMOTE_PROVIDER_ERROR::Clear(), REMOTE_PROVIDER_HTTP_REQUEST::headers, REMOTE_PROVIDER_HTTP_REQUEST::method, POST, REMOTE_PROVIDER_OAUTH_SERVER_METADATA::revocation_endpoint, SendRequest(), REMOTE_PROVIDER_HTTP_REQUEST::url, and UrlEncode().
|
private |
Definition at line 379 of file remote_provider_client.cpp.
References _, ACCESS_DENIED, AUTH_REQUIRED, REMOTE_PROVIDER_ERROR::http_status, INVALID_RESPONSE, m_handler, REMOTE_PROVIDER_ERROR::message, NETWORK, NOT_FOUND, SERVER, REMOTE_PROVIDER_HTTP_RESPONSE::status_code, and REMOTE_PROVIDER_ERROR::type.
Referenced by ExchangeAuthorizationCode(), FetchJson(), RefreshAccessToken(), and RevokeToken().
|
private |
Definition at line 119 of file remote_provider_client.h.
Referenced by REMOTE_PROVIDER_CLIENT(), REMOTE_PROVIDER_CLIENT(), and SendRequest().