- 创建 security_manager.py 安全模块
- SecurityManager: 安全管理主类
- 审计日志系统 - 记录所有数据操作
- 端到端加密 - AES-256-GCM 加密项目数据
- 数据脱敏 - 支持手机号、邮箱、身份证等敏感信息脱敏
- 数据访问策略 - 基于用户、角色、IP、时间的访问控制
- 访问审批流程 - 敏感数据访问需要审批
- 更新 schema.sql 添加安全相关数据库表
- audit_logs: 审计日志表
- encryption_configs: 加密配置表
- masking_rules: 脱敏规则表
- data_access_policies: 数据访问策略表
- access_requests: 访问请求表
- 更新 main.py 添加安全相关 API 端点
- GET /api/v1/audit-logs - 查询审计日志
- GET /api/v1/audit-logs/stats - 审计统计
- POST /api/v1/projects/{id}/encryption/enable - 启用加密
- POST /api/v1/projects/{id}/encryption/disable - 禁用加密
- POST /api/v1/projects/{id}/encryption/verify - 验证密码
- GET /api/v1/projects/{id}/encryption - 获取加密配置
- POST /api/v1/projects/{id}/masking-rules - 创建脱敏规则
- GET /api/v1/projects/{id}/masking-rules - 获取脱敏规则
- PUT /api/v1/masking-rules/{id} - 更新脱敏规则
- DELETE /api/v1/masking-rules/{id} - 删除脱敏规则
- POST /api/v1/projects/{id}/masking/apply - 应用脱敏
- POST /api/v1/projects/{id}/access-policies - 创建访问策略
- GET /api/v1/projects/{id}/access-policies - 获取访问策略
- POST /api/v1/access-policies/{id}/check - 检查访问权限
- POST /api/v1/access-requests - 创建访问请求
- POST /api/v1/access-requests/{id}/approve - 批准访问
- POST /api/v1/access-requests/{id}/reject - 拒绝访问
- 更新 requirements.txt 添加 cryptography 依赖
- 更新 STATUS.md 和 README.md 记录完成状态
113 lines
2.8 KiB
Markdown
113 lines
2.8 KiB
Markdown
# InsightFlow Chrome Extension
|
|
|
|
一键将网页内容导入 InsightFlow 知识库的 Chrome 扩展。
|
|
|
|
## 功能特性
|
|
|
|
- 📄 **保存整个页面** - 自动提取正文内容并保存
|
|
- ✏️ **保存选中内容** - 只保存您选中的文本
|
|
- 🔗 **保存链接** - 快速保存网页链接
|
|
- 🔄 **自动同步** - 剪辑后自动同步到服务器
|
|
- 📎 **浮动按钮** - 页面右下角快速访问按钮
|
|
- 🎯 **智能提取** - 自动识别正文,过滤广告和导航
|
|
|
|
## 安装方法
|
|
|
|
### 开发者模式安装
|
|
|
|
1. 打开 Chrome 浏览器,进入 `chrome://extensions/`
|
|
2. 开启右上角的"开发者模式"
|
|
3. 点击"加载已解压的扩展程序"
|
|
4. 选择 `chrome-extension` 文件夹
|
|
|
|
### 配置
|
|
|
|
1. 点击扩展图标,选择"设置"
|
|
2. 填写您的 InsightFlow 服务器地址
|
|
3. 输入 Chrome 扩展令牌(从 InsightFlow 插件管理页面获取)
|
|
4. 点击"保存设置"
|
|
5. 点击"测试连接"验证配置
|
|
|
|
## 使用方法
|
|
|
|
### 方式一:扩展图标
|
|
1. 点击浏览器工具栏上的 InsightFlow 图标
|
|
2. 选择"保存整个页面"或"保存选中内容"
|
|
|
|
### 方式二:右键菜单
|
|
1. 在网页任意位置右键
|
|
2. 选择"Clip page to InsightFlow"或"Clip selection to InsightFlow"
|
|
|
|
### 方式三:浮动按钮
|
|
1. 在页面右下角点击 📎 按钮
|
|
2. 快速保存当前页面
|
|
|
|
### 方式四:快捷键
|
|
- `Ctrl+Shift+S` (Windows/Linux)
|
|
- `Cmd+Shift+S` (Mac)
|
|
|
|
## 文件结构
|
|
|
|
```
|
|
chrome-extension/
|
|
├── manifest.json # 扩展配置
|
|
├── background.js # 后台脚本
|
|
├── content.js # 内容脚本
|
|
├── content.css # 内容样式
|
|
├── popup.html # 弹出窗口
|
|
├── popup.js # 弹出窗口脚本
|
|
├── options.html # 设置页面
|
|
├── options.js # 设置页面脚本
|
|
└── icons/ # 图标文件夹
|
|
├── icon16.png
|
|
├── icon48.png
|
|
└── icon128.png
|
|
```
|
|
|
|
## 开发
|
|
|
|
### 本地开发
|
|
|
|
1. 修改代码后,在 `chrome://extensions/` 页面点击刷新按钮
|
|
2. 查看背景页控制台:扩展卡片 > 背景页 > 控制台
|
|
|
|
### 打包发布
|
|
|
|
1. 确保所有文件已保存
|
|
2. 在 `chrome://extensions/` 页面点击"打包扩展程序"
|
|
3. 选择 `chrome-extension` 文件夹
|
|
4. 生成 `.crx` 和 `.pem` 文件
|
|
|
|
## API 集成
|
|
|
|
扩展通过以下 API 与 InsightFlow 服务器通信:
|
|
|
|
### 导入网页内容
|
|
```
|
|
POST /api/v1/plugins/chrome/import
|
|
Content-Type: application/json
|
|
X-API-Key: {token}
|
|
|
|
{
|
|
"token": "if_ext_xxx",
|
|
"url": "https://example.com/article",
|
|
"title": "文章标题",
|
|
"content": "正文内容...",
|
|
"html_content": "<html>..."
|
|
}
|
|
```
|
|
|
|
### 健康检查
|
|
```
|
|
GET /api/v1/health
|
|
```
|
|
|
|
## 隐私说明
|
|
|
|
- 扩展仅在您主动点击时收集网页内容
|
|
- 所有数据存储在您的 InsightFlow 服务器上
|
|
- 不会收集或发送任何个人信息到第三方
|
|
|
|
## 许可证
|
|
|
|
MIT License |