diff --git a/CHANGELOG.md b/CHANGELOG.md index ab1a291..84dac6d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,20 @@ 本文件的格式基于 [Keep a Changelog](https://keepachangelog.com/zh-CN/1.0.0/), 并且本项目遵循 [语义化版本 (Semantic Versioning)](https://semver.org/lang/zh-CN/spec/v2.0.0.html)。 -## [1.3.0] - 2026-01-15 +## [1.3.1] - 2026-01-16 + +### 新增 +- **群聊绑定管理**: 增强了 Topic 与飞书群聊绑定的安全性与流程。 + - **权限控制**: 仅 Topic 创建者或管理员允许执行群聊绑定/解绑操作。 + - **审批流程**: 新增群聊绑定审批机制,非管理员/非信任用户的绑定请求需经过审批(`status` 追踪)。 + - **管理员通知**: 引入 `admin-notifier.ts`,当有新的 Topic 或群聊绑定请求时,通过飞书卡片实时通知管理员。 +- **信任用户系统**: 引入 `isTrusted` 标志。 + - 信任用户创建 Topic 或绑定群聊时将自动通过审批。 + - 管理员由于其特殊权限,默认享受自动审批。 + +### 变更 +- **数据库架构**: `topic_group_chats` 表新增了 `status` 和 `created_by` 字段,以支持审批流和权限校验。 + ### 新增 - **视觉品牌**: 引入了自定义图标和 Favicon。 diff --git a/docs/copilot-context.md b/docs/copilot-context.md index 23bf627..c2dd0c3 100644 --- a/docs/copilot-context.md +++ b/docs/copilot-context.md @@ -1,4 +1,4 @@ -# Project Context for GitHub Copilot (v1.2.8) +# Project Context for GitHub Copilot (v1.3.1) This document provides technical context, architectural decisions, and code conventions for the **Alert Message Center** project. It is intended to help AI assistants understand the codebase. @@ -63,6 +63,8 @@ The database schema is defined in `apps/server/src/db/schema.ts`. - `topicId`: Foreign Key -> `topics.id`. - `chatId`: The Feishu `chat_id`. - `name`: Group name (snapshot). + - `status`: `pending`, `approved`, or `rejected`. + - `createdBy`: Foreign Key -> `users.id`. - **Relationship**: Many-to-Many between Topics and Feishu Groups. 5. **Known Group Chat** (`known_group_chats`) @@ -133,6 +135,9 @@ The database schema is defined in `apps/server/src/db/schema.ts`. - **Auto-Unbind**: All bindings in `topic_group_chats` for that `chat_id` are automatically deleted to ensure data consistency. - **Binding**: Users/Admins bind a Topic to a known Feishu Group in the UI. - **Security**: Only the Topic Creator or an Admin can bind/unbind groups to a Topic. + - **Approval**: + - Normal users: Binding status is `pending` upon creation. Admins receive notification. + - Admins/Trusted Users: Binding status is `approved` immediately. - **Dispatch**: Alerts for the topic are sent to all bound `chat_id`s in addition to individual subscribers. ### Long Connection (WebSocket) @@ -148,6 +153,8 @@ The database schema is defined in `apps/server/src/db/schema.ts`. - Normal users: Topic status is `pending` upon creation. Admins receive an interactive Feishu notification. - Admins/Trusted Users: Topic status is `approved` immediately. - Admin notification logic is located in `apps/server/src/lib/admin-notifier.ts`. +- **Trusted User System**: + - Users with `isTrusted=true` (set by Admin) or `isAdmin=true` have their requests (Topics/Bindings) automatically approved. ## 5. API Endpoints