-
Notifications
You must be signed in to change notification settings - Fork 7
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
base: master
Are you sure you want to change the base?
Conversation
Remove unnecessary comment line
Add new cascading driver and tests for it
public function testTransparent() | ||
{ | ||
//throw exception if no backend provides transparent | ||
$this->setExpectedException(Horde_Auth_Exception::class); |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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); | ||
} |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't use "and".
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...