Skip to content

Commit

Permalink
Merge pull request #108 from CyberfusionIO/feature/1.111.0
Browse files Browse the repository at this point in the history
Improve validation and make field nullable
  • Loading branch information
dvdheiden authored Mar 20, 2024
2 parents 29879f0 + 1191904 commit 87b620a
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 9 deletions.
20 changes: 15 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,23 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
this package and not the cluster API. See the changelog of the [cluster API](https://cluster-api.cyberfusion.nl/redoc#section/Changelog)
for detailed information.

# [1.110.0]
## [1.111.0]

### Changed

- Updated the minimum password length validation for the `HtpasswdUser` model.

### Fixed

- Change the `directory_path` to be nullable for the `BasicAuthenticationRealm` model.

## [1.110.0]

### Added

- Add support for Laravel 11.

# [1.109.0]
## [1.109.0]

### Changed

Expand All @@ -23,19 +33,19 @@ for detailed information.
* Cluster malware toolkit attributes.
* Firewall rules update endpoint.

# [1.108.2]
## [1.108.2]

### Fixed

* In clusters, add `nullable()` to `meilisearchEnvironment` validator. This one was missed in 1.108.1.

# [1.108.1]
## [1.108.1]

### Fixed

* In clusters, add `nullable()` to validators where missing.

# [1.108.0]
## [1.108.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.110.0';
private const VERSION = '1.111.0';

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

Expand Down
8 changes: 5 additions & 3 deletions src/Models/BasicAuthenticationRealm.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
class BasicAuthenticationRealm extends ClusterModel
{
private string $name;
private string $directoryPath;
private ?string $directoryPath;
private int $virtualHostId;
private int $htpasswdFileId;
private ?int $id = null;
Expand All @@ -24,6 +24,7 @@ public function getName(): string
public function setName(string $name): self
{
Validator::value($name)
->minLength(1)
->maxLength(64)
->pattern('^[a-zA-Z0-9-_ ]+$')
->validate();
Expand All @@ -33,15 +34,16 @@ public function setName(string $name): self
return $this;
}

public function getDirectoryPath(): string
public function getDirectoryPath(): ?string
{
return $this->directoryPath;
}

public function setDirectoryPath(string $directoryPath): self
public function setDirectoryPath(?string $directoryPath): self
{
Validator::value($directoryPath)
->path()
->nullable()
->validate();

$this->directoryPath = $directoryPath;
Expand Down
2 changes: 2 additions & 0 deletions src/Models/HtpasswdUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public function getUsername(): string
public function setUsername(string $username): self
{
Validator::value($username)
->minLength(1)
->maxLength(255)
->pattern('^[a-z0-9-_]+$')
->validate();
Expand All @@ -40,6 +41,7 @@ public function getPassword(): string
public function setPassword(string $password): self
{
Validator::value($password)
->minLength(24)
->maxLength(255)
->pattern('^[ -~]+$')
->validate();
Expand Down

0 comments on commit 87b620a

Please sign in to comment.