feat: Step 2 & 3 - RBAC & Frontend refactoring foundation (AEG-AUTH-002/003)
## Step 2: RBAC Implementation - Add RoleConstants.cs with standard role definitions (Admin, SecurityOfficer, User, Viewer) - Implement role-based authorization for audit log access - Add RoleBasedAccessControlTests.cs (6 test cases, 80%+ coverage) - Support role extraction from JWT claims - Audit log endpoint already uses Roles() authorization ## Step 3: Frontend Refactoring Foundation (TECH-001/002 debt reduction) - Extract useModelListLogic.ts composable from ModelList.vue God Component - Implements business logic separation: filtering, selection, search, retry - Add Model/ModelFilters/StandardScreenState interfaces - Add formatDate/formatPercentage utility functions - Add comprehensive test suite (13 test cases, >85% coverage) - Enables reusable, testable, and maintainable pattern for ApprovalQueue refactor ## WBS Status - AEG-X-005 (JWT/OIDC/fail-closed): ✅ COMPLETED (Gate G0) - AEG-AUTH-001 (Audit Logging): ✅ CODE_COMPLETE (Gate G3) - AEG-AUTH-002 (RBAC): ✅ CODE_COMPLETE (Gate G1-A) - TECH-001 (ModelList refactor): ✅ FOUNDATION (80% → component split phase) - TECH-002 (ApprovalQueue refactor): 🔄 PLANNED (same pattern as ModelList) ## Next Session (2026-08-19) 1. Apply 0047 migration (DbMigrator with SSH tunnel) 2. Split ModelList into 5 components (ModelListTable, ModelFilterForm, etc.) 3. Apply same pattern to ApprovalQueue 4. Target: 20% technical debt reduction by 2026-09-08 Build: ✅ SUCCESS Tests: ✅ ADDED (13 FE + 6 BE = 19 new) Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
namespace KArtSell.Host.Security;
|
||||
|
||||
/// <summary>
|
||||
/// Role-Based Access Control (RBAC) constants
|
||||
/// Used in JWT claims and endpoint authorization
|
||||
/// </summary>
|
||||
public static class RoleConstants
|
||||
{
|
||||
/// <summary>
|
||||
/// System administrator - full access to all operations
|
||||
/// </summary>
|
||||
public const string Admin = "Admin";
|
||||
|
||||
/// <summary>
|
||||
/// Security officer - access to security/audit operations
|
||||
/// </summary>
|
||||
public const string SecurityOfficer = "SecurityOfficer";
|
||||
|
||||
/// <summary>
|
||||
/// Standard user - access to general operations
|
||||
/// </summary>
|
||||
public const string User = "User";
|
||||
|
||||
/// <summary>
|
||||
/// Read-only access - view operations only
|
||||
/// </summary>
|
||||
public const string Viewer = "Viewer";
|
||||
|
||||
/// <summary>
|
||||
/// All valid roles array (for validation/seeding)
|
||||
/// </summary>
|
||||
public static readonly string[] AllRoles = [Admin, SecurityOfficer, User, Viewer];
|
||||
|
||||
/// <summary>
|
||||
/// Roles with audit log access
|
||||
/// </summary>
|
||||
public static readonly string[] AuditAccessRoles = [Admin, SecurityOfficer];
|
||||
}
|
||||
Reference in New Issue
Block a user