PUT /admin/oauth/providers/{name}

更新指定OAuth提供商的配置信息,支持部分更新(仅提交需要修改的字段)。仅管理员可访问。

OAuth `bearerAuth` application/json

请求参数

名称位置类型必填默认值示例约束描述
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 Tokenservice-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