feat(protocol): API v1 contract and typed client
DTOs for auth, users, sequences, frames, manifests, uploads, jobs, render nodes, events and LAN discovery; TitanoClient with TOFU certificate pinning, bearer auth, resumable SHA-256-verified chunked uploads with retry/backoff, shared bandwidth limiter and the event WebSocket stream. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
This commit is contained in:
12 files changed
+751
-11
No files matched your search
@@ -0,0 +1,31 @@
|
||||
namespace Titano.Protocol;
|
||||
|
||||
/// <summary><c>POST /api/v1/auth/login</c>. <see cref="Cookie"/> = true asks for an HttpOnly session cookie (web admin).</summary>
|
||||
public sealed record LoginRequest(string Username, string Password, string ClientName, bool Cookie = false);
|
||||
|
||||
public sealed record LoginResponse(string? Token, UserDto User, bool MustChangePassword, DateTimeOffset ExpiresAt);
|
||||
|
||||
/// <summary><c>POST /api/v1/auth/password</c>.</summary>
|
||||
public sealed record ChangePasswordRequest(string CurrentPassword, string NewPassword);
|
||||
|
||||
public sealed record UserDto(
|
||||
Guid Id,
|
||||
string Username,
|
||||
string? DisplayName,
|
||||
string Role,
|
||||
long Permissions,
|
||||
long QuotaBytes,
|
||||
long UsedBytes,
|
||||
bool Disabled,
|
||||
bool MustChangePassword,
|
||||
DateTimeOffset Created,
|
||||
DateTimeOffset? LastLogin);
|
||||
|
||||
/// <summary><c>POST /api/v1/users</c> (admin).</summary>
|
||||
public sealed record CreateUserRequest(string Username, string? DisplayName, string Role, long QuotaBytes, string? Password, bool AllowRenderNode);
|
||||
|
||||
/// <summary><c>PATCH /api/v1/users/{id}</c> (admin); null fields stay unchanged.</summary>
|
||||
public sealed record UpdateUserRequest(string? DisplayName, string? Role, long? QuotaBytes, bool? Disabled, bool? AllowRenderNode);
|
||||
|
||||
/// <summary>Response of <c>POST /api/v1/users</c> and <c>/users/{id}/reset-password</c>: a temporary password shown once.</summary>
|
||||
public sealed record TemporaryPasswordResponse(UserDto User, string TemporaryPassword);
|
||||
Reference in new issue
Block a user