Skip to content

Commit

Permalink
Merge pull request #514 from ans-group/dcv-validation
Browse files Browse the repository at this point in the history
Validates by certificate ID and DCV type
  • Loading branch information
phily245 authored Apr 27, 2023
2 parents 87d7ff0 + 343372a commit cb9dc81
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/SSL/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,9 @@ public function validation()
{
return (new ValidationClient($this->httpClient))->auth($this->token);
}

public function dcv()
{
return (new DcvClient($this->httpClient))->auth($this->token);
}
}
27 changes: 27 additions & 0 deletions src/SSL/DcvClient.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

namespace UKFast\SDK\SSL;

use UKFast\SDK\Client as BaseClient;
use UKFast\SDK\Exception\ApiException;
use UKFast\SDK\SSL\Entities\Certificate;

class DcvClient extends BaseClient
{
protected $basePath = 'ssl/';

/**
* Validates a certificate against dcv type
*
* @param Certificate $certificate
* @return true
* @throws ApiException
*/
public function validate(Certificate $certificate)
{
$url = 'v1/dcv/' . urlencode($certificate->id) . '/validate';
$this->post($url);

return true;
}
}

0 comments on commit cb9dc81

Please sign in to comment.