PHPackages                             kaxiluo/api-signature - 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. [API Development](/categories/api)
4. /
5. kaxiluo/api-signature

ActiveLibrary[API Development](/categories/api)

kaxiluo/api-signature
=====================

api signature and verification, guzzle signature middleware, signature verify middleware

1.1.0(4y ago)225MITPHPPHP &gt;=7.0

Since May 20Pushed 4y ago1 watchersCompare

[ Source](https://github.com/kaxiluo/api-signature)[ Packagist](https://packagist.org/packages/kaxiluo/api-signature)[ RSS](/packages/kaxiluo-api-signature/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (8)Versions (3)Used By (0)

API Signature, Verification
===========================

[](#api-signature-verification)

api signature and verification, easy to use it by middleware. or use it alone.

- Request signer
- Use request sign middleware to create guzzle client
- Signature validator
- General signature verify middleware
- Use signature verify middleware in laravel、hyperf ...

Installing
----------

[](#installing)

Package is available on [Packagist](https://packagist.org/packages/kaxiluo/api-signature),

```
composer require kaxiluo/api-signature
```

Usage
-----

[](#usage)

### Client (Request Sign)

[](#client-request-sign)

```
// use as guzzle client config
$config = [
    'base_uri' => 'https://yourserver.host',
    'verify' => false,
];
// create guzzle client with request sign middleware
$client = \Kaxiluo\ApiSignature\Client\GuzzleClientFactory::createClient('1', 'iamsecret', $config);
// enjoy..
$client->get('/test');
```

other, use it alone see: `\Kaxiluo\ApiSignature\Client\RequestSigner`

### Server (Signature Verify)

[](#server-signature-verify)

using laravel middleware

```
use Kaxiluo\ApiSignature\Server\SignatureVerifyLaravelMiddleware;

class MySignatureVerifyMiddleware extends SignatureVerifyLaravelMiddleware
{
    // custom signature header name. default is X-Signature
    protected $headerName = 'X-Your-Custom-Name';

    // nonce ttl. default is 300 s
    protected $lifetime = 500;

    protected function getAppSecretByAppId($appId): string
    {
        // TODO: Implement getAppSecretByAppId() method.
        // you can filter app_secret from config
        //return config('api.your-client.app_secret');
    }

    protected function getCacheProvider()
    {
        return app('cache.store');
    }
}
```

using hyperf middleware

```
use Kaxiluo\ApiSignature\Exception\InvalidSignatureException;
use Kaxiluo\ApiSignature\Server\SignatureVerifyPsrMiddleware;
use Psr\Container\ContainerInterface;
use Psr\SimpleCache\CacheInterface;

class MySignatureVerifyMiddleware extends SignatureVerifyPsrMiddleware
{
    /**
     * @var ContainerInterface
     */
    protected $container;

    public function __construct(ContainerInterface $container)
    {
        $this->container = $container;
    }

    protected function handleInvalidSignature(InvalidSignatureException $exception)
    {
        return $this->container->get(\Hyperf\HttpServer\Contract\ResponseInterface::class)
            ->json(['error' => $exception->getMessage()])
            ->withStatus(401);
    }

    protected function getCacheProvider(): CacheInterface
    {
        return $this->container->get(CacheInterface::class);
    }

    protected function getAppSecretByAppId($appId): string
    {
        // TODO: Implement getAppSecretByAppId() method.
        // you can filter app_secret from config
    }
}
```

other, use it alone see: `\Kaxiluo\ApiSignature\Server\SignatureValidator`, `\Kaxiluo\ApiSignature\Server\SignatureVerifyMiddleware`

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~9 days

Total

2

Last Release

1807d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/27921328?v=4)[linyiyong](/maintainers/linyiyong)[@linyiyong](https://github.com/linyiyong)

---

Top Contributors

[![kaxiluo](https://avatars.githubusercontent.com/u/32103283?v=4)](https://github.com/kaxiluo "kaxiluo (9 commits)")

---

Tags

php-middlewarephpmiddlewareapisignatureverification

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/kaxiluo-api-signature/health.svg)

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

###  Alternatives

[algolia/algoliasearch-client-php

API powering the features of Algolia.

69333.0M114](/packages/algolia-algoliasearch-client-php)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[theodo-group/llphant

LLPhant is a library to help you build Generative AI applications.

1.5k311.5k5](/packages/theodo-group-llphant)[wordpress/php-ai-client

A provider agnostic PHP AI client SDK to communicate with any generative AI models of various capabilities using a uniform API.

26236.6k14](/packages/wordpress-php-ai-client)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

595.2M386](/packages/shopware-core)[mozex/anthropic-php

Anthropic PHP is a supercharged community-maintained PHP API client that allows you to interact with Anthropic API.

46365.1k13](/packages/mozex-anthropic-php)

PHPackages © 2026

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