Files
admin/_docs/02_document/modules/common_entities_user.md
T
Oleksandr Bezdieniezhnykh 3a925b9b0f
ci/woodpecker/push/01-test Pipeline failed
ci/woodpecker/push/02-build-push unknown status
refactor: remove obsolete resource download and installer endpoints
- Deleted the `POST /resources/get/{dataFolder?}` and `GET /resources/get-installer` endpoints as part of the architectural shift towards simplified resource management.
- Removed associated methods and configurations, including `ResourcesService.GetEncryptedResource`, `ResourcesService.GetInstaller`, and related properties in `ResourcesConfig`.
- Cleaned up environment variables and configuration files to reflect the removal of installer-related settings.
- Eliminated the `GetResourceRequest` DTO and its validator, along with the `WrongResourceName` error code.
- Updated documentation to clarify the changes in resource handling and the retirement of per-user file encryption.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-14 04:17:55 +03:00

2.4 KiB

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 end-to-end via e2e/Azaion.E2E/Tests/LoginTests.cs, UserManagementTests.cs, and DeviceTests.cs. (The previous in-process Azaion.Test/UserServiceTest and SecurityTest were both removed by cycle 2 along with the Azaion.Test project.)