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

@@ -22,6 +22,8 @@ class CloudProviderTokenForm extends Component
public string $name = '';
public ?string $description = null;
public function mount()
{
try {
@@ -37,6 +39,7 @@ class CloudProviderTokenForm extends Component
'provider' => 'required|string|in:hetzner,digitalocean,vultr',
'token' => 'required|string',
'name' => 'required|string|max:255',
'description' => 'nullable|string|max:1000',
];
}
@@ -94,11 +97,14 @@ class CloudProviderTokenForm extends Component
return $this->dispatch('error', 'Invalid API token. Please check your token and try again.');
}
$description = trim($this->description ?? '');
$savedToken = CloudProviderToken::create([
'team_id' => currentTeam()->id,
'provider' => $this->provider,
'token' => $this->token,
'name' => $this->name,
'description' => $description === '' ? null : $description,
]);
auditLog('ui.cloud_token.created', [
@@ -108,7 +114,7 @@ class CloudProviderTokenForm extends Component
'provider' => $savedToken->provider,
]);
$this->reset(['token', 'name']);
$this->reset(['token', 'name', 'description']);
// Dispatch event with token ID so parent components can react
$this->dispatch('tokenAdded', tokenId: $savedToken->id);