Skip to content

Commit

Permalink
Allow the host of the database user to be null to match the Core AP…
Browse files Browse the repository at this point in the history
…I spec
  • Loading branch information
dvdheiden committed Feb 12, 2025
1 parent b0cd7a1 commit 0308031
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 0308031

Please sign in to comment.