Conversation
合并策略: - 以 main 的 authorization 重构(登录/刷新/登出集中在 loginUsecase)为骨架, controller 采用 main 版本,登录日志异步记录改用 context.WithoutCancel - 令牌校验采用 oidc 的 ParseAccessClaims/ParseRefreshClaims + 严格 Bearer 解析 + 无 jti 拒绝策略(jwt_auth_middleware、tokenutil、JTI()) - 分页统一为 oidc 的 Paginate()(DefaultPage/DefaultPageSize/MaxPageSize), main 的 mapSlice 保留,移除 main 已废弃的 role FetchPaged - 角色错误语义化:domain.ErrRoleNotFound/ErrRoleNameExists(中文文案)+ main 的 ErrRoleInUse,role_controller 用 errors.Is switch 映射 404/409 - 日志中间件采用 oidc 新格式(无边框/着色/截断),Authorization 统一用常量 - 保留 main 的 keyword 查询、登录日志邮箱、user 列表角色预加载(N+1 修复)等改动 - 工具链:go 1.27.1 + 依赖升级 + CI 触发 oidc + 新增 6 个测试文件
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.
概述
dev分支从main(5f91706)创建,合并了oidc分支(ee44688,18 个提交),冲突已全部解决并验证通过。合并后dev= 覆盖 main 全部历史 + oidc 全部历史 + 1 个合并提交。主要改动
后端
usecase/login_usecase.go;令牌校验改用ParseAccessClaims/ParseRefreshClaims;Bearer 严格解析(大小写不敏感、拒绝内嵌空格);黑名单策略收紧——无jti的令牌直接拒绝context.WithoutCancel,避免请求结束后丢日志;新增邮箱字段Paginate()归一化 +DefaultPage/DefaultPageSize/MaxPageSize;删除 main 已废弃的 roleFetchPagedErrRoleNotFound/ErrRoleNameExists/ErrRoleInUse哨兵错误,errors.Is映射 404/409/403,修复CreateRole中return err(nil)的 bugStatusIn查询keyword前端
user-source.ts)types/user.ts增加nickname/source/is_active,移除provider_avatar_url测试与工具链
oidc.claude/skills/开发文档验证
go build ./...、gofmt -l、go vet ./...、go test ./...全部通过go generate ./...(ent + swagger)无差异pnpm lint(0 error)、format:check、build(tsc + vite)全部通过说明
ent/生成代码与frontend/dist为 gitignore,未入库(CI 会自动生成)