Commit

1de43d9

πŸ” Laravel Sanctum handles API authentication. But issuing tokens is only part of the job. What about permissions, token abuse, expiration, and revocation? We built Sanctum Hardening for Laravel to add those controls without replacing Sanctum. Here's what it covers: πŸ”‘ Strict token abilities Define an explicit catalog of permissions. Wildcard (*) and unknown abilities are rejected when minting tokens. Reserved abilities can only be issued by application code. ⏱️ Token creation limits Require recent password confirmation, restrict token lifetimes, limit the number of active tokens, and throttle token creation. Workspace-scoped tokens are supported, too. πŸ›‘οΈ API rate limiting Apply separate limits per token and per user, preventing someone from bypassing user-level limits by generating additional tokens. πŸ“Š Token activity and auditing Track token usage, record revocations, and notify users about expiring or inactive tokens. Request logs capture the route, HTTP method, and status without storing request payloads. 🚨 API kill switch Set SANCTUM_HARDENING_ENABLED=false to remove routes registered through the package when the API needs to go offline. There's also an optional Livewire interface for creating and revoking tokens, with each token's plaintext value shown only once. The underlying rule is simple: An API token should never grant more permissions than its owner already has. Built for Laravel 13+ and PHP 8.4+. Open source under the MIT license. https://github.com/pushery/sanctum-hardening-for-laravel
GitHubGitHub - pushery/sanctum-hardening-for-laravel: Hardens Laravel Sanctum: token abilities without a wildcard, limits on minting, per-token and per-user throttling, and a switch that removes the API.Hardens Laravel Sanctum: token abilities without a wildcard, limits on minting, per-token and per-user throttling, and a switch that removes the API. - pushery/sanctum-hardening-for-laravel

commit 1de43d9