Add some opendj internal attributes. Remove some unused variables in APIController

This commit is contained in:
Deon George 2025-03-11 21:02:11 +11:00
parent af7ca851d5
commit a56b2d8002
5 changed files with 41 additions and 3 deletions

View File

@ -26,12 +26,15 @@ class Factory
'entrycsn' => Internal\CSN::class, 'entrycsn' => Internal\CSN::class,
'entrydn' => Internal\DN::class, 'entrydn' => Internal\DN::class,
'entryuuid' => Internal\UUID::class, 'entryuuid' => Internal\UUID::class,
'etag' => Internal\Etag::class,
'gidnumber' => GidNumber::class, 'gidnumber' => GidNumber::class,
'hassubordinates' => Internal\HasSubordinates::class, 'hassubordinates' => Internal\HasSubordinates::class,
'jpegphoto' => Binary\JpegPhoto::class, 'jpegphoto' => Binary\JpegPhoto::class,
'modifytimestamp' => Internal\Timestamp::class, 'modifytimestamp' => Internal\Timestamp::class,
'modifiersname' => Internal\DN::class, 'modifiersname' => Internal\DN::class,
'numsubordinates' => Internal\NumSubordinates::class,
'objectclass' => ObjectClass::class, 'objectclass' => ObjectClass::class,
'pwdpolicysubentry' => Internal\PwdPolicySubentry::class,
'structuralobjectclass' => Internal\StructuralObjectClass::class, 'structuralobjectclass' => Internal\StructuralObjectClass::class,
'subschemasubentry' => Internal\SubschemaSubentry::class, 'subschemasubentry' => Internal\SubschemaSubentry::class,
'supportedcontrol' => Schema\OID::class, 'supportedcontrol' => Schema\OID::class,

View File

@ -0,0 +1,12 @@
<?php
namespace App\Classes\LDAP\Attribute\Internal;
use App\Classes\LDAP\Attribute\Internal;
/**
* Represents an Etag Attribute
*/
final class Etag extends Internal
{
}

View File

@ -0,0 +1,12 @@
<?php
namespace App\Classes\LDAP\Attribute\Internal;
use App\Classes\LDAP\Attribute\Internal;
/**
* Represents an NumSubordinates Attribute
*/
final class NumSubordinates extends Internal
{
}

View File

@ -0,0 +1,12 @@
<?php
namespace App\Classes\LDAP\Attribute\Internal;
use App\Classes\LDAP\Attribute\Internal;
/**
* Represents an PwdPolicySubentry Attribute
*/
final class PwdPolicySubentry extends Internal
{
}

View File

@ -39,14 +39,13 @@ class APIController extends Controller
*/ */
public function children(Request $request): Collection public function children(Request $request): Collection
{ {
$levels = $request->query('depth',1);
$dn = Crypt::decryptString($request->query('key')); $dn = Crypt::decryptString($request->query('key'));
// Sometimes our key has a command, so we'll ignore it // Sometimes our key has a command, so we'll ignore it
if (str_starts_with($dn,'*') && ($x=strpos($dn,'|'))) if (str_starts_with($dn,'*') && ($x=strpos($dn,'|')))
$dn = substr($dn,$x+1); $dn = substr($dn,$x+1);
Log::debug(sprintf('%s: Query [%s] - Levels [%d]',__METHOD__,$dn,$levels)); Log::debug(sprintf('%s: Query [%s]',__METHOD__,$dn));
return (config('server')) return (config('server'))
->children($dn) ->children($dn)
@ -102,7 +101,7 @@ class APIController extends Controller
* @param string $objectclass * @param string $objectclass
* @return array * @return array
*/ */
public function schema_objectclass_attrs(Request $request,string $objectclass): array public function schema_objectclass_attrs(string $objectclass): array
{ {
$oc = config('server')->schema('objectclasses',$objectclass); $oc = config('server')->schema('objectclasses',$objectclass);