feat(api)!: fold devices into users and report member presence
Contract 7.0.0 (breaking). Devices become an attribute of the account;
members are managed per user, and only unauthenticated guests keep a
per-terminal registration.
- rename seats -> max_members, seats_used -> members_used,
seats_full -> members_full, SeatJoined -> JoinResult, the `seats`
stream control message -> `members`, and POST /channels/{id}/seats ->
POST /channels/{id}/join (stored channel settings are migrated on start)
- drop per-terminal encrypted device labels and the seat list/release
endpoints; add GET/DELETE /channels/{id}/guests for guest terminals
- authenticate account members by account session only: the terminal key
is optional for logged-in accounts, no seat row is written for them,
and gated-download grants are counted per user (per terminal for guests)
- GET /channels/{id}/members now returns online, devices and
online_devices per account; presence is tracked in memory from active
WebSocket/SSE subscriptions and is not pushed over the stream
- owner invitation list no longer returns accounts that already joined
This commit is contained in:
1 parent
0fd2a269d9
commit
d946fc5e8a
35 files changed
+517
-490
No files matched your search
@@ -155,9 +155,9 @@ public class PolicyTests
|
||||
[Fact]
|
||||
public void SettingsPatchOnlyChangesProvidedFields()
|
||||
{
|
||||
var before = new ChannelSettings { Seats = 2, TtlSeconds = 100 };
|
||||
var after = new ChannelSettingsPatch { Seats = 5 }.ApplyTo(before);
|
||||
Assert.Equal(5, after.Seats);
|
||||
var before = new ChannelSettings { MaxMembers = 2, TtlSeconds = 100 };
|
||||
var after = new ChannelSettingsPatch { MaxMembers = 5 }.ApplyTo(before);
|
||||
Assert.Equal(5, after.MaxMembers);
|
||||
Assert.Equal(100, after.TtlSeconds);
|
||||
}
|
||||
|
||||
@@ -169,7 +169,7 @@ public class PolicyTests
|
||||
[InlineData(2, 86400, 0)]
|
||||
public void SettingsValidationRejectsOutOfRange(int seats, int ttl, int maxItems)
|
||||
{
|
||||
var s = new ChannelSettings { Seats = seats, TtlSeconds = ttl, MaxItems = maxItems };
|
||||
var s = new ChannelSettings { MaxMembers = seats, TtlSeconds = ttl, MaxItems = maxItems };
|
||||
var ex = Assert.Throws<WebDropException>(() => s.Validate(new ServerLimits()));
|
||||
Assert.Equal(ErrorCode.BadRequest, ex.Code);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user