mirror of
https://github.com/azaion/admin.git
synced 2026-06-21 20:11:11 +00:00
[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>
This commit is contained in:
@@ -29,9 +29,8 @@ public class SecurityTest
|
||||
" sakdhvb kasjdhbv kjasdhv kjhas";
|
||||
var email = "user@azaion.com";
|
||||
var password = "testpw";
|
||||
var hardwareId = "test_hardware_id";
|
||||
|
||||
var key = Security.GetApiEncryptionKey(email, password, hardwareId);
|
||||
var key = Security.GetApiEncryptionKey(email, password);
|
||||
|
||||
var encryptedStream = new MemoryStream();
|
||||
await StringToStream(testString).EncryptTo(encryptedStream, key);
|
||||
@@ -49,9 +48,8 @@ public class SecurityTest
|
||||
{
|
||||
var username = "user@azaion.com";
|
||||
var password = "testpw";
|
||||
var hardwareId = "test_hardware_id";
|
||||
|
||||
var key = Security.GetApiEncryptionKey(username, password, hardwareId);
|
||||
var key = Security.GetApiEncryptionKey(username, password);
|
||||
|
||||
var largeFilePath = "large.txt";
|
||||
var largeFileDecryptedPath = "large_decrypted.txt";
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
using Azaion.Common.Configs;
|
||||
using Azaion.Common.Database;
|
||||
using Azaion.Services;
|
||||
using Microsoft.Extensions.Options;
|
||||
using Xunit;
|
||||
|
||||
namespace Azaion.Test;
|
||||
|
||||
public class UserServiceTest
|
||||
{
|
||||
[Fact]
|
||||
public async Task CheckHardwareHashTest()
|
||||
{
|
||||
var dbFactory = new DbFactory(new OptionsWrapper<ConnectionStrings>(new ConnectionStrings
|
||||
{
|
||||
AzaionDb = "Host=188.245.120.247;Port=4312;Database=azaion;Username=azaion_reader;Password=A@1n_zxre@d!only@$Az",
|
||||
AzaionDbAdmin = "Host=188.245.120.247;Port=4312;Database=azaion;Username=azaion_admin;Password=Az@1on_Oddmin$$@r"
|
||||
}));
|
||||
var userService = new UserService(dbFactory, new MemoryCache());
|
||||
var user = await userService.GetByEmail("spielberg@azaion.com");
|
||||
if (user == null)
|
||||
throw new Exception("User not found");
|
||||
|
||||
var res = await userService.CheckHardwareHash(user,
|
||||
"CPU: AMD Ryzen 9 3900XT 12-Core Processor. GPU: Microsoft Remote Display Adapter. Memory: 67037080. DriveSerial: PHMB746301G6480DGN _00000001.");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user