feat: implement identity authentication, authorization policies, and MAUI platform support with Docker orchestration
This commit is contained in:
+12
-11
@@ -10,10 +10,10 @@
|
||||
|
||||
| ID | Task Title | Description & Acceptance Criteria | Tech Stack |
|
||||
|:---|:---|:---|:---|
|
||||
| **BACK-1** | Define Extended `NexusUser` Model | **Description:** Create a `NexusUser` class inheriting from `IdentityUser`. Add custom properties for SaaS logic.<br>**AC:**<br>- [ ] Properties added: `AITokenLimit` (int), `AITokensUsed` (int), `TenantId` (Guid), `CurrentPlan` (string).<br>- [ ] Model placed in `NexusArchitect.Core` project. | C# / Identity |
|
||||
| **BACK-2** | Configure `ApplicationDbContext` for Identity | **Description:** Set up the DB context to inherit from `IdentityDbContext<NexusUser>`.<br>**AC:**<br>- [ ] Mapped standard Identity tables (Users, Roles, Claims).<br>- [ ] Configured 1-to-Many relationship between `NexusUser` and `Ebooks`. | EF Core |
|
||||
| **BACK-3** | Database Schema Migration | **Description:** Generate and apply the initial migration for Identity tables.<br>**AC:**<br>- [ ] SQL schema contains all 7+ standard Identity tables.<br>- [ ] Custom `NexusUser` fields are correctly reflected in the `AspNetUsers` table. | EF Core CLI |
|
||||
| **BACK-4** | Implement Identity API Endpoints | **Description:** Enable native .NET Identity API endpoints in `Program.cs`.<br>**AC:**<br>- [ ] Endpoints `/register`, `/login`, and `/refresh` are active.<br>- [ ] Verified functionality via Swagger/OpenAPI. | ASP.NET Core |
|
||||
| **BACK-1** | Define Extended `NexusUser` Model | **Description:** Create a `NexusUser` class inheriting from `IdentityUser`. Add custom properties for SaaS logic.<br>**AC:**<br>- [x] Properties added: `AITokenLimit` (int), `AITokensUsed` (int), `TenantId` (Guid), `CurrentPlan` (string).<br>- [x] Model placed in `NexusArchitect.Core` project. | C# / Identity |
|
||||
| **BACK-2** | Configure `ApplicationDbContext` for Identity | **Description:** Set up the DB context to inherit from `IdentityDbContext<NexusUser>`.<br>**AC:**<br>- [x] Mapped standard Identity tables (Users, Roles, Claims).<br>- [x] Configured 1-to-Many relationship between `NexusUser` and `Ebooks`. | EF Core |
|
||||
| **BACK-3** | Database Schema Migration | **Description:** Generate and apply the initial migration for Identity tables.<br>**AC:**<br>- [x] SQL schema contains all 7+ standard Identity tables.<br>- [x] Custom `NexusUser` fields are correctly reflected in the `AspNetUsers` table. | EF Core CLI |
|
||||
| **BACK-4** | Implement Identity API Endpoints | **Description:** Enable native .NET Identity API endpoints in `Program.cs`.<br>**AC:**<br>- [x] Endpoints `/register`, `/login`, and `/refresh` are active.<br>- [x] Verified functionality via Swagger/OpenAPI. | ASP.NET Core |
|
||||
|
||||
---
|
||||
|
||||
@@ -21,10 +21,10 @@
|
||||
|
||||
| ID | Task Title | Description & Acceptance Criteria | Tech Stack |
|
||||
|:---|:---|:---|:---|
|
||||
| **BACK-5** | Define Authorization Policies | **Description:** Implement Roles and Claims-based authorization (Free vs. Pro).<br>**AC:**<br>- [ ] Created a `ProUser` policy.<br>- [ ] Implemented a custom `Requirement` to check if `AITokensUsed < AITokenLimit`. | ASP.NET Core |
|
||||
| **UI-1** | Implement Login Page (Blazor) | **Description:** Build the Login UI based on the Dark Mode mockup.<br>**AC:**<br>- [ ] Theme: Dark mode with neon green accents.<br>- [ ] Components: Email/Password fields, "Remember Me" toggle, "Login" button.<br>- [ ] Integrates with `AuthenticationStateProvider`. | Blazor / CSS |
|
||||
| **UI-2** | Google OAuth2 Integration | **Description:** Configure external login provider (Google) in the backend and UI.<br>**AC:**<br>- [ ] Users can sign in via Google button.<br>- [ ] New users are automatically provisioned in the database upon successful OAuth. | OAuth / Google Cloud |
|
||||
| **UI-3** | Implement Registration Flow | **Description:** Create a registration form calling the `/register` endpoint.<br>**AC:**<br>- [ ] Validation: Email format, password complexity (min 8 chars, uppercase, digit).<br>- [ ] Proper error handling for existing users. | Blazor |
|
||||
| **BACK-5** | Define Authorization Policies | **Description:** Implement Roles and Claims-based authorization (Free vs. Pro).<br>**AC:**<br>- [x] Created a `ProUser` policy.<br>- [x] Implemented a custom `Requirement` to check if `AITokensUsed < AITokenLimit`. | ASP.NET Core |
|
||||
| **UI-1** | Implement Login Page (Blazor) | **Description:** Build the Login UI based on the Dark Mode mockup.<br>**AC:**<br>- [x] Theme: Dark mode with neon green accents.<br>- [x] Components: Email/Password fields, "Remember Me" toggle, "Login" button.<br>- [x] Integrates with `AuthenticationStateProvider`. | Blazor / CSS |
|
||||
| **UI-2** | Google OAuth2 Integration | **Description:** Configure external login provider (Google) in the backend and UI.<br>**AC:**<br>- [x] Users can sign in via Google button.<br>- [x] New users are automatically provisioned in the database upon successful OAuth. | OAuth / Google Cloud |
|
||||
| **UI-3** | Implement Registration Flow | **Description:** Create a registration form calling the `/register` endpoint.<br>**AC:**<br>- [x] Validation: Email format, password complexity (min 8 chars, uppercase, digit).<br>- [x] Proper error handling for existing users. | Blazor |
|
||||
|
||||
---
|
||||
|
||||
@@ -32,9 +32,10 @@
|
||||
|
||||
| ID | Task Title | Description & Acceptance Criteria | Tech Stack |
|
||||
|:---|:---|:---|:---|
|
||||
| **UI-4** | User Profile & Dashboard | **Description:** Build the User Profile UI focusing on "Active Learning" metrics.<br>**AC:**<br>- [ ] Displays: Token usage bar (Used/Limit), average quiz score, and last read book.<br>- [ ] Links to subscription management. | Blazor |
|
||||
| **MAUI-1** | Mobile Auth Integration (Blazor Hybrid) | **Description:** Ensure the authentication state is shared and persists in the MAUI container.<br>**AC:**<br>- [ ] Securely store JWT tokens in `SecureStorage`.<br>- [ ] Automatic login on app launch if token is valid. | MAUI / Blazor Hybrid |
|
||||
| **INTEG-1** | Stripe Subscription Webhooks | **Description:** Sync Identity Claims with Stripe subscription status.<br>**AC:**<br>- [ ] Webhook updates `AITokenLimit` when a "Pro" plan is purchased.<br>- [ ] User is downgraded back to "Free" limit upon cancellation. | Stripe SDK / .NET |
|
||||
| **UI-4** | User Profile & Dashboard | **Description:** Build the User Profile UI focusing on "Active Learning" metrics.<br>**AC:**<br>- [x] Displays: Token usage bar (Used/Limit), average quiz score, and last read book.<br>- [x] Links to subscription management. | Blazor |
|
||||
| **MAUI-1** | Mobile Auth Integration (Blazor Hybrid) | **Description:** Ensure the authentication state is shared and persists in the MAUI container.<br>**AC:**<br>- [x] Securely store JWT tokens in `SecureStorage`.<br>- [x] Automatic login on app launch if token is valid. | MAUI / Blazor Hybrid |
|
||||
| **MAUI-2** | Secure Session Persistence | **Description:** Implement long-lived session management using encrypted device storage.<br>**AC:**<br>- [x] Refresh tokens implementation for mobile.<br>- [x] "Stay Signed In" functionality. | MAUI / Identity |
|
||||
| **INTEG-1** | Stripe Subscription Webhooks | **Description:** Sync Identity Claims with Stripe subscription status.<br>**AC:**<br>- [x] Webhook updates `AITokenLimit` when a "Pro" plan is purchased.<br>- [x] User is downgraded back to "Free" limit upon cancellation. | Stripe SDK / .NET |
|
||||
|
||||
---
|
||||
|
||||
|
||||
Reference in New Issue
Block a user