mirror of
https://github.com/pelican-dev/panel.git
synced 2025-05-20 05:14:46 +02:00
Simplify and restrict api keys
This commit is contained in:
parent
05e9f12dc4
commit
99693367d3
@ -46,6 +46,7 @@ class ApiKeyResource extends Resource
|
||||
Forms\Components\Hidden::make('token')->default(encrypt(str_random(ApiKey::KEY_LENGTH))),
|
||||
|
||||
Forms\Components\Select::make('user_id')
|
||||
->hidden()
|
||||
->searchable()
|
||||
->preload()
|
||||
->relationship('user', 'username')
|
||||
@ -66,6 +67,7 @@ class ApiKeyResource extends Resource
|
||||
->filter(fn ($value, $key) => $key <= ApiKey::TYPE_APPLICATION || $apiKey->key_type === $key)
|
||||
->all();
|
||||
})
|
||||
->hidden()
|
||||
->selectablePlaceholder(false)
|
||||
->required()
|
||||
->default(ApiKey::TYPE_APPLICATION),
|
||||
|
@ -9,4 +9,6 @@ use Filament\Resources\Pages\CreateRecord;
|
||||
class CreateApiKey extends CreateRecord
|
||||
{
|
||||
protected static string $resource = ApiKeyResource::class;
|
||||
|
||||
protected ?string $heading = 'Create Application API Key';
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user