[PR #202] [MERGED] feat: add automatic API token creation wizard for cluster registration #194

Closed
opened 2026-02-26 17:37:42 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Corsinvest/cv4pve-admin/pull/202
Author: @franklupo
Created: 2/25/2026
Status: Merged
Merged: 2/25/2026
Merged by: @franklupo

Base: mainHead: feat/cluster-api-token-wizard


📝 Commits (1)

  • 594e9ca feat: add automatic API token creation wizard for cluster registration

📊 Changes

9 files changed (+172 additions, -15 deletions)

View changed files

📝 src/Corsinvest.ProxmoxVE.Admin.Core/Components/Layout/MainLayout.razor.cs (+2 -0)
src/Corsinvest.ProxmoxVE.Admin.Core/Extensions/NavigationManagerExtensions.cs (+11 -0)
📝 src/Corsinvest.ProxmoxVE.Admin.Core/Services/AdminService.cs (+1 -1)
📝 src/Corsinvest.ProxmoxVE.Admin.Core/Services/IAdminService.cs (+1 -0)
📝 src/Corsinvest.ProxmoxVE.Admin.Module.System/Components/ClusterConfig/ClusterSettingsDialog.razor (+16 -2)
📝 src/Corsinvest.ProxmoxVE.Admin.Module.System/Components/ClusterConfig/ClusterSettingsDialog.razor.cs (+68 -7)
src/Corsinvest.ProxmoxVE.Admin.Module.System/Components/ClusterConfig/CreateApiTokenDialog.razor (+57 -0)
src/Corsinvest.ProxmoxVE.Admin.Module.System/Components/ClusterConfig/CreateApiTokenModel.cs (+12 -0)
📝 src/Corsinvest.ProxmoxVE.Admin.Module.System/Components/ClusterConfig/RenderClustersSettings.razor.cs (+4 -5)

📄 Description

Summary

  • Add CreateApiTokenDialog with Username, Password, TokenName fields and data annotation validation
  • CreateApiTokenAsync in ClusterSettingsDialog: creates dedicated cv4pve-admin@pve user, assigns PVEAdmin role on /, generates API token with privsep=0
  • Expose IAdminService.CreateClusterClient() as public (needed by wizard)
  • Add NavigationManagerExtensions.ForceReload() helper
  • Fix RenderClustersSettings: remove duplicate sialogService parameter, use ForceReload()
  • Add 🔑 button next to API Token field in ClusterSettingsDialog

Test plan

  • Click 🔑 → dialog opens asking for Username, Password, Token Name
  • Submit → dedicated user and token created on Proxmox cluster
  • Token auto-populated in API Token field
  • Copy dialog shown once
  • Username/password not saved anywhere

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Corsinvest/cv4pve-admin/pull/202 **Author:** [@franklupo](https://github.com/franklupo) **Created:** 2/25/2026 **Status:** ✅ Merged **Merged:** 2/25/2026 **Merged by:** [@franklupo](https://github.com/franklupo) **Base:** `main` ← **Head:** `feat/cluster-api-token-wizard` --- ### 📝 Commits (1) - [`594e9ca`](https://github.com/Corsinvest/cv4pve-admin/commit/594e9caac27c368fad672bd23f750062564d8884) feat: add automatic API token creation wizard for cluster registration ### 📊 Changes **9 files changed** (+172 additions, -15 deletions) <details> <summary>View changed files</summary> 📝 `src/Corsinvest.ProxmoxVE.Admin.Core/Components/Layout/MainLayout.razor.cs` (+2 -0) ➕ `src/Corsinvest.ProxmoxVE.Admin.Core/Extensions/NavigationManagerExtensions.cs` (+11 -0) 📝 `src/Corsinvest.ProxmoxVE.Admin.Core/Services/AdminService.cs` (+1 -1) 📝 `src/Corsinvest.ProxmoxVE.Admin.Core/Services/IAdminService.cs` (+1 -0) 📝 `src/Corsinvest.ProxmoxVE.Admin.Module.System/Components/ClusterConfig/ClusterSettingsDialog.razor` (+16 -2) 📝 `src/Corsinvest.ProxmoxVE.Admin.Module.System/Components/ClusterConfig/ClusterSettingsDialog.razor.cs` (+68 -7) ➕ `src/Corsinvest.ProxmoxVE.Admin.Module.System/Components/ClusterConfig/CreateApiTokenDialog.razor` (+57 -0) ➕ `src/Corsinvest.ProxmoxVE.Admin.Module.System/Components/ClusterConfig/CreateApiTokenModel.cs` (+12 -0) 📝 `src/Corsinvest.ProxmoxVE.Admin.Module.System/Components/ClusterConfig/RenderClustersSettings.razor.cs` (+4 -5) </details> ### 📄 Description ## Summary - Add `CreateApiTokenDialog` with Username, Password, TokenName fields and data annotation validation - `CreateApiTokenAsync` in `ClusterSettingsDialog`: creates dedicated `cv4pve-admin@pve` user, assigns `PVEAdmin` role on `/`, generates API token with `privsep=0` - Expose `IAdminService.CreateClusterClient()` as public (needed by wizard) - Add `NavigationManagerExtensions.ForceReload()` helper - Fix `RenderClustersSettings`: remove duplicate `sialogService` parameter, use `ForceReload()` - Add 🔑 button next to API Token field in `ClusterSettingsDialog` ## Test plan - [ ] Click 🔑 → dialog opens asking for Username, Password, Token Name - [ ] Submit → dedicated user and token created on Proxmox cluster - [ ] Token auto-populated in API Token field - [ ] Copy dialog shown once - [ ] Username/password not saved anywhere --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-26 17:37:42 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/cv4pve-admin#194
No description provided.