/auth/api-keys
创建新的 API Key,返回原始 Key 仅一次
请求体
Schema: service-identity/internal/handler/dto.CreateApiKeyRequest
| 字段 | 类型 | 必填 | 示例 | 约束 | 描述 |
|---|---|---|---|---|---|
name |
string |
是 | |||
environment |
string |
否 | enum: `live`, `test` | ||
expires_at |
string |
否 | |||
scopes |
array of string |
否 |
响应
| 状态 | 描述 | Schema |
|---|---|---|
| 201 | 创建成功,返回原始 Key(仅此一次) |
引用的 Schema
service-identity/internal/handler/dto.CreateApiKeyResponse
| 字段 | 类型 | 必填 | 示例 | 约束 | 描述 |
|---|---|---|---|---|---|
created_at |
string |
否 | |||
environment |
string |
否 | |||
expires_at |
string |
否 | |||
id |
string |
否 | |||
name |
string |
否 | |||
raw_key |
string |
否 | |||
scopes |
array of string |
否 | |||
status |
string |
否 |
service-identity/internal/handler/dto.DataResponse
| 字段 | 类型 | 必填 | 示例 | 约束 | 描述 |
|---|---|---|---|---|---|
code |
integer |
否 | |||
data |
object |
否 | |||
message |
string |
否 |