darkSheep404 commented on PR #9948: URL: https://github.com/apache/apisix/pull/9948#issuecomment-1661579858
> Thanks for your PR > > 1. Can the document not be modified so much? I think you should just add a line. > 2. Where does this option come from? How to confirm that it works normally, can you explain briefly? Indeed, it may be inconvenient to build tests because it involves proxy. > Thanks for your PR > > 1. Can the document not be modified so much? I think you should just add a line. > 2. Where does this option come from? How to confirm that it works normally, can you explain briefly? Indeed, it may be inconvenient to build tests because it involves proxy. 像上文中的流程图一样 openid-connect插件 通过http请求oauth2服务器的操作 都是调用`openidc`.lua的方法来实现 `openidc.lua` 发起http请求时 都会通过以下代码新建http request ```lua local httpc = http.new() openidc_configure_timeouts(httpc, opts.timeout) openidc_configure_proxy(httpc, opts.proxy_opts) ``` 其中`configure_proxy`方法 会检测`opts.proxy_opts`属性是否存在 存在则会配置代理 ```lua local function openidc_configure_proxy(httpc, proxy_opts) if httpc and proxy_opts and type(proxy_opts) == "table" then log(DEBUG, "openidc_configure_proxy : use http proxy") httpc:set_proxy_options(proxy_opts) else log(DEBUG, "openidc_configure_proxy : don't use http proxy") end end ``` `openid-connect `调用`openidc.lua`时 会把拷贝的插件的配置`conf` 作为第一个参数 传入 `openidc.lua`把传入的第一个参数作为`opts`接收 调用`openidc.authenticate()`方法时 ``` #in openid-connect.lua response, err = openidc.authenticate(conf,_,_,session_opts) #in openidc.lua openidc.authenticate(opts, target_url, unauth_action, session_opts) ``` 另外 `_M_rewrite`入口处 会`local conf = core.table.clone(plugin_conf)` 所以 openid-connect插件配置`proxy_opts`参数时 会传给`openidc.lua` 作为`opts.proxy_opts`, 用于新建http请求时 配置代理 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org