Repository navigation
feat(accounts): add personal center and configurable session limits - #26
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
数据库账号原来无法辨认和选择退出某个登录,也缺少头像和管理员资料重置。新增完整个人中心、当前身份展示和登录管理;默认每人最多同时保留 5 个有效网站会话,管理员可在站点设置调整为 1–100。满额拒绝新登录并保留已有会话,网页登录和旧 RSA 签发共享限制。
主要变化:
<=100有效会话时列表使用范围索引,较大合法存量保留分页索引。管理员一次批量 OR 聚合;数量不截断。ID 生成器改为正数、进程内递增,保留旧负会话 ID 的兼容读取与退出。验证在实际 Pi 的独立目录、合成 MariaDB/Redis 和回环 HTTPS nginx 执行,浏览器通过
pi_outSSH 隧道访问:Go 全包构建及主服务/维护工具产物通过;CI 范围 31 个包、475 项测试(含子用例)通过;前端 82/82 与生产构建通过;真实页面 13 项检查通过,覆盖资料/头像/改密/资料重置、5 个登录/第 6 个拒绝、释放名额、管理员调高调低及旧策略 UI 回滚。12/32 个混合并发登录各只签发 5 条。迁移/维护三包及 ID race 检查通过,nginx/systemd 模板、公开部署检查与两张 Mermaid 图通过。SQL 实测:单用户 10,000 历史/100 有效,列表仅扫描 99 条;5 有效时排除当前后扫描 4 条。100 用户/500 有效/500 旧版本未到期/9,000 过期,聚合扫描 500 条。遗留 10,000 全有效仍仅扫描 22/21 条获得首页/下一页,总数保持 10,000。42 项查询结果对照一致。
详情统计的并发回归先复现旧版本/新统计条件冲突导致的漏数,再将账号与数量读取合入同一只读快照。新增回归和全部 23 项会话/容量测试通过:读 V1 后并发提交 V2 的详情保持 V1/1,刷新后为 V2/1;旧 Token 拒绝、新 Token 可用。
上线需先执行独立
accounts-maintain的 11 阶段增量迁移,再部署匹配后端、代理和前端。已发布的两个旧 DDL 不变;真实 CLI 10→11 阶段续升与重跑保留原标记及导入摘要。正式服务及数据库未替换。新策略发布后退至更旧后端需准备兼容配置;维护工具与每日 timer 的安装顺序见docs/account-center-operations.md,详细设计及验证见docs/specs/account-center/。