PHPackages                             nowo-tech/password-policy-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Validation &amp; Sanitization](/categories/validation)
4. /
5. nowo-tech/password-policy-bundle

ActiveSymfony-bundle[Validation &amp; Sanitization](/categories/validation)

nowo-tech/password-policy-bundle
================================

Symfony bundle for password policy enforcements including password history, expiry, and validation

v0.0.9(2mo ago)014MITPHPPHP &gt;=8.1 &lt;8.6CI passing

Since Dec 15Pushed 1mo agoCompare

[ Source](https://github.com/nowo-tech/PasswordPolicyBundle)[ Packagist](https://packagist.org/packages/nowo-tech/password-policy-bundle)[ Docs](https://github.com/nowo-tech/password-policy-bundle)[ RSS](/packages/nowo-tech-password-policy-bundle/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (27)Versions (9)Used By (0)

Password Policy Bundle
======================

[](#password-policy-bundle)

[![CI](https://github.com/nowo-tech/PasswordPolicyBundle/actions/workflows/ci.yml/badge.svg)](https://github.com/nowo-tech/PasswordPolicyBundle/actions/workflows/ci.yml) [![Packagist Version](https://camo.githubusercontent.com/beb17bb030c1bd61237e99925b9bb476b52b26130ef88373c173cf152eb300b8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6e6f776f2d746563682f70617373776f72642d706f6c6963792d62756e646c652e7376673f7374796c653d666c6174)](https://packagist.org/packages/nowo-tech/password-policy-bundle) [![Packagist Downloads](https://camo.githubusercontent.com/618964e0c965d0a43b2b2b59702a61ecf8ff694f18dcec45fae180007c84d76f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6e6f776f2d746563682f70617373776f72642d706f6c6963792d62756e646c652e737667)](https://packagist.org/packages/nowo-tech/password-policy-bundle) [![License](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](LICENSE) [![PHP](https://camo.githubusercontent.com/8e58b490725ac49cc8e463c473173681b324c9d92d7854275a785db013ca3de7/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e312532422d3737374242343f6c6f676f3d706870)](https://php.net) [![Symfony](https://camo.githubusercontent.com/8fe7de83f11ab7ca74742794be56f9291632c8351a9ae5baea0bc1e9c4eb5a35/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f53796d666f6e792d3625323025374325323037253230253743253230382d3030303030303f6c6f676f3d73796d666f6e79)](https://symfony.com) [![GitHub stars](https://camo.githubusercontent.com/807dacdebf4462a2d4148bdcf6460c5bef51bf097722a25a0e8b72005f148a51/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f6e6f776f2d746563682f70617373776f72642d706f6c6963792d62756e646c652e7376673f7374796c653d736f6369616c266c6162656c3d53746172)](https://github.com/nowo-tech/PasswordPolicyBundle) [![Coverage](https://camo.githubusercontent.com/cd0704b56f1d56def350b6d0164316307bb2f47834225fd85443b6fb0059bc73/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f436f7665726167652d3130302532352d627269676874677265656e)](#tests-and-coverage)

> ⭐ **Found this useful?** Give it a star on GitHub! It helps us maintain and improve the project.

Symfony bundle for password policy enforcements including password history, expiry, and validation.

Features
--------

[](#features)

- ✅ **Password History Tracking** - Prevents users from reusing old passwords
- ✅ **Password Expiry Enforcement** - Forces password changes after a specified period
- ✅ **Configurable Password Policies** - Per-entity configuration for different policies
- ✅ **Doctrine Lifecycle Events Integration** - Automatic password history tracking
- ✅ **Customizable Expiry Notifications** - Configurable routes and flash messages
- ✅ **Validator Constraint** - Symfony validator for password policy validation
- ✅ **Logging System** - Comprehensive logging for password policy events (configurable levels)
- ✅ **Custom Events** - Symfony events for extensibility (PasswordExpiredEvent, PasswordChangedEvent, etc.)
- ✅ **Performance Cache** - Optional caching for password expiry checks with automatic invalidation
- ✅ **Multiple Entities Support** - Configure different password policies for different user types with validation
- ✅ **Flexible Configuration** - Works out of the box with sensible defaults
- ✅ **Modern Symfony Support** - Compatible with Symfony 6, 7, and 8
- ✅ **Complete Documentation** - Comprehensive PHPDoc comments in English
- ✅ **Demo Projects** - Full-featured demos with visual expiry indicators

**FrankenPHP:** Demos use a **single PHP service** (FrankenPHP, no nginx). With **`APP_ENV=dev`** (default), the Docker **entrypoint swaps in `Caddyfile.dev`** — **`php_server` without workers** for comfortable local development. The baked-in production `Caddyfile` can use **`php_server { worker … }`**; see [docs/DEMO-FRANKENPHP.md](docs/DEMO-FRANKENPHP.md). Access each demo at `http://localhost:PORT` (see `demo/README.md` and `.env`).

Installation
------------

[](#installation)

```
composer require nowo-tech/password-policy-bundle
```

Then, register the bundle in your `config/bundles.php`:

```
