Skip to content

Commit

Permalink
Merge pull request #131 from CyberfusionIO/bugfix/database-users-host
Browse files Browse the repository at this point in the history
Allow the host of the database user to be `null` to match the Core API spec
  • Loading branch information
WilliamDEdwards authored Feb 12, 2025
2 parents b0cd7a1 + 0308031 commit 5e1bb4f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
this package and not the Core API. See the changelog of the [Core API](https://core-api.cyberfusion.io/redoc#section/Changelog)
for detailed information.

## [1.118.1]

### Fixed

- Allow the host of the database user to be `null` to match the Core API spec.

## [1.118.0]

### Added
Expand Down
2 changes: 1 addition & 1 deletion src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class Client implements ClientContract

private const TIMEOUT = 180;

private const VERSION = '1.118.0';
private const VERSION = '1.118.1';

private const USER_AGENT = 'cyberfusion-cluster-api-client/' . self::VERSION;

Expand Down
7 changes: 4 additions & 3 deletions src/Models/DatabaseUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class DatabaseUser extends ClusterModel
private string $name;
private ?string $password;
private ?array $phpmyadminFirewallGroupsIds = null;
private string $host = self::DEFAULT_HOST;
private ?string $host = self::DEFAULT_HOST;
private string $serverSoftwareName = DatabaseEngine::SERVER_SOFTWARE_MARIADB;
private ?int $id = null;
private ?int $clusterId = null;
Expand All @@ -38,16 +38,17 @@ public function setName(string $name): self
return $this;
}

public function getHost(): string
public function getHost(): ?string
{
return $this->host;
}

public function setHost(string $host): self
public function setHost(?string $host): self
{
Validator::value($host)
->maxLength(253)
->valueIn(Host::AVAILABLE)
->nullable()
->validate();

$this->host = $host;
Expand Down

0 comments on commit 5e1bb4f

Please sign in to comment.