mirror of
https://github.com/azaion/admin.git
synced 2026-04-22 12:06:34 +00:00
[AZ-189] [AZ-190] [AZ-191] [AZ-192] [AZ-193] [AZ-194] [AZ-195] Add e2e blackbox test suite
Made-with: Cursor
This commit is contained in:
@@ -0,0 +1,62 @@
|
||||
# Module: Azaion.Common.Entities.User
|
||||
|
||||
## Purpose
|
||||
Domain entity representing a system user, plus related value objects `UserConfig` and `UserQueueOffsets`.
|
||||
|
||||
## Public Interface
|
||||
|
||||
### User
|
||||
| Property | Type | Description |
|
||||
|----------|------|-------------|
|
||||
| `Id` | `Guid` | Primary key |
|
||||
| `Email` | `string` | Unique user email |
|
||||
| `PasswordHash` | `string` | SHA-384 hash of plaintext password |
|
||||
| `Hardware` | `string?` | Raw hardware fingerprint string (set on first resource access) |
|
||||
| `Role` | `RoleEnum` | Authorization role |
|
||||
| `CreatedAt` | `DateTime` | Account creation timestamp |
|
||||
| `LastLogin` | `DateTime?` | Last successful resource-check/hardware-check timestamp |
|
||||
| `UserConfig` | `UserConfig?` | JSON-serialized user configuration |
|
||||
| `IsEnabled` | `bool` | Account active flag |
|
||||
|
||||
| Method | Signature | Description |
|
||||
|--------|-----------|-------------|
|
||||
| `GetCacheKey` | `static string GetCacheKey(string email)` | Returns cache key `"User.{email}"` |
|
||||
|
||||
### UserConfig
|
||||
| Property | Type | Description |
|
||||
|----------|------|-------------|
|
||||
| `QueueOffsets` | `UserQueueOffsets?` | Annotation queue offset tracking |
|
||||
|
||||
### UserQueueOffsets
|
||||
| Property | Type | Description |
|
||||
|----------|------|-------------|
|
||||
| `AnnotationsOffset` | `ulong` | Offset for annotations queue |
|
||||
| `AnnotationsConfirmOffset` | `ulong` | Offset for annotation confirmations |
|
||||
| `AnnotationsCommandsOffset` | `ulong` | Offset for annotation commands |
|
||||
|
||||
## Internal Logic
|
||||
`GetCacheKey` returns empty string for null/empty email to avoid cache key collisions.
|
||||
|
||||
## Dependencies
|
||||
- `RoleEnum`
|
||||
|
||||
## Consumers
|
||||
- All services (`UserService`, `AuthService`, `ResourcesService`) work with `User`
|
||||
- `AzaionDb` exposes `ITable<User>`
|
||||
- `AzaionDbSchemaHolder` maps `User` to the `users` PostgreSQL table
|
||||
- `SetUserQueueOffsetsRequest` uses `UserQueueOffsets`
|
||||
|
||||
## Data Models
|
||||
Maps to PostgreSQL table `users` with columns: `id`, `email`, `password_hash`, `hardware`, `role`, `user_config` (JSON text), `created_at`, `last_login`, `is_enabled`.
|
||||
|
||||
## Configuration
|
||||
None.
|
||||
|
||||
## External Integrations
|
||||
None.
|
||||
|
||||
## Security
|
||||
`PasswordHash` stores SHA-384 hash. `Hardware` stores raw hardware fingerprint (hashed for comparison via `Security.GetHWHash`).
|
||||
|
||||
## Tests
|
||||
Indirectly tested via `UserServiceTest` and `SecurityTest`.
|
||||
Reference in New Issue
Block a user