mirror of
https://github.com/azaion/admin.git
synced 2026-06-21 06:51:08 +00:00
5ca9ccab2c
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>
31 lines
1.1 KiB
C#
31 lines
1.1 KiB
C#
using FluentValidation;
|
|
|
|
namespace Azaion.Common.Requests;
|
|
|
|
public class PublishResourceRequest
|
|
{
|
|
public string ResourceName { get; set; } = null!;
|
|
public string DevStage { get; set; } = null!;
|
|
public string Architecture { get; set; } = null!;
|
|
public string Version { get; set; } = null!;
|
|
public string CdnUrl { get; set; } = null!;
|
|
public string Sha256 { get; set; } = null!;
|
|
public string EncryptionKey { get; set; } = null!;
|
|
public long SizeBytes { get; set; }
|
|
}
|
|
|
|
public class PublishResourceValidator : AbstractValidator<PublishResourceRequest>
|
|
{
|
|
public PublishResourceValidator()
|
|
{
|
|
RuleFor(r => r.ResourceName).NotEmpty().MaximumLength(120);
|
|
RuleFor(r => r.DevStage).NotEmpty().MaximumLength(40);
|
|
RuleFor(r => r.Architecture).NotEmpty().MaximumLength(40);
|
|
RuleFor(r => r.Version).NotEmpty().MaximumLength(40);
|
|
RuleFor(r => r.CdnUrl).NotEmpty().MaximumLength(500);
|
|
RuleFor(r => r.Sha256).NotEmpty().MaximumLength(128);
|
|
RuleFor(r => r.EncryptionKey).NotEmpty();
|
|
RuleFor(r => r.SizeBytes).GreaterThan(0);
|
|
}
|
|
}
|