- 适配器只描述平台身份:qq_obv11 的 owner/admin 一律上报 RoleMember,不再上报 RoleOwner - session 层唯一判主点只认白名单(owner.yaml Accounts ∪ 每渠道 adminIds),nil 档案 fail-closed 拒绝 - 新增「每渠道管理员层」:channels.json ChannelAccount.adminIds[] → runtimeconfig.AdminIDs → OwnerProfile.SetPlatformAdmins(整体替换语义,热重载后移除的 id 立即失效) - 组合根接线:启动即播种、面板保存先灌白名单再重载适配器(cmd/cyrene/wire_channels.go + 4 条端到端单测) - 06.4.3 节流与参与度状态按会话独立计数(ConversationKey 三处统一,空会话 GC);06.4.4 未知平台主动发言保守默认 1 条/分钟
19 lines
994 B
Go
19 lines
994 B
Go
package channelbridge
|
|
|
|
// 自裁决 06.4.2 起 owner 车道**只认白名单**:测试夹具不能再靠适配器上报的
|
|
// `adapter.Actor{Role: adapter.RoleOwner}` 标记把某条消息变成主人消息——那正是本次修掉的
|
|
// 漏洞(群主/伪造 role=owner 冒充主人)。需要主人私聊/主人群聊路径的用例,改为把该账号
|
|
// 结构性地写进主人档案白名单,与生产路径(owner.yaml + 渠道 adminIds[])同源。
|
|
|
|
import "git.yeij.top/AskaEth/Cyrene_v2/internal/user"
|
|
|
|
// testOwnerProfile 返回一个把给定账号写进白名单的主人档案。DisplayName 故意留空:
|
|
// ruleLightJudge 会用 DisplayName 做「被点名」判定,空值保持这些夹具原有的语义。
|
|
func testOwnerProfile(platform string, accountIDs ...string) *user.OwnerProfile {
|
|
p := &user.OwnerProfile{ID: "owner"}
|
|
for _, id := range accountIDs {
|
|
p.Accounts = append(p.Accounts, user.OwnerAccount{Platform: platform, AccountID: id})
|
|
}
|
|
return p
|
|
}
|