Skip to content
/ Veritas Public

Identity and Access Control - simplified, but not anemic [WIP]

License

Notifications You must be signed in to change notification settings

texdc/Veritas

Repository files navigation

Veritas

Identity and Access Control - simplified, but not anemic.

WIP: currently experimental only

Build Status Coverage Status

Passwords and Validation

use texdc\veritas\identity\CryptoServiceInterface;
use texdc\veritas\identity\Password;

class User
{
    /**
     * @var Password
     */
    private $password;
    
    // ...
    
    public function changePassword(string $aPassword, CryptoServiceInterface $aCryptoService)
    {
        $this->setPassword(new Password($aCryptoService->encrypt($aPassword)));
        $this->eventService->publish(new PasswordChangedEvent($this->userId));
    }
    
    protected function setPassword(Password $aPassword)
    {
        if ($this->password == $aPassword) {
            throw new IdenticalPasswordException;
        }
        $this->password = $aPassword;
    }
    
    // ...
}

About

Identity and Access Control - simplified, but not anemic [WIP]

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published