PUT /auth/me/password

验证旧密码后设置新密码,修改成功后自动撤销所有会话以确保账户安全。参考:NIST SP 800-63B §5.1.1.2、OWASP ASVS V2.1。

身份认证 `bearerAuth` application/json

请求体

Schema: service-identity/internal/handler/dto.HTTPChangePasswordRequest

字段类型必填示例约束描述
new_password string 是 length: 8–? New password
old_password string 否 Old password (optional for admin reset)
password_transmission string 否 plain|hash|symmetric|asymmetric

响应

状态描述Schema
200密码修改成功,所有会话已撤销service-identity/internal/handler/dto.ChangePasswordResponse
400请求参数无效或旧密码验证失败service-core/base/dto.SimpleResponse
401未认证或令牌无效service-core/base/dto.SimpleResponse
500服务器内部错误service-core/base/dto.SimpleResponse

引用的 Schema

service-core/base/dto.SimpleResponse

字段类型必填示例约束描述
code integer 否
message string 否
timestamp string 否

service-identity/internal/handler/dto.ChangePasswordResponse

字段类型必填示例约束描述
code integer 否
message string 否