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:
@@ -4,6 +4,34 @@ namespace WxAgent.Core;
|
||||
|
||||
public static class ReportingAuthorization
|
||||
{
|
||||
public static ReportingConfig ForVerifiedAccounts(ReportingConfig configured, IEnumerable<string> verifiedAccountIds)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(configured);
|
||||
ArgumentNullException.ThrowIfNull(verifiedAccountIds);
|
||||
|
||||
var accounts = verifiedAccountIds
|
||||
.Where(accountId => !string.IsNullOrWhiteSpace(accountId))
|
||||
.Distinct(StringComparer.Ordinal)
|
||||
.Select(accountId => new AccountReportingConfig
|
||||
{
|
||||
AccountId = accountId,
|
||||
Enabled = true,
|
||||
AllowedChats =
|
||||
[
|
||||
new AllowedChat { Type = ReportingChatType.Group, ChatId = "*", Enabled = true, IdentityVerified = true },
|
||||
new AllowedChat { Type = ReportingChatType.Private, ChatId = "*", Enabled = true, IdentityVerified = true }
|
||||
]
|
||||
})
|
||||
.ToArray();
|
||||
|
||||
return configured with
|
||||
{
|
||||
Enabled = true,
|
||||
ConfigVersion = Math.Max(1, configured.ConfigVersion),
|
||||
Accounts = accounts
|
||||
};
|
||||
}
|
||||
|
||||
public static ReportingDecision Check(
|
||||
ReportingConfig? config,
|
||||
string accountId,
|
||||
|
||||
Reference in New Issue
Block a user