modify: auth插件拆分,将token签发部分交给网关
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
# ====== 插件注册信息(控制加载方式) ======
|
||||
[workers]
|
||||
type = "auth_oauth"
|
||||
module = "plugins.auth_oauth"
|
||||
factory = "create_workers"
|
||||
cleanup = "cleanup"
|
||||
count = 1
|
||||
# 身份源插件持有签名密钥的使用方(issue_token),走 inline 与网关同信任域;
|
||||
# external 部署前需先解决密钥下发问题(见插件 README 安全说明)
|
||||
load_mode = "inline"
|
||||
|
||||
[worker]
|
||||
name = "auth_oauth"
|
||||
version = "0.1.0"
|
||||
description = "第三方授权登录示例(GitHub OAuth / 手机验证码)"
|
||||
config_version = "1.0"
|
||||
defaults = { method = "GET", ttl = 30, timeout = 10.0, auth_required = false, cacheable = false }
|
||||
|
||||
[worker.registration]
|
||||
router_prefix = "/auth/oauth"
|
||||
tags = ["auth_oauth"]
|
||||
|
||||
# ====== Worker 运行时配置 ======
|
||||
[workers.config]
|
||||
data_dir = "./data"
|
||||
# 演示模式:验证码随响应返回(无短信通道的本地演示)。生产必须置 false 并接真实短信通道
|
||||
return_otp_in_response = true
|
||||
|
||||
# GitHub OAuth App 凭据(https://github.com/settings/developers 创建)
|
||||
[workers.config.github]
|
||||
client_id = "your-github-oauth-client-id"
|
||||
client_secret = "your-github-oauth-client-secret"
|
||||
redirect_uri = "http://localhost:5173/auth/oauth/github/callback"
|
||||
scope = "read:user user:email"
|
||||
Reference in New Issue
Block a user