feat(security): add editable cloud credential pages

Add dedicated show/edit pages for cloud provider tokens and cloud-init
scripts, including descriptions and UUID routes.

Generate private keys directly from the index and surface cloud provider
API loading errors in server creation flows.
This commit is contained in:
Andras Bacsai committed 2026-07-08 12:58:27 +02:00
1 parent 7236cb8228
commit e200d881f5
36 files changed
+1196 -126

No files matched your search

@@ -10,6 +10,31 @@ class Index extends Component
{
use AuthorizesRequests;
public function generatePrivateKey(string $type)
{
try {
$this->authorize('create', PrivateKey::class);
if (! in_array($type, ['ed25519', 'rsa'], true)) {
$this->dispatch('error', 'Invalid private key type.');
return;
}
$keyData = PrivateKey::generateNewKeyPair($type);
$privateKey = PrivateKey::createAndStore([
'name' => $keyData['name'],
'description' => $keyData['description'],
'private_key' => $keyData['private_key'],
'team_id' => currentTeam()->id,
]);
return redirectRoute($this, 'security.private-key.show', ['private_key_uuid' => $privateKey->uuid]);
} catch (\Throwable $e) {
return handleError($e, $this);
}
}
public function render()
{
$privateKeys = PrivateKey::ownedByCurrentTeam(['name', 'uuid', 'is_git_related', 'description', 'team_id'])->get();