API query and CI to build the docker demo image

Remove unused CI, removed some debugging for the demo
This commit is contained in:
Deon George
2020-08-31 21:41:45 +10:00
parent de4fa04d3b
commit 6620b9147e
10 changed files with 315 additions and 29 deletions

View File

@@ -18,6 +18,7 @@ class Server
*/
public function getBaseDN(): ?Collection
{
//findBaseDn()?
// If the base is set in the configuration file, then just return that after validating it exists.
// @todo
if (false) {
@@ -41,8 +42,6 @@ class Server
protected function getDNAttrValues(string $dn,array $attrs=['*','+'],int $deref=LDAP_DEREF_NEVER): ?Entry
{
try {
dump(config('ldap.connections.default.settings'));
return ($x=(new Adldap)
->addProvider(config('ldap.connections.default.settings'))
->search()
@@ -54,4 +53,27 @@ class Server
dd(['e'=>$e]);
}
}
/**
* Query the server for a DN
*
* @param string $dn
* @return |null
*/
public function query(string $dn)
{
try {
return ($x=(new Adldap)
->addProvider(config('ldap.connections.default.settings'))
->search()
->setBaseDn($dn)
//->select($attrs)
->listing()
->get()) ? $x : NULL;
// @todo Tidy up this exception
} catch (\Exception $e) {
dd(['e'=>$e]);
}
}
}