Skip to content

Commit

Permalink
1.7.8
Browse files Browse the repository at this point in the history
  • Loading branch information
Cloudmersive committed May 9, 2021
1 parent ad0f823 commit 90d7d7e
Show file tree
Hide file tree
Showing 13 changed files with 1,172 additions and 5 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cloudmersive/cloudmersive_validate_api_client",
"version": "1.7.7",
"version": "1.7.8",
"description": "",
"keywords": [
"swagger",
Expand Down
56 changes: 56 additions & 0 deletions docs/Api/DomainApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down Expand Up @@ -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
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: Apikey
$config = Swagger\Client\Configuration::getDefaultConfiguration()->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)
Expand Down
10 changes: 10 additions & 0 deletions docs/Model/UrlHtmlSsrfRequestFull.md
Original file line number Diff line number Diff line change
@@ -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)


11 changes: 11 additions & 0 deletions docs/Model/UrlHtmlSsrfResponseFull.md
Original file line number Diff line number Diff line change
@@ -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)


262 changes: 262 additions & 0 deletions lib/Api/DomainApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down
Loading

0 comments on commit 90d7d7e

Please sign in to comment.