|
cesium-native 0.52.0
|
Shared classes for interacting with Cesium ion and iTwin APIs. More...
Classes | |
| struct | OAuth2ClientOptions |
| Options used to configure the OAuth2 authentication process. More... | |
| class | OAuth2PKCE |
| Class for authenticating with an API that uses OAuth2 Proof of Key Code Exchange (PKCE). More... | |
| struct | OAuth2TokenResponse |
| Tokens obtained from a successful OAuth2 authentication operation. More... | |
Functions | |
| bool | parseErrorResponse (const std::span< const std::byte > &body, std::string &outError, std::string &outErrorDesc) |
| Attempts to parse a JSON error response from the provided buffer. | |
| void | fillWithRandomBytes (const std::span< uint8_t > &buffer) |
| Fills the provided buffer with random bytes using a cryptographically secure psuedorandom number generator (CSPRNG). | |
Shared classes for interacting with Cesium ion and iTwin APIs.
| void CesiumClientCommon::fillWithRandomBytes | ( | const std::span< uint8_t > & | buffer | ) |
Fills the provided buffer with random bytes using a cryptographically secure psuedorandom number generator (CSPRNG).
| buffer | The buffer to fill with bytes. |
| std::runtime_error | Throws a runtime error if the call to the CSPRNG fails. |
| bool CesiumClientCommon::parseErrorResponse | ( | const std::span< const std::byte > & | body, |
| std::string & | outError, | ||
| std::string & | outErrorDesc ) |
Attempts to parse a JSON error response from the provided buffer.
Two schemas of JSON error document are supported.
error becomes outError and error_description becomes outErrorDesc.
error.code becomes outError. error.message and any entries in error.details are combined together into outErrorDesc.
| body | A response body that might contain JSON object with error information. |
| outError | A string that will be set to the error code, if one is found. |
| outErrorDesc | A string that will be set to a more detailed error message, if one is found. |