PHPackages                             yoctu/api-guardian - 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. yoctu/api-guardian

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

yoctu/api-guardian
==================

Protect your API with a token (objective-php)

v1.3.1(7y ago)050.3k↓31.7%1GPL-3.0PHPPHP &gt;=7.0

Since Apr 16Pushed 7y ago1 watchersCompare

[ Source](https://github.com/yoctu/api-guardian)[ Packagist](https://packagist.org/packages/yoctu/api-guardian)[ RSS](/packages/yoctu-api-guardian/feed)WikiDiscussions master Synced yesterday

READMEChangelog (7)Dependencies (3)Versions (8)Used By (0)

API guardian
============

[](#api-guardian)

[![Build Status](https://camo.githubusercontent.com/c30c3f5b5fa9866aacdf4e481f3f697afbf3bb4ca9f70c203f6f1503eb6da966/68747470733a2f2f7472617669732d63692e6f72672f796f6374752f6170692d677561726469616e2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/yoctu/api-guardian)

Protect your pages with a token!

### Prerequisites

[](#prerequisites)

You will need a project running Objective-PHP to use this package.

If you want to use the user token feauture, you'll need a user with the attribute `apiToken`With yoctu/connect you'll need at least connect-common v2.2.3

### Installing

[](#installing)

The package should be easy to install. You just need to add this repository to your composer.json

```
composer require yoctu/api-guardian

```

And add the package to your Application.php with filter(s) if needed.

```
$this->getStep('auth')
    ->plug(Apiguardian::class, new UrlFilter('/api/*'))->as('api-guardian')
;

```

Using the package
-----------------

[](#using-the-package)

Now that the package has been plugged on your application you can setup the one or more token to be used in the configuration.

```
return [
    new Param('api-keys', ['api_key_one', 'api_key_two'])
];

```

You'll now need to add a token to your request to pass the middleware

```
GET / HTTP/1.1
Accept: */*
Accept-Encoding: gzip, deflate
Authorization: api_key_one
Connection: keep-alive

```

Running the tests
-----------------

[](#running-the-tests)

`./vendor/bin/phpunit --bootstrap vendor/autoload.php tests`

License
-------

[](#license)

This project is licensed under the GNU GPL 3.0 License - see the [LICENSE](LICENSE) file for details

###  Health Score

34

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity29

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 95.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 ~26 days

Recently: every ~9 days

Total

7

Last Release

2843d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/6177937?v=4)[Jérôme Schaeffer](/maintainers/Neofox)[@Neofox](https://github.com/Neofox)

---

Top Contributors

[![Neofox](https://avatars.githubusercontent.com/u/6177937?v=4)](https://github.com/Neofox "Neofox (20 commits)")[![rwellens](https://avatars.githubusercontent.com/u/166146?v=4)](https://github.com/rwellens "rwellens (1 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/yoctu-api-guardian/health.svg)

```
[![Health](https://phpackages.com/badges/yoctu-api-guardian/health.svg)](https://phpackages.com/packages/yoctu-api-guardian)
```

###  Alternatives

[kartik-v/yii2-password

Useful password strength validation utilities for Yii Framework 2.0

761.3M17](/packages/kartik-v-yii2-password)[vitalybaev/laravel5-dkim

Laravel 5/6 package for signing outgoing messages with DKIM.

3163.1k](/packages/vitalybaev-laravel5-dkim)

PHPackages © 2026

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