/admin/oauth/providers/{name}
更新指定OAuth提供商的配置信息,支持部分更新(仅提交需要修改的字段)。仅管理员可访问。
请求参数
| 名称 | 位置 | 类型 | 必填 | 默认值 | 示例 | 约束 | 描述 |
|---|---|---|---|---|---|---|---|
name |
path |
string |
是 | 提供商名称 |
请求体
Schema: service-oauth/internal/handler/dto.AdminUpdateProviderRequest
| 字段 | 类型 | 必填 | 示例 | 约束 | 描述 |
|---|---|---|---|---|---|
auth_url |
string |
否 | |||
client_id |
string |
否 | |||
client_secret |
string |
否 | |||
display_name |
string |
否 | |||
redirect_url |
string |
否 | |||
scopes |
string |
否 | |||
token_url |
string |
否 | |||
user_info_url |
string |
否 |
响应
| 状态 | 描述 | Schema |
|---|---|---|
| 200 | 更新后的提供商信息 | dto.DataResponse-service-oauth/internal/handler/dto/OAuthProviderItem |
| 400 | 请求参数错误 | service-core/base/dto.SimpleResponse |
| 401 | 未认证:请提供有效的 Bearer Token | service-core/base/dto.SimpleResponse |
| 403 | 权限不足:需要管理员权限 | service-core/base/dto.SimpleResponse |
| 404 | 提供商不存在 | service-core/base/dto.SimpleResponse |
| 500 | 服务内部错误 | service-core/base/dto.SimpleResponse |
引用的 Schema
dto.DataResponse-service-oauth/internal/handler/dto/OAuthProviderItem
| 字段 | 类型 | 必填 | 示例 | 约束 | 描述 |
|---|---|---|---|---|---|
code |
integer |
否 | |||
data |
service-oauth/internal/handler/dto.OAuthProviderItem |
否 | |||
message |
string |
否 | |||
timestamp |
string |
否 |
service-core/base/dto.SimpleResponse
| 字段 | 类型 | 必填 | 示例 | 约束 | 描述 |
|---|---|---|---|---|---|
code |
integer |
否 | |||
message |
string |
否 | |||
timestamp |
string |
否 |
service-oauth/internal/handler/dto.OAuthProviderItem
| 字段 | 类型 | 必填 | 示例 | 约束 | 描述 |
|---|---|---|---|---|---|
auth_url |
string |
否 | https://github.com/login/oauth/authorize |
||
client_id |
string |
否 | client-id |
||
created_at |
string |
否 | 2026-04-15T10:30:00Z |
||
display_name |
string |
否 | GitHub |
||
enabled |
boolean |
否 | True |
||
id |
string |
否 | prov_abc123 |
||
name |
string |
否 | github |
||
redirect_url |
string |
否 | https://app.example.com/callback |
||
scopes |
array of string |
否 | ['["read:user"', '"user:email"]'] |
||
tenant_id |
string |
否 | tenant_abc123 |
||
token_url |
string |
否 | https://github.com/login/oauth/access_token |
||
updated_at |
string |
否 | 2026-04-15T10:30:00Z |
||
user_info_url |
string |
否 | https://api.github.com/user |