PHPackages                             artapamudaid/secure-api-server - 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. artapamudaid/secure-api-server

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

artapamudaid/secure-api-server
==============================

Laravel package for secure API HMAC authentication

1.0.0(10mo ago)03MITPHPCI passing

Since Jul 16Pushed 9mo agoCompare

[ Source](https://github.com/artapamudaid/SecureApiServer)[ Packagist](https://packagist.org/packages/artapamudaid/secure-api-server)[ RSS](/packages/artapamudaid-secure-api-server/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (2)Versions (2)Used By (0)

SecureApiServer
===============

[](#secureapiserver)

[![License](https://camo.githubusercontent.com/a4c492eca17ec9996518bd4c160dbec860a5e02b0a556d76dd40fa9c346619c0/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6172746170616d75646169642f5365637572654170695365727665722e737667)](LICENSE)[![Latest Version on Packagist](https://camo.githubusercontent.com/0a6f4b84f770438e74dffca73656181262cbf00b2206f5063c38144f1b2cb716/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6172746170616d75646169642f7365637572652d6170692d7365727665722e737667)](https://packagist.org/packages/artapamudaid/secure-api-server)[![CI](https://github.com/artapamudaid/SecureApiServer/actions/workflows/test.yml/badge.svg)](https://github.com/artapamudaid/SecureApiServer/actions)[![Tested Laravel Versions](https://camo.githubusercontent.com/905e82b78e0dbf982e71753a2e9bece4735b8e64c3404f0e546fd3b130ef09da/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d3825324339253243313025324331312d677265656e)](https://laravel.com)

A secure API authentication package for Laravel using API Key + Secret + HMAC signature with nonce &amp; timestamp validation.
Built for protecting internal or third-party API calls with full management support.

---

✨ Features
----------

[](#-features)

- 🔑 Generate secure API Key &amp; Secret
- 🔐 Validate signature using HMAC
- 🕒 Protects with `X-TIMESTAMP` and `X-NONCE`
- 🚫 Revoke or delete API Keys
- 👤 Enforce one key per user
- 📦 Fully tested with PHPUnit 12

---

📦 Installation (via Packagist)
------------------------------

[](#-installation-via-packagist)

```
composer require artapamudaid/secure-api-server
```

Lalu:

```
php artisan vendor:publish --tag=config
php artisan migrate
```

---

⚙️ Configuration
----------------

[](#️-configuration)

Konfigurasi berada di `config/apikey.php`:

```
return [
    'enabled' => true,
    'timestamp_tolerance' => 300, // in seconds (default 5 minutes)
];
```

---

🚀 API Endpoints
---------------

[](#-api-endpoints)

MethodEndpointDescriptionPOST`/secure-api/key`Generate API key + secretGET`/secure-api/keys`List all API keysDELETE`/secure-api/key/{id}`Delete API keyPATCH`/secure-api/key/{id}/revoke`Revoke API keyPOST`/secure-api/ping`Test secure endpoint---

🧾 Required Headers for Secured Endpoints
----------------------------------------

[](#-required-headers-for-secured-endpoints)

```
X-API-KEY: {api_key}
X-API-SIGNATURE: {hmac_signature}
X-TIMESTAMP: {unix_timestamp}
X-NONCE: {random_string}
```

### HMAC Signature format:

[](#hmac-signature-format)

```
HMAC_SHA256(api_key . nonce . timestamp, secret)
```

---

🧪 Running Tests
---------------

[](#-running-tests)

```
composer install
vendor/bin/phpunit
```

Dibangun menggunakan:

- PHPUnit ^12.0
- Orchestra Testbench (Laravel testing framework)

---

🛡 Laravel Compatibility
-----------------------

[](#-laravel-compatibility)

Laravel VersionSupport8.x✅9.x✅10.x✅11.x✅

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance56

Moderate activity, may be stable

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity36

Early-stage or recently created project

 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

Unknown

Total

1

Last Release

306d ago

### Community

Maintainers

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

---

Top Contributors

[![artapamudaid](https://avatars.githubusercontent.com/u/60279958?v=4)](https://github.com/artapamudaid "artapamudaid (5 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/artapamudaid-secure-api-server/health.svg)

```
[![Health](https://phpackages.com/badges/artapamudaid-secure-api-server/health.svg)](https://phpackages.com/packages/artapamudaid-secure-api-server)
```

###  Alternatives

[namshi/jose

JSON Object Signing and Encryption library for PHP.

1.8k99.6M101](/packages/namshi-jose)[league/oauth1-client

OAuth 1.0 Client Library

99698.8M106](/packages/league-oauth1-client)[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k2.9M88](/packages/bezhansalleh-filament-shield)[gesdinet/jwt-refresh-token-bundle

Implements a refresh token system over Json Web Tokens in Symfony

70516.4M35](/packages/gesdinet-jwt-refresh-token-bundle)[league/oauth2-google

Google OAuth 2.0 Client Provider for The PHP League OAuth2-Client

41721.2M118](/packages/league-oauth2-google)[illuminate/auth

The Illuminate Auth package.

9327.3M1.0k](/packages/illuminate-auth)

PHPackages © 2026

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