PHPackages                             despark/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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. despark/password-policy-bundle

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

despark/password-policy-bundle
==============================

Password policy enforcements

v0.1.10(6y ago)32.4k3MITPHPPHP ^7.1|^7.2CI failing

Since Jul 9Pushed 6y ago3 watchersCompare

[ Source](https://github.com/despark/password-policy-bundle)[ Packagist](https://packagist.org/packages/despark/password-policy-bundle)[ RSS](/packages/despark-password-policy-bundle/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (10)Dependencies (7)Versions (12)Used By (0)

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

[](#password-policy-bundle)

[![Build Status](https://camo.githubusercontent.com/0f5f46bf3c7b357831f0377fad859337af158d2b7dcc36d3c678d3947639bd31/68747470733a2f2f7472617669732d63692e6f72672f6465737061726b2f70617373776f72642d706f6c6963792d62756e646c652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/despark/password-policy-bundle)

### Installation

[](#installation)

```
composer require despark/password-policy-bundle
```

### Configuration

[](#configuration)

1. Implement `Despark\PasswordPolicyBundle\Model\HasPasswordPolicyInterface` in the entities that you want to support password policies.
2. Implement `Despark\PasswordPolicyBundle\Model\PasswordHistoryInterface` in a new entity that will hold the password history records.
3. Configure how Password policy will behave on every entity. Configuration example is [here](#configuration-example)
4. You need to add `@PasswordPolicy()` validation rules to your `$plainPassword` field

###### Configuration example:

[](#configuration-example)

```
password_policy:
    entities:
        # the entity class implementing HasPasswordPolicyInterface
        App\Entity\Participant:
            # The route where the user will be locked when password is expired
            lock_route: participant_profile

            # Params to pass to the locked param when build.
            lock_route_params:
                    locked: '1'

            # Which is the password property in the entity (defaults to 'password')
            password_field: ~

            # Password history property in the entity (default to 'passwordHistory')
            password_history_field: ~

            # How many password changes to track (defaults to 3)
            passwords_to_remember: ~

            # Force expiry of the password in that many days
            expiry_days: ~
        App\Entity\User:
            lock_route: admin_app_user_edit
            lock_route_params:
                    # {id} will paresed as current user id when possible
                    id: '{id}'
    expiry_listener:
            # You can change the expiry listener priority
            priority: 0
            error_msg:
                text: 'Your password expired. You need to change it'
                type: 'error'

        listener_priority: 0
        # The route that needs to be shown to the user when password is expired
        lock_route: participant_settings
        # These routes will be excluded from the expiry check
        excluded_routes: ~

```

##### Expiry

[](#expiry)

Expiry works by checking last password change on every request made to the app, excluding those configured in the application

##### Good to know

[](#good-to-know)

The library uses doctrine lifecycle events to create password history and set last password change on the target entities. In order for this to happen we use the onFlush event and we are recalculating the history change set inside it. You must be aware of that as any entity changes after the recalculation will not be persisted to the database.

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 76.2% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~54 days

Recently: every ~130 days

Total

11

Last Release

2367d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/dd9812fc1e73e6abab81c545077695802ae2579f2320084a92074f1cf23d02c2?d=identicon)[lsimeonov](/maintainers/lsimeonov)

---

Top Contributors

[![lsimeonov](https://avatars.githubusercontent.com/u/17702047?v=4)](https://github.com/lsimeonov "lsimeonov (16 commits)")[![p-stoyanov](https://avatars.githubusercontent.com/u/50139931?v=4)](https://github.com/p-stoyanov "p-stoyanov (2 commits)")[![daniel-valchev-despark](https://avatars.githubusercontent.com/u/42747149?v=4)](https://github.com/daniel-valchev-despark "daniel-valchev-despark (1 commits)")[![ysimeonov](https://avatars.githubusercontent.com/u/41576031?v=4)](https://github.com/ysimeonov "ysimeonov (1 commits)")[![zecho](https://avatars.githubusercontent.com/u/596310?v=4)](https://github.com/zecho "zecho (1 commits)")

---

Tags

passwordpassword-expirationpassword-historypassword-policysymfony4

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/despark-password-policy-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/despark-password-policy-bundle/health.svg)](https://phpackages.com/packages/despark-password-policy-bundle)
```

###  Alternatives

[rcsofttech/audit-trail-bundle

Enterprise-grade, high-performance Symfony audit trail bundle. Automatically track Doctrine entity changes with split-phase architecture, multiple transports (HTTP, Queue, Doctrine), and sensitive data masking.

1175.2k](/packages/rcsofttech-audit-trail-bundle)[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k17.5M378](/packages/easycorp-easyadmin-bundle)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.4M196](/packages/sulu-sulu)[oro/platform

Business Application Platform (BAP)

642140.7k104](/packages/oro-platform)[open-dxp/opendxp

Content &amp; Product Management Framework (CMS/PIM)

9317.2k55](/packages/open-dxp-opendxp)[kimai/kimai

Kimai - Time Tracking

4.8k8.7k1](/packages/kimai-kimai)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
