feat(server): 添加可插拔认证系统 | add pluggable authentication system (#386)

* feat(server): 添加可插拔认证系统 | add pluggable authentication system

- 新增 JWT 认证提供者 (createJwtAuthProvider)
- 新增 Session 认证提供者 (createSessionAuthProvider)
- 新增服务器认证 mixin (withAuth)
- 新增房间认证 mixin (withRoomAuth)
- 新增认证装饰器 (@requireAuth, @requireRole)
- 新增测试工具 (MockAuthProvider)
- 新增中英文文档
- 导出路径: @esengine/server/auth, @esengine/server/auth/testing

* fix(server): 使用加密安全的随机数生成 session ID | use crypto-secure random for session ID
This commit is contained in:
YHH
2025-12-29 16:10:09 +08:00
committed by GitHub
parent 1cfa64aa0f
commit 61a13baca2
26 changed files with 4404 additions and 4 deletions

View File

@@ -0,0 +1,13 @@
---
"@esengine/server": minor
---
feat(server): 添加可插拔认证系统 | add pluggable authentication system
- 新增 JWT 认证提供者 (`createJwtAuthProvider`)
- 新增 Session 认证提供者 (`createSessionAuthProvider`)
- 新增服务器认证 mixin (`withAuth`)
- 新增房间认证 mixin (`withRoomAuth`)
- 新增认证装饰器 (`@requireAuth`, `@requireRole`)
- 新增测试工具 (`MockAuthProvider`)
- 导出路径: `@esengine/server/auth`, `@esengine/server/auth/testing`