kakaprodo / presigned-action
A Laravel package for securely presigning actions on any entity, enabling controlled access and authorization without requiring users to share their passwords.
Requires
- php: >=8.0
- kakaprodo/custom-data: >=2.3.5 || dev-develop
- laravel/framework: >=8.0
Requires (Dev)
- phpunit/phpunit: ^9.6
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-09-07 17:34:56 UTC
README
A Laravel package for securely presigning actions on any entity, enabling controlled access and authorization without requiring users to share their passwords.
use Kakaprodo\PresignedAction\Facades\PresignedAction; $accessKey = PresignedAction::generateAccessKey([ 'accessible' => $order, 'whoami' => 'partner-42', 'expires_at' => now()->addHour(), 'scopes' => ['orders.read', 'orders.download'], 'settings' => [ 'source' => 'partner-api', ], ]); return response()->json($accessKey->formatPublicTempKey());
And here is the output
{
"temp_access_key": "eyJpdiI6IndsK3FUUmtQN.....0MzZkZiIsInRhZyI6IiJ9",
"expires_at": 1789009228
}
Why Presigned Action?
In a microservice architecture, a user may be authenticated and authorized by a Core service while the entity she/he needs to access belongs to another service.
For example, a user in a Core service may be authorized to perform an action on a Shop managed by another service. The user should be able to perform that action without having a user account in the Shop service.
Presigned Action provides a way to authorize this cross-service access without duplicating users, roles, or permissions across services.