From 90d7d7ea761105142245e2a1a40cfc49330840ae Mon Sep 17 00:00:00 2001 From: Cloudmersive <35204726+Cloudmersive@users.noreply.github.com> Date: Sun, 9 May 2021 13:54:02 -0700 Subject: [PATCH] 1.7.8 --- README.md | 5 +- composer.json | 2 +- docs/Api/DomainApi.md | 56 ++++ docs/Model/UrlHtmlSsrfRequestFull.md | 10 + docs/Model/UrlHtmlSsrfResponseFull.md | 11 + lib/Api/DomainApi.php | 262 ++++++++++++++++ lib/Configuration.php | 4 +- lib/Model/UrlHtmlSsrfRequestFull.php | 303 +++++++++++++++++++ lib/Model/UrlHtmlSsrfResponseFull.php | 333 +++++++++++++++++++++ packageconfig.json | 2 +- test/Api/DomainApiTest.php | 10 + test/Model/UrlHtmlSsrfRequestFullTest.php | 86 ++++++ test/Model/UrlHtmlSsrfResponseFullTest.php | 93 ++++++ 13 files changed, 1172 insertions(+), 5 deletions(-) create mode 100644 docs/Model/UrlHtmlSsrfRequestFull.md create mode 100644 docs/Model/UrlHtmlSsrfResponseFull.md create mode 100644 lib/Model/UrlHtmlSsrfRequestFull.php create mode 100644 lib/Model/UrlHtmlSsrfResponseFull.php create mode 100644 test/Model/UrlHtmlSsrfRequestFullTest.php create mode 100644 test/Model/UrlHtmlSsrfResponseFullTest.php diff --git a/README.md b/README.md index cff6b81..9a948d8 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ The validation APIs help you validate data. Check if an E-mail address is real. [Cloudmersive Validation API](https://www.cloudmersive.com/validate-api) provides data validation capabilities for validating email addresses, phone numbers, IP addresses, and many other types of business data. - API version: v1 -- Package version: 1.7.7 +- Package version: 1.7.8 ## Requirements @@ -114,6 +114,7 @@ Class | Method | HTTP request | Description *DomainApi* | [**domainSsrfCheck**](docs/Api/DomainApi.md#domainssrfcheck) | **POST** /validate/domain/url/ssrf-threat-check | Check a URL for SSRF threats *DomainApi* | [**domainSsrfCheckBatch**](docs/Api/DomainApi.md#domainssrfcheckbatch) | **POST** /validate/domain/url/ssrf-threat-check/batch | Check a URL for SSRF threats in batches *DomainApi* | [**domainUrlFull**](docs/Api/DomainApi.md#domainurlfull) | **POST** /validate/domain/url/full | Validate a URL fully +*DomainApi* | [**domainUrlHtmlSsrfCheck**](docs/Api/DomainApi.md#domainurlhtmlssrfcheck) | **POST** /validate/domain/url/ssrf-threat-check/html-embedded | Check a URL for HTML embedded SSRF threats *DomainApi* | [**domainUrlSyntaxOnly**](docs/Api/DomainApi.md#domainurlsyntaxonly) | **POST** /validate/domain/url/syntax-only | Validate a URL syntactically *EmailApi* | [**emailAddressGetServers**](docs/Api/EmailApi.md#emailaddressgetservers) | **POST** /validate/email/address/servers | Partially check whether an email address is valid *EmailApi* | [**emailFullValidation**](docs/Api/EmailApi.md#emailfullvalidation) | **POST** /validate/email/address/full | Fully validate an email address @@ -195,6 +196,8 @@ Class | Method | HTTP request | Description - [SqlInjectionDetectionResult](docs/Model/SqlInjectionDetectionResult.md) - [Timezone](docs/Model/Timezone.md) - [TorNodeResponse](docs/Model/TorNodeResponse.md) + - [UrlHtmlSsrfRequestFull](docs/Model/UrlHtmlSsrfRequestFull.md) + - [UrlHtmlSsrfResponseFull](docs/Model/UrlHtmlSsrfResponseFull.md) - [UrlSafetyCheckRequestFull](docs/Model/UrlSafetyCheckRequestFull.md) - [UrlSafetyCheckResponseFull](docs/Model/UrlSafetyCheckResponseFull.md) - [UrlSsrfRequestBatch](docs/Model/UrlSsrfRequestBatch.md) diff --git a/composer.json b/composer.json index 898ce1f..de6c4e6 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "cloudmersive/cloudmersive_validate_api_client", - "version": "1.7.7", + "version": "1.7.8", "description": "", "keywords": [ "swagger", diff --git a/docs/Api/DomainApi.md b/docs/Api/DomainApi.md index 8c8c8f9..552861b 100644 --- a/docs/Api/DomainApi.md +++ b/docs/Api/DomainApi.md @@ -14,6 +14,7 @@ Method | HTTP request | Description [**domainSsrfCheck**](DomainApi.md#domainSsrfCheck) | **POST** /validate/domain/url/ssrf-threat-check | Check a URL for SSRF threats [**domainSsrfCheckBatch**](DomainApi.md#domainSsrfCheckBatch) | **POST** /validate/domain/url/ssrf-threat-check/batch | Check a URL for SSRF threats in batches [**domainUrlFull**](DomainApi.md#domainUrlFull) | **POST** /validate/domain/url/full | Validate a URL fully +[**domainUrlHtmlSsrfCheck**](DomainApi.md#domainUrlHtmlSsrfCheck) | **POST** /validate/domain/url/ssrf-threat-check/html-embedded | Check a URL for HTML embedded SSRF threats [**domainUrlSyntaxOnly**](DomainApi.md#domainUrlSyntaxOnly) | **POST** /validate/domain/url/syntax-only | Validate a URL syntactically @@ -567,6 +568,61 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) +# **domainUrlHtmlSsrfCheck** +> \Swagger\Client\Model\UrlHtmlSsrfResponseFull domainUrlHtmlSsrfCheck($request) + +Check a URL for HTML embedded SSRF threats + +Checks if an input URL HTML is at risk of containing one or more embedded SSRF (Server-side request forgery) threats or attacks. + +### Example +```php +setApiKey('Apikey', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Apikey', 'Bearer'); + +$apiInstance = new Swagger\Client\Api\DomainApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$request = new \Swagger\Client\Model\UrlHtmlSsrfRequestFull(); // \Swagger\Client\Model\UrlHtmlSsrfRequestFull | Input URL request + +try { + $result = $apiInstance->domainUrlHtmlSsrfCheck($request); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DomainApi->domainUrlHtmlSsrfCheck: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **request** | [**\Swagger\Client\Model\UrlHtmlSsrfRequestFull**](../Model/UrlHtmlSsrfRequestFull.md)| Input URL request | + +### Return type + +[**\Swagger\Client\Model\UrlHtmlSsrfResponseFull**](../Model/UrlHtmlSsrfResponseFull.md) + +### Authorization + +[Apikey](../../README.md#Apikey) + +### HTTP request headers + + - **Content-Type**: application/json, text/json + - **Accept**: application/json, text/json, application/xml, text/xml + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + # **domainUrlSyntaxOnly** > \Swagger\Client\Model\ValidateUrlResponseSyntaxOnly domainUrlSyntaxOnly($request) diff --git a/docs/Model/UrlHtmlSsrfRequestFull.md b/docs/Model/UrlHtmlSsrfRequestFull.md new file mode 100644 index 0000000..fe1ae9e --- /dev/null +++ b/docs/Model/UrlHtmlSsrfRequestFull.md @@ -0,0 +1,10 @@ +# UrlHtmlSsrfRequestFull + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**url** | **string** | URL to validate | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Model/UrlHtmlSsrfResponseFull.md b/docs/Model/UrlHtmlSsrfResponseFull.md new file mode 100644 index 0000000..3214402 --- /dev/null +++ b/docs/Model/UrlHtmlSsrfResponseFull.md @@ -0,0 +1,11 @@ +# UrlHtmlSsrfResponseFull + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**clean_url** | **bool** | True if the URL is clean, false if it is at risk of containing an SSRF threat or attack | [optional] +**http_response_code** | **int** | HTTP response code from the URL | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/lib/Api/DomainApi.php b/lib/Api/DomainApi.php index 02b4be1..0b92ced 100644 --- a/lib/Api/DomainApi.php +++ b/lib/Api/DomainApi.php @@ -2630,6 +2630,268 @@ protected function domainUrlFullRequest($request) + // body params + $_tempBody = null; + if (isset($request)) { + $_tempBody = $request; + } + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json', 'text/json', 'application/xml', 'text/xml'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/json', 'application/xml', 'text/xml'], + ['application/json', 'text/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Apikey'); + if ($apiKey !== null) { + $headers['Apikey'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation domainUrlHtmlSsrfCheck + * + * Check a URL for HTML embedded SSRF threats + * + * @param \Swagger\Client\Model\UrlHtmlSsrfRequestFull $request Input URL request (required) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Swagger\Client\Model\UrlHtmlSsrfResponseFull + */ + public function domainUrlHtmlSsrfCheck($request) + { + list($response) = $this->domainUrlHtmlSsrfCheckWithHttpInfo($request); + return $response; + } + + /** + * Operation domainUrlHtmlSsrfCheckWithHttpInfo + * + * Check a URL for HTML embedded SSRF threats + * + * @param \Swagger\Client\Model\UrlHtmlSsrfRequestFull $request Input URL request (required) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Swagger\Client\Model\UrlHtmlSsrfResponseFull, HTTP status code, HTTP response headers (array of strings) + */ + public function domainUrlHtmlSsrfCheckWithHttpInfo($request) + { + $returnType = '\Swagger\Client\Model\UrlHtmlSsrfResponseFull'; + $request = $this->domainUrlHtmlSsrfCheckRequest($request); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Swagger\Client\Model\UrlHtmlSsrfResponseFull', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation domainUrlHtmlSsrfCheckAsync + * + * Check a URL for HTML embedded SSRF threats + * + * @param \Swagger\Client\Model\UrlHtmlSsrfRequestFull $request Input URL request (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function domainUrlHtmlSsrfCheckAsync($request) + { + return $this->domainUrlHtmlSsrfCheckAsyncWithHttpInfo($request) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation domainUrlHtmlSsrfCheckAsyncWithHttpInfo + * + * Check a URL for HTML embedded SSRF threats + * + * @param \Swagger\Client\Model\UrlHtmlSsrfRequestFull $request Input URL request (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function domainUrlHtmlSsrfCheckAsyncWithHttpInfo($request) + { + $returnType = '\Swagger\Client\Model\UrlHtmlSsrfResponseFull'; + $request = $this->domainUrlHtmlSsrfCheckRequest($request); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'domainUrlHtmlSsrfCheck' + * + * @param \Swagger\Client\Model\UrlHtmlSsrfRequestFull $request Input URL request (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function domainUrlHtmlSsrfCheckRequest($request) + { + // verify the required parameter 'request' is set + if ($request === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $request when calling domainUrlHtmlSsrfCheck' + ); + } + + $resourcePath = '/validate/domain/url/ssrf-threat-check/html-embedded'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // body params $_tempBody = null; if (isset($request)) { diff --git a/lib/Configuration.php b/lib/Configuration.php index 48d30fe..e7bda91 100644 --- a/lib/Configuration.php +++ b/lib/Configuration.php @@ -88,7 +88,7 @@ class Configuration * * @var string */ - protected $userAgent = 'Swagger-Codegen/1.7.7/php'; + protected $userAgent = 'Swagger-Codegen/1.7.8/php'; /** * Debug switch (default set to false) @@ -397,7 +397,7 @@ public static function toDebugReport() $report .= ' OS: ' . php_uname() . PHP_EOL; $report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL; $report .= ' OpenAPI Spec Version: v1' . PHP_EOL; - $report .= ' SDK Package Version: 1.7.7' . PHP_EOL; + $report .= ' SDK Package Version: 1.7.8' . PHP_EOL; $report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL; return $report; diff --git a/lib/Model/UrlHtmlSsrfRequestFull.php b/lib/Model/UrlHtmlSsrfRequestFull.php new file mode 100644 index 0000000..0d872d6 --- /dev/null +++ b/lib/Model/UrlHtmlSsrfRequestFull.php @@ -0,0 +1,303 @@ + 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'url' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'url' => 'URL' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'url' => 'setUrl' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'url' => 'getUrl' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['url'] = isset($data['url']) ? $data['url'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets url + * + * @return string + */ + public function getUrl() + { + return $this->container['url']; + } + + /** + * Sets url + * + * @param string $url URL to validate + * + * @return $this + */ + public function setUrl($url) + { + $this->container['url'] = $url; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/UrlHtmlSsrfResponseFull.php b/lib/Model/UrlHtmlSsrfResponseFull.php new file mode 100644 index 0000000..dd099e8 --- /dev/null +++ b/lib/Model/UrlHtmlSsrfResponseFull.php @@ -0,0 +1,333 @@ + 'bool', + 'http_response_code' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'clean_url' => null, + 'http_response_code' => 'int32' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'clean_url' => 'CleanURL', + 'http_response_code' => 'HttpResponseCode' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'clean_url' => 'setCleanUrl', + 'http_response_code' => 'setHttpResponseCode' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'clean_url' => 'getCleanUrl', + 'http_response_code' => 'getHttpResponseCode' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['clean_url'] = isset($data['clean_url']) ? $data['clean_url'] : null; + $this->container['http_response_code'] = isset($data['http_response_code']) ? $data['http_response_code'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets clean_url + * + * @return bool + */ + public function getCleanUrl() + { + return $this->container['clean_url']; + } + + /** + * Sets clean_url + * + * @param bool $clean_url True if the URL is clean, false if it is at risk of containing an SSRF threat or attack + * + * @return $this + */ + public function setCleanUrl($clean_url) + { + $this->container['clean_url'] = $clean_url; + + return $this; + } + + /** + * Gets http_response_code + * + * @return int + */ + public function getHttpResponseCode() + { + return $this->container['http_response_code']; + } + + /** + * Sets http_response_code + * + * @param int $http_response_code HTTP response code from the URL + * + * @return $this + */ + public function setHttpResponseCode($http_response_code) + { + $this->container['http_response_code'] = $http_response_code; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packageconfig.json b/packageconfig.json index a9ef28a..79c101f 100644 --- a/packageconfig.json +++ b/packageconfig.json @@ -1,5 +1,5 @@ { - "artifactVersion": "1.7.7", + "artifactVersion": "1.7.8", "gitUserId": "Cloudmersive", "gitRepoId": "Cloudmersive.APIClient.PHP.Validate", "composerVendorName": "cloudmersive", diff --git a/test/Api/DomainApiTest.php b/test/Api/DomainApiTest.php index 92eca59..6df0d1a 100644 --- a/test/Api/DomainApiTest.php +++ b/test/Api/DomainApiTest.php @@ -171,6 +171,16 @@ public function testDomainUrlFull() { } + /** + * Test case for domainUrlHtmlSsrfCheck + * + * Check a URL for HTML embedded SSRF threats. + * + */ + public function testDomainUrlHtmlSsrfCheck() + { + } + /** * Test case for domainUrlSyntaxOnly * diff --git a/test/Model/UrlHtmlSsrfRequestFullTest.php b/test/Model/UrlHtmlSsrfRequestFullTest.php new file mode 100644 index 0000000..43c7ca3 --- /dev/null +++ b/test/Model/UrlHtmlSsrfRequestFullTest.php @@ -0,0 +1,86 @@ +