Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Cascading and Mock Auth Drivers #3

Open
wants to merge 18 commits into
base: master
Choose a base branch
from

Conversation

ralflang
Copy link
Member

This is the Mock Driver from PR #1 and a reworked version of the Auth_Fallback driver originally rejected upstream. It's now the "Cascading" driver, able to aggregate multiple backends for transition scenarios or running a local admin account database along an ldap for normal users. Please review.

However, the yaml file looks wrong (re-activating authors deactivated by a recent commit). Possibly a merge victim...

public function testTransparent()
{
//throw exception if no backend provides transparent
$this->setExpectedException(Horde_Auth_Exception::class);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This make the Travis test fail on PHP 5.4.

* @param array $params Required parameters:
* <pre>
* 'drivers' - array hash of (Horde_Auth_Base) The list of backend drivers.
* 'order' - a list of drivers indexes to define a default order.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is 'order' necessary? Why not using the order of 'drivers'?

* 'order' - a list of drivers indexes to define a default order.
* </pre>
*
* 'capabilities' - defines capabilities this driver
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be part of the parameters, right?

public function getParams() //test function to see all arrays
{
return($this->_test);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove test code.

$newPassword .= $characters[rand(0, $charactersLength - 1)];
}
}
$credentials = array('password' => $newPassword);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There already is Horde_Auth::genRandomPassword()

public function exists($userId)
{
// rotate through all backends which have list capabddlity or exists capability - return true if any backend has this user, otherwise return false.
if (!$this->hasCapability('list') and !$this->hasCapability('exists')) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't use "and".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants