Compare commits

...

2 Commits

Author SHA1 Message Date
4209f95231 Revert version to 2.0.3-dev
All checks were successful
Create Docker Image / Test Application (x86_64) (push) Successful in 31s
Create Docker Image / Build Docker Image (x86_64) (push) Successful in 1m27s
Create Docker Image / Build Docker Image (arm64) (push) Successful in 4m46s
Create Docker Image / Final Docker Image Manifest (push) Successful in 8s
2025-03-19 08:36:01 +11:00
696d87d190 Improve entry validation to only require the first item of multi value attributes 2025-03-19 08:36:01 +11:00
3 changed files with 6 additions and 10 deletions

View File

@ -557,10 +557,13 @@ final class AttributeType extends Base {
->unique();
$validation = collect(Arr::get(config('ldap.validation'),$this->name_lc,[]));
// Add in schema required by conditions
if (($heirachy->intersect($this->required_by_object_classes->keys())->count() > 0)
&& (! collect($validation->get($this->name_lc))->contains('required'))) {
$validation->put($this->name_lc,array_merge(['required','min:1'],$validation->get($this->name_lc,[])))
->put($this->name_lc.'.*',array_merge(['required','min:1'],$validation->get($this->name_lc.'.*',[])));
$validation
->prepend(array_merge(['required','min:1'],$validation->get($this->name_lc.'.0',[])),$this->name_lc.'.0')
->prepend(array_merge(['required','array','min:1'],$validation->get($this->name_lc,[])),$this->name_lc);
}
return $validation->toArray();

View File

@ -123,16 +123,12 @@ return [
'validation' => [
'objectclass' => [
'objectclass'=>[
'required',
'array',
'min:1',
new HasStructuralObjectClass,
]
],
'gidnumber' => [
'gidnumber'=> [
'sometimes',
'array',
'max:1'
],
'gidnumber.*' => [
@ -144,7 +140,6 @@ return [
'mail' => [
'mail'=>[
'sometimes',
'array',
'min:1'
],
'mail.*' => [
@ -155,7 +150,6 @@ return [
'userpassword' => [
'userpassword' => [
'sometimes',
'array',
'min:1'
],
'userpassword.*' => [
@ -166,7 +160,6 @@ return [
'uidnumber' => [
'uidnumber' => [
'sometimes',
'array',
'max:1'
],
'uidnumber.*' => [

View File

@ -1 +1 @@
v2.0.2-rel
v2.0.3-dev