feat: add control-plane identity and management console
Build web service image / build (push) Successful in 2m7s
Build web service image / build (push) Successful in 2m7s
This commit is contained in:
@@ -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()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user