Skip to content

Commit

Permalink
Ad DCV hostname fetching
Browse files Browse the repository at this point in the history
We can check what we need to validate programatically
  • Loading branch information
phily245 committed May 9, 2023
1 parent 7168956 commit a66487c
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/SSL/DcvClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@
use UKFast\SDK\Client as BaseClient;
use UKFast\SDK\Exception\ApiException;
use UKFast\SDK\SSL\Entities\Certificate;
use UKFast\SDK\SSL\Entities\Dcv;

class DcvClient extends BaseClient
{
const MAP = [];

protected $basePath = 'ssl/';

/**
Expand Down Expand Up @@ -40,4 +43,12 @@ public function validate(Certificate $certificate)

return true;
}

public function getHostnames(Certificate $certificate)
{
$response = $this->get('v1/dcv/' . urlencode($certificate->id) . '/hostnames');
$body = $this->decodeJson($response->getBody()->getContents());

return new Dcv($this->apiToFriendly($body->data, static::MAP));
}
}
13 changes: 13 additions & 0 deletions src/SSL/Entities/Dcv.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

namespace UKFast\SDK\SSL\Entities;

use UKFast\SDK\Entity;

/**
* @property string[] $hostnames
*/
class Dcv extends Entity
{
//
}

0 comments on commit a66487c

Please sign in to comment.