refactor(oauth): drop the hand-written providers and keep only what the SDK ships
The previous commit added five direct clients (Douyin, Microsoft, Facebook, Twitter, Apple) written against each platform's own endpoints. Maintaining five bespoke OAuth implementations — including Apple's ES256 client secret and Twitter's PKCE — is maintenance the bundled yurunsoft SDK does not ask for, and none of them could be verified without production credentials. Only providers yurunsoft/yurun-oauth-login actually implements stay on the direct surface: GitHub, Gitee, QQ, Google, Weibo, Weixin, Baidu and Alipay. Baidu and Alipay move into OAuthProviderBroker's existing client() switch and normalize() map rather than living in a separate class, so there is no new layer to reason about. OAuthProviderClient, its harness and its contract test are deleted outright (-809 lines). The Apple form_post handling added to handle_callback() is reverted too — without Apple there is no POST callback to read. The aggregate-login channel keeps its 16 platforms, matching the reference; that list describes what the aggregation provider offers, not a local implementation. Brand icons for those names stay for the same reason. Verification: 869 widget/navigation tests pass, the PSR-4 audit reports 0 errors, and the catalog constant, PHP schema and Vue schema now list the same 16 aggregate platforms.
This commit is contained in:
1 parent
6db34646ed
commit
b1c3d86e44
8 files changed
+55
-809
No files matched your search
@@ -20,13 +20,8 @@ export const oauthSchema = {
|
||||
oauth_weibo_s: false,
|
||||
oauth_weixin_s: false,
|
||||
oauth_weixingzh_s: false,
|
||||
oauth_douyin_s: false,
|
||||
oauth_baidu_s: false,
|
||||
oauth_alipay_s: false,
|
||||
oauth_microsoft_s: false,
|
||||
oauth_facebook_s: false,
|
||||
oauth_twitter_s: false,
|
||||
oauth_apple_s: false,
|
||||
clogin_s: false,
|
||||
github_appid: '',
|
||||
github_appkey: '',
|
||||
@@ -40,24 +35,11 @@ export const oauthSchema = {
|
||||
weibo_appkey: '',
|
||||
weixin_appid: '',
|
||||
weixin_appsecret: '',
|
||||
douyin_appid: '',
|
||||
douyin_appkey: '',
|
||||
baidu_appid: '',
|
||||
baidu_appkey: '',
|
||||
alipay_appid: '',
|
||||
alipay_appkey: '',
|
||||
alipay_private_key: '',
|
||||
microsoft_appid: '',
|
||||
microsoft_appkey: '',
|
||||
facebook_appid: '',
|
||||
facebook_appkey: '',
|
||||
twitter_appid: '',
|
||||
twitter_appkey: '',
|
||||
apple_appid: '',
|
||||
apple_appkey: '',
|
||||
apple_team_id: '',
|
||||
apple_key_id: '',
|
||||
apple_private_key: '',
|
||||
weixingzh_gzh_type: 'service',
|
||||
weixingzh_token: '',
|
||||
weixingzh_appid: '',
|
||||
@@ -82,8 +64,8 @@ export const oauthSchema = {
|
||||
{ key: 'oauth_proxy_mode', label: '代理登录模式', type: 'radio', default: 'close', options: [{ label: '关闭', value: 'close' }, { label: '服务端', value: 'server' }, { label: '客户端', value: 'client' }] },
|
||||
{ key: 'oauth_proxy_secret', label: '代理 HMAC 密钥', type: 'input', inputType: 'password', secret: true, default: '', dependsOn: { key: 'oauth_proxy_mode', not: 'close' } },
|
||||
{ key: 'oauth_proxy_server_url', label: '服务端地址', type: 'input', default: '', dependsOn: { key: 'oauth_proxy_mode', value: 'client' } },
|
||||
{ key: 'oauth_proxy_server_providers', label: '服务端允许平台', type: 'checkbox', default: ['github', 'gitee', 'qq', 'google'], options: [{ label: 'GitHub', value: 'github' }, { label: 'Gitee', value: 'gitee' }, { label: 'QQ', value: 'qq' }, { label: 'Google', value: 'google' }, { label: '微博', value: 'weibo' }, { label: '微信', value: 'weixin' }, { label: '抖音', value: 'douyin' }, { label: '百度', value: 'baidu' }, { label: '支付宝', value: 'alipay' }, { label: 'Microsoft', value: 'microsoft' }, { label: 'Facebook', value: 'facebook' }, { label: 'Twitter', value: 'twitter' }, { label: 'Apple', value: 'apple' }], dependsOn: { key: 'oauth_proxy_mode', value: 'server' } },
|
||||
{ key: 'oauth_proxy_client_providers', label: '客户端启用平台', type: 'checkbox', default: ['github', 'gitee', 'qq', 'google'], options: [{ label: 'GitHub', value: 'github' }, { label: 'Gitee', value: 'gitee' }, { label: 'QQ', value: 'qq' }, { label: 'Google', value: 'google' }, { label: '微博', value: 'weibo' }, { label: '微信', value: 'weixin' }, { label: '抖音', value: 'douyin' }, { label: '百度', value: 'baidu' }, { label: '支付宝', value: 'alipay' }, { label: 'Microsoft', value: 'microsoft' }, { label: 'Facebook', value: 'facebook' }, { label: 'Twitter', value: 'twitter' }, { label: 'Apple', value: 'apple' }], dependsOn: { key: 'oauth_proxy_mode', value: 'client' } },
|
||||
{ key: 'oauth_proxy_server_providers', label: '服务端允许平台', type: 'checkbox', default: ['github', 'gitee', 'qq', 'google'], options: [{ label: 'GitHub', value: 'github' }, { label: 'Gitee', value: 'gitee' }, { label: 'QQ', value: 'qq' }, { label: 'Google', value: 'google' }, { label: '微博', value: 'weibo' }, { label: '微信', value: 'weixin' }, { label: '百度', value: 'baidu' }, { label: '支付宝', value: 'alipay' } ], dependsOn: { key: 'oauth_proxy_mode', value: 'server' } },
|
||||
{ key: 'oauth_proxy_client_providers', label: '客户端启用平台', type: 'checkbox', default: ['github', 'gitee', 'qq', 'google'], options: [{ label: 'GitHub', value: 'github' }, { label: 'Gitee', value: 'gitee' }, { label: 'QQ', value: 'qq' }, { label: 'Google', value: 'google' }, { label: '微博', value: 'weibo' }, { label: '微信', value: 'weixin' }, { label: '百度', value: 'baidu' }, { label: '支付宝', value: 'alipay' } ], dependsOn: { key: 'oauth_proxy_mode', value: 'client' } },
|
||||
{ key: 'oauth_bind_type', label: '绑定方式', type: 'radio', default: 'auto', options: [{ label: '自动绑定', value: 'auto' }, { label: '手动绑定', value: 'manual' }] },
|
||||
{ key: 'oauth_button_lg', label: '大按钮样式', type: 'switch', default: false },
|
||||
{ key: 'weixingzh_priority', label: 'PC端优先微信扫码', type: 'switch', default: false, help: '开启后 PC 端登录框优先显示微信公众号扫码' },
|
||||
@@ -101,13 +83,8 @@ export const oauthSchema = {
|
||||
{ key: 'oauth_weibo_s', label: '微博登录', type: 'switch', default: false },
|
||||
{ key: 'oauth_weixin_s', label: '微信开放平台登录', type: 'switch', default: false },
|
||||
{ key: 'oauth_weixingzh_s', label: '微信公众号登录', type: 'switch', default: false },
|
||||
{ key: 'oauth_douyin_s', label: '抖音登录', type: 'switch', default: false },
|
||||
{ key: 'oauth_baidu_s', label: '百度登录', type: 'switch', default: false },
|
||||
{ key: 'oauth_alipay_s', label: '支付宝登录', type: 'switch', default: false },
|
||||
{ key: 'oauth_microsoft_s', label: 'Microsoft 登录', type: 'switch', default: false },
|
||||
{ key: 'oauth_facebook_s', label: 'Facebook 登录', type: 'switch', default: false },
|
||||
{ key: 'oauth_twitter_s', label: 'Twitter 登录', type: 'switch', default: false },
|
||||
{ key: 'oauth_apple_s', label: 'Apple 登录', type: 'switch', default: false },
|
||||
{ key: 'clogin_s', label: '彩虹聚合登录', type: 'switch', default: false, help: '通过第三方聚合登录平台统一接入多个平台' },
|
||||
],
|
||||
},
|
||||
@@ -177,17 +154,6 @@ export const oauthSchema = {
|
||||
{ key: 'weixin_appsecret', label: 'AppSecret', type: 'input', inputType: 'password', secret: true, default: '' },
|
||||
],
|
||||
},
|
||||
{
|
||||
key: 'douyin',
|
||||
title: '抖音配置',
|
||||
icon: 'fa fas fa-music',
|
||||
collapsible: true,
|
||||
defaultCollapsed: true,
|
||||
fields: [
|
||||
{ key: 'douyin_appid', label: 'Client Key', type: 'input', default: '' },
|
||||
{ key: 'douyin_appkey', label: 'Client Secret', type: 'input', inputType: 'password', secret: true, default: '' },
|
||||
],
|
||||
},
|
||||
{
|
||||
key: 'baidu',
|
||||
title: '百度配置',
|
||||
@@ -211,53 +177,6 @@ export const oauthSchema = {
|
||||
{ key: 'alipay_private_key', label: '应用私钥', type: 'textarea', secret: true, default: '', help: 'RSA2 签名使用的应用私钥(PKCS8 格式)' },
|
||||
],
|
||||
},
|
||||
{
|
||||
key: 'microsoft',
|
||||
title: 'Microsoft 配置',
|
||||
icon: 'fa fab fa-microsoft',
|
||||
collapsible: true,
|
||||
defaultCollapsed: true,
|
||||
fields: [
|
||||
{ key: 'microsoft_appid', label: 'Application (client) ID', type: 'input', default: '' },
|
||||
{ key: 'microsoft_appkey', label: 'Client Secret', type: 'input', inputType: 'password', secret: true, default: '' },
|
||||
],
|
||||
},
|
||||
{
|
||||
key: 'facebook',
|
||||
title: 'Facebook 配置',
|
||||
icon: 'fa fab fa-facebook',
|
||||
collapsible: true,
|
||||
defaultCollapsed: true,
|
||||
fields: [
|
||||
{ key: 'facebook_appid', label: 'App ID', type: 'input', default: '' },
|
||||
{ key: 'facebook_appkey', label: 'App Secret', type: 'input', inputType: 'password', secret: true, default: '' },
|
||||
],
|
||||
},
|
||||
{
|
||||
key: 'twitter',
|
||||
title: 'Twitter 配置',
|
||||
icon: 'fa fab fa-twitter',
|
||||
collapsible: true,
|
||||
defaultCollapsed: true,
|
||||
fields: [
|
||||
{ key: 'twitter_appid', label: 'Client ID', type: 'input', default: '' },
|
||||
{ key: 'twitter_appkey', label: 'Client Secret', type: 'input', inputType: 'password', secret: true, default: '' },
|
||||
],
|
||||
},
|
||||
{
|
||||
key: 'apple',
|
||||
title: 'Apple 配置',
|
||||
icon: 'fa fab fa-apple',
|
||||
collapsible: true,
|
||||
defaultCollapsed: true,
|
||||
fields: [
|
||||
{ key: 'apple_appid', label: 'Service ID', type: 'input', default: '' },
|
||||
{ key: 'apple_appkey', label: '备用 Secret', type: 'input', inputType: 'password', secret: true, default: '' },
|
||||
{ key: 'apple_team_id', label: 'Team ID', type: 'input', default: '' },
|
||||
{ key: 'apple_key_id', label: 'Key ID', type: 'input', default: '' },
|
||||
{ key: 'apple_private_key', label: '私钥(.p8)', type: 'textarea', secret: true, default: '', help: '用于生成 client_secret 的 ES256 私钥' },
|
||||
],
|
||||
},
|
||||
{
|
||||
key: 'weixingzh',
|
||||
title: '微信公众号配置',
|
||||
|
||||
Reference in new issue
Block a user