PHPackages                             s-deb/slim-security - 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. [Security](/categories/security)
4. /
5. s-deb/slim-security

ActivePhp-middleware[Security](/categories/security)

s-deb/slim-security
===================

A PSR-7 compliant security middle

05PHP

Since Apr 9Pushed 9y ago1 watchersCompare

[ Source](https://github.com/sudiptadeb/slim-security)[ Packagist](https://packagist.org/packages/s-deb/slim-security)[ RSS](/packages/s-deb-slim-security/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Slim Security
-------------

[](#slim-security)

A PSR7 compliant PHP middleware to meet all your security needs.

This project has just started, but to give you an idea about how this will be when you use it. See the sample configuration below.

There are two ways to congifure the middleware.

- Directly when defining the middleware for each route
- Globally via a config file (sample configureation below) and just make sure that this is invoked for every request. This will provide a way for even non middleware based projects to use this by just manually calling this on every page

#### Sample configuration (middleware init)

[](#sample-configuration-middleware-init)

```
$app->addRoute('/dashboard/add*',['POST'],function(){})
        ->add(new SDeb\slim-security\SeceuiryMiddleware(
        {
            "csrf":true,
            "auth":true,
            "role":["ADMIN"],
            "params":[
                {
                    "name":"id",
                    "type":"long",
                    "required":true
                },
                {
                    "name":"action",
                    "type":"regex",
                    "regex":"ADD|DELETE|MODIFY"
                    "required":true
                },
            ]
        }))

```

#### Sample configuration (global config):

[](#sample-configuration-global-config)

```
{
    "properties":{
        "csrf-param-name":"mycsrfparam",
        "csrf-cookie-name":"mycsrfcookie",
        "auth-provider":"Debmego\common\AuthProvider",
        "...":"..."
    },
    "paths":[
        {
        "path":"/dashboard/add*",
        "method":["POST"],
        "csrf":true,
        "auth":true,
        "role":["ADMIN"],
        "params":[
            {
                "name":"id",
                "type":"long",
                "required":true
            },
            {
                "name":"action",
                "type":"regex",
                "regex":"ADD|DELETE|MODIFY"
                "required":true
            },
        ]
        }
    ]
}

```

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 66.7% 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.

### Community

---

Top Contributors

[![sudipta-deb-3385](https://avatars.githubusercontent.com/u/226482804?v=4)](https://github.com/sudipta-deb-3385 "sudipta-deb-3385 (4 commits)")[![sudiptadeb](https://avatars.githubusercontent.com/u/5412600?v=4)](https://github.com/sudiptadeb "sudiptadeb (2 commits)")

### Embed Badge

![Health badge](/badges/s-deb-slim-security/health.svg)

```
[![Health](https://phpackages.com/badges/s-deb-slim-security/health.svg)](https://phpackages.com/packages/s-deb-slim-security)
```

###  Alternatives

[defuse/php-encryption

Secure PHP Encryption Library

3.9k162.4M214](/packages/defuse-php-encryption)[roave/security-advisories

Prevents installation of composer packages with known security vulnerabilities: no API, simply require it

2.9k97.3M6.4k](/packages/roave-security-advisories)[mews/purifier

Laravel 5/6/7/8/9/10 HtmlPurifier Package

2.0k16.7M113](/packages/mews-purifier)[robrichards/xmlseclibs

A PHP library for XML Security

41278.1M118](/packages/robrichards-xmlseclibs)[bjeavons/zxcvbn-php

Realistic password strength estimation PHP library based on Zxcvbn JS

86917.5M63](/packages/bjeavons-zxcvbn-php)[enlightn/security-checker

A PHP dependency vulnerabilities scanner based on the Security Advisories Database.

33732.2M110](/packages/enlightn-security-checker)

PHPackages © 2026

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