Files
Jeremy 96c8e8560f feat: API key management with scoped token abilities
Redesign API key creation and enforce scoped abilities on the custom API routes.

- ApiAbility enum and ability enforcement on the custom API routes
- Redesigned API key creation: current user, all/custom permissions, and a
  dedicated one-time token page with a non-HTTPS clipboard fallback
- Restrict custom keys to a known ability allowlist
- Link global search results to the product view page rather than the edit page
2026-06-18 23:13:06 +10:00

28 lines
714 B
PHP

<?php
namespace App\Filament\Resources\ApiKeyResource\Pages;
use App\Filament\Resources\ApiKeyResource;
use Filament\Resources\Pages\Page;
class ApiKeyCreated extends Page
{
protected static string $resource = ApiKeyResource::class;
protected static string $view = 'filament.resources.api-key-resource.pages.api-key-created';
public ?string $plainTextToken = null;
public ?string $keyName = null;
public function mount(): void
{
$this->plainTextToken = session()->pull('api-key.plain_text');
$this->keyName = session()->pull('api-key.name');
if (blank($this->plainTextToken)) {
$this->redirect(ApiKeyResource::getUrl('index'));
}
}
}