Add all files

This commit is contained in:
root
2025-11-30 11:57:22 +01:00
parent 2ee51cac4f
commit 044271db3d
1476 changed files with 142544 additions and 0 deletions

View File

@@ -0,0 +1,41 @@
<?php
namespace App\Admin\Resources\OauthClientResource\Pages;
use App\Admin\Resources\OauthClientResource;
use Filament\Resources\Pages\CreateRecord;
use Illuminate\Database\Eloquent\Model;
use Laravel\Passport\ClientRepository;
use Laravel\Passport\Passport;
use phpseclib3\Crypt\RSA;
class CreateOauthClient extends CreateRecord
{
protected static string $resource = OauthClientResource::class;
protected function handleRecordCreation(array $data): Model
{
[$publicKey, $privateKey] = [
Passport::keyPath('oauth-public.key'),
Passport::keyPath('oauth-private.key'),
];
// Do the encryption keys exist?
// Read storage/oauth-private.key and storage/oauth-public.key
if (!file_exists($publicKey) && !file_exists($privateKey)) {
$key = RSA::createKey(4096);
file_put_contents($publicKey, (string) $key->getPublicKey());
file_put_contents($privateKey, (string) $key);
if (!windows_os()) {
chmod($publicKey, 0660);
chmod($privateKey, 0600);
}
}
$clientRepository = new ClientRepository;
$record = $clientRepository->create(null, $data['name'], $data['redirect']);
return $record;
}
}

View File

@@ -0,0 +1,19 @@
<?php
namespace App\Admin\Resources\OauthClientResource\Pages;
use App\Admin\Resources\OauthClientResource;
use Filament\Actions;
use Filament\Resources\Pages\EditRecord;
class EditOauthClient extends EditRecord
{
protected static string $resource = OauthClientResource::class;
protected function getHeaderActions(): array
{
return [
Actions\DeleteAction::make(),
];
}
}

View File

@@ -0,0 +1,19 @@
<?php
namespace App\Admin\Resources\OauthClientResource\Pages;
use App\Admin\Resources\OauthClientResource;
use Filament\Actions;
use Filament\Resources\Pages\ListRecords;
class ListOauthClients extends ListRecords
{
protected static string $resource = OauthClientResource::class;
protected function getHeaderActions(): array
{
return [
Actions\CreateAction::make(),
];
}
}