Commit Graph

36 Commits

Author SHA1 Message Date
Oleksandr Bezdieniezhnykh 3a925b9b0f refactor: remove obsolete resource download and installer endpoints
ci/woodpecker/push/01-test Pipeline failed
ci/woodpecker/push/02-build-push unknown status
- 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
Oleksandr Bezdieniezhnykh c7b297de83 refactor: remove deploy.cmd and update Dockerfile for health checks
ci/woodpecker/push/01-test Pipeline failed
ci/woodpecker/push/02-build-push unknown status
- Deleted the deploy.cmd script as it was no longer needed.
- Updated Dockerfile to include curl for health checks and added a non-root user for improved security.
- Modified health check command to use curl for better reliability.
- Adjusted docker-compose.test.yml to reflect changes in health check configuration.
- Cleaned up appsettings.json and removed unused configuration properties.
- Removed Resource entity and related requests from the codebase as part of the architectural shift.
- Updated documentation to reflect the removal of hardware binding and related endpoints.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-13 08:47:21 +03:00
Oleksandr Bezdieniezhnykh 5e90512987 [AZ-197] Remove hardware ID binding from resource flow
Sealed-Jetson + SaaS architecture eliminates the credential-reuse-across-
machines threat that motivated hardware fingerprint binding. The binding's
only remaining effect was a real production failure mode on legitimate
hardware events.

Production:
- Drop PUT /users/hardware/set and POST /resources/check.
- Simplify POST /resources/get/{dataFolder?} (no Hardware field).
- Remove CheckHardwareHash, UpdateHardware, Security.GetHWHash.
- GetApiEncryptionKey signature: (email, password) — no hardwareHash.
- Drop SetHWRequest DTO and Hardware property from GetResourceRequest.
- Remove HardwareIdMismatch (40) and BadHardware (45) ExceptionEnum
  entries; numeric codes left as a gap, not for reuse.

Wire-compat policy: drop entirely (no Loader; no in-flight legacy
clients). Stale callers will see 404s, which is the right loud failure.

Tombstones:
- User.Hardware DB column kept (nullable, unused) — separate cleanup
  ticket for the migration per workspace "no rename without confirmation".
- User.LastLogin is now never written by app code (only writer was inside
  the deleted CheckHardwareHash); flagged in batch_06_review for a future
  ticket.

Tests:
- Delete e2e HardwareBindingTests (165 lines) and Azaion.Test
  UserServiceTest (sole test was CheckHardwareHashTest).
- Drop Hardware payloads + /resources/check preconditions from e2e
  ResourceTests, SecurityTests, ResilienceTests; drop hardwareId arg
  from Azaion.Test SecurityTest.
- Add SecurityTests.Hardware_endpoints_are_removed_AZ_197 (AC-2 regression
  asserting both removed routes return 404).

Docs:
- architecture.md: System Context note, ADR-003 new key formula, ADR-004
  retired with rationale.
- diagrams/flows/flow_hardware_check.md: tombstoned.

Also archives the four batch-1+batch-2 task files into _docs/02_tasks/done/
(file moves were missed by the batch_05 commit).

Code review: PASS — see _docs/03_implementation/reviews/batch_06_review.md.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-13 04:46:39 +03:00
Oleksandr Bezdieniezhnykh 5ca9ccab2c [AZ-513] [AZ-196] [AZ-183] Add /classes CRUD, /devices, fleet OTA
AZ-513: POST/PATCH/DELETE /classes for detection-class CRUD; new
DetectionClass entity, schema, DTOs, IDetectionClassService. Unblocks
ui/AZ-512.

AZ-196: POST /devices auto-assigns sequential azj-NNNN serial+email
+password and inserts a CompanionPC user. Returns plaintext credentials
for the provisioning script.

AZ-183: Resources table + POST /get-update + POST /resources/publish
for fleet OTA. Per-resource encryption_key column AES-256-CBC encrypted
at rest with ResourcesConfig.EncryptionMasterKey; ICache wraps the
per-(arch,stage) latest-versions lookup and is invalidated on publish.

Adds IDbFactory.RunAdmin<T> overload for write-and-return.

Backfills _docs/02_document/module-layout.md to satisfy the implement
skill's File Ownership prerequisite (the _docs/ artifact set predates
the Step 1.5 module-layout addition).

Code review: PASS_WITH_WARNINGS — see
_docs/03_implementation/reviews/batch_05_review.md.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-13 04:34:42 +03:00
Oleksandr Bezdieniezhnykh 74f5594b0c [AZ-200] Drop email length rule
Made-with: Cursor
2026-04-16 06:59:12 +03:00
Oleksandr Bezdieniezhnykh 88c7b288df [AZ-199] [AZ-200] [AZ-201] [AZ-202] Fix API bugs
Made-with: Cursor
2026-04-16 06:55:11 +03:00
Oleksandr Bezdieniezhnykh 5286b6b8e3 [AZ-198] Block disabled user login
Made-with: Cursor
2026-04-16 06:49:00 +03:00
Oleksandr Bezdieniezhnykh 04a18804c5 Update .gitignore to exclude log files and directories 2026-04-06 07:06:54 +03:00
Oleksandr Bezdieniezhnykh 44e75afc4f Update project to .NET 10.0 and upgrade dependencies in Dockerfile and project files 2026-03-09 22:27:48 +02:00
Oleksandr Bezdieniezhnykh b6dd20366e secure getinstaller endpoint 2025-09-23 15:37:50 +03:00
Oleksandr Bezdieniezhnykh 3167df8bd7 add enable disable remove user and isenabled in user column 2025-09-22 19:37:17 +03:00
Oleksandr Bezdieniezhnykh a4295c6c52 fix bugs, improve security 2025-09-22 00:34:37 +03:00
Oleksandr Bezdieniezhnykh 0af74ec278 Add LastLogin and CreatedAt to User 2025-09-21 23:57:37 +03:00
Alex Bezdieniezhnykh 1fcaba383e add check resource endpoint 2025-06-15 09:18:39 +03:00
Alex Bezdieniezhnykh 3be7062993 add ClearFolder, ListResources, GetInstaller
endpoints
2025-06-13 23:27:37 +03:00
Alex Bezdieniezhnykh 289344799e move hw set and queue offset to user rest entitiy
switch to body email set
2025-05-02 11:29:56 +03:00
Alex Bezdieniezhnykh 0458739126 fix reset hw endpoint 2025-05-02 11:17:45 +03:00
Alex Bezdieniezhnykh eb043e94a8 switch to hardware string from object 2025-05-02 10:14:40 +03:00
Alex Bezdieniezhnykh 32cef21335 rename offset property in user 2025-04-17 08:08:57 +03:00
Alex Bezdieniezhnykh 55f4e8b3a6 add exceptions handler 2025-04-17 00:27:56 +03:00
Alex Bezdieniezhnykh c1f47f0e8d Revert "add correct business exception handling"
This reverts commit b1693b2894.
2025-04-16 20:47:01 +03:00
Alex Bezdieniezhnykh b1693b2894 add correct business exception handling
use <FrameworkReference Include="Microsoft.AspNetCore.App" /> instead of old nuget packages
2025-04-16 13:32:16 +03:00
Alex Bezdieniezhnykh 4fc1fb4d63 fix cache issue 2025-04-16 01:49:34 +03:00
Alex Bezdieniezhnykh 5673eeade9 add queue offsets to user 2025-04-16 01:29:58 +03:00
Alex Bezdieniezhnykh 503ddc8c41 don't send hardware hash, calc on the api 2025-02-26 16:02:09 +02:00
Alex Bezdieniezhnykh bfb7b89f32 put StreamToString to extensions 2025-01-20 10:04:33 +02:00
Alex Bezdieniezhnykh 49de0351c1 add Cache.cs
fix hardware hash stack in the jwt token claims
2025-01-18 14:37:17 +02:00
Alex Bezdieniezhnykh 6d8ea6c74f fix login
add logging
add scripts for server
2024-12-04 12:40:56 +02:00
Alex Bezdieniezhnykh 08187495af separate Uploader role 2024-11-25 14:43:52 +02:00
Alex Bezdieniezhnykh f5e466108a renmove ResourceEnum, use filename only
add ToHash for encryption Key
2024-11-22 12:13:37 +02:00
Alex Bezdieniezhnykh 4bc76bbbac structure app by rest api standards
add getusers
tidy up BusinessException
2024-11-14 22:45:36 +02:00
Alex Bezdieniezhnykh 4445fcd673 get resource works 2024-11-13 00:24:09 +02:00
Alex Bezdieniezhnykh ddbf8114ba db works, upload works 2024-11-12 22:16:50 +02:00
Alex Bezdieniezhnykh 2336c15aa4 add postgres 2024-11-12 15:57:36 +02:00
Alex Bezdieniezhnykh 85139b4fd2 add authorization 2024-11-11 21:07:28 +02:00
Alex Bezdieniezhnykh 121052a3ef Init commit
add security encryption and hashing: WIP
add endpoints: register user, get and save resources
add db main operations, User entity
2024-11-09 00:37:43 +02:00