https://github.com/texdc/veritas
Identity and Access Control - simplified, but not anemic [WIP]
https://github.com/texdc/veritas
Last synced: about 1 year ago
JSON representation
Identity and Access Control - simplified, but not anemic [WIP]
- Host: GitHub
- URL: https://github.com/texdc/veritas
- Owner: texdc
- License: mit
- Created: 2013-12-28T04:46:17.000Z (over 12 years ago)
- Default Branch: develop
- Last Pushed: 2017-07-26T19:24:07.000Z (almost 9 years ago)
- Last Synced: 2025-02-04T19:46:03.223Z (over 1 year ago)
- Language: PHP
- Homepage:
- Size: 54.7 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Veritas
=========
Identity and Access Control - simplified, but not anemic.
#### WIP: currently experimental only
[](https://travis-ci.org/texdc/Veritas)
[](https://coveralls.io/r/texdc/Veritas?branch=develop)
Passwords and Validation
------------------------
```php
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;
}
// ...
}
```