Files
water/openspec/changes/fix-register-body-validation/proposal.md
2026-08-14 10:35:42 +08:00

26 lines
1.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
## Why
`/auth/register` 使用 `@Validated` 在进入控制器方法前校验 `RegisterBody`,缺少 `clientId` 的请求会直接返回“认证客户端id不能为空”因此控制器无法为注册请求补充系统默认客户端 ID。注册入口需要先补默认值再执行原有参数校验。
## What Changes
- 注册接口收到空白 `clientId` 时,将其设置为 `32324a04c0175c8d61ac8a282553aea1`
- 默认值补充完成后,通过现有 `ValidatorUtils` 执行 `RegisterBody` 的完整 Bean Validation。
- 增加控制器回归测试,覆盖默认客户端 ID 和注册服务调用。
## Capabilities
### New Capabilities
- `auth-registration`: 为已有注册入口补充默认认证客户端 ID 的行为规范。
### Modified Capabilities
无。仓库当前没有注册流程的既有 OpenSpec。
## Impact
- 影响 `water-admin` 中的 `/auth/register` 控制器及其单元测试。
- `/auth/register` 允许调用方省略或传入空白 `clientId`,其他注册参数约束保持不变。
- 不新增依赖,不修改数据库结构,也不新增公共端点。