feat: add control-plane identity and management console
Build web service image / build (push) Successful in 2m7s

This commit is contained in:
2026-09-27 20:27:31 +08:00
parent 083aeef18a
commit 8760fa49f0
40 changed files with 4827 additions and 2431 deletions
@@ -62,6 +62,31 @@ public sealed class RemoteReportingTests
Assert.False(ReportingAuthorization.IsAllowed(config, "account-b", "private-1", ReportingChatType.Private, ReportingDataType.Message));
}
[Fact]
public void ConnectionAuthorizationReplacesLegacyScopesWithVerifiedAccounts()
{
var configured = new ReportingConfig
{
Enabled = false,
ConfigVersion = 0,
Accounts = [new AccountReportingConfig
{
AccountId = "old-account", Enabled = true,
AllowedChats = [new AllowedChat { Type = ReportingChatType.Group, ChatId = "old-group", Enabled = true, IdentityVerified = true }]
}]
};
var authorized = ReportingAuthorization.ForVerifiedAccounts(configured, ["verified-account"]);
Assert.True(authorized.Enabled);
Assert.Equal(1, authorized.ConfigVersion);
Assert.Equal(new[] { "verified-account" }, authorized.Accounts.Select(account => account.AccountId));
Assert.True(ReportingAuthorization.IsAllowed(authorized, "verified-account", "any-group", ReportingChatType.Group, ReportingDataType.Message));
Assert.True(ReportingAuthorization.IsAllowed(authorized, "verified-account", "any-private", ReportingChatType.Private, ReportingDataType.Message));
Assert.False(ReportingAuthorization.IsAllowed(authorized, "old-account", "old-group", ReportingChatType.Group, ReportingDataType.Message));
Assert.Empty(ReportingAuthorization.ForVerifiedAccounts(configured, []).Accounts);
}
[Fact]
public void ReadTaskResultsRequireEveryWhitelistedScope()
{