bisakhmondal commented on a change in pull request #5745:
URL: https://github.com/apache/apisix/pull/5745#discussion_r766348818



##########
File path: apisix/plugins/jwt-auth.lua
##########
@@ -119,29 +143,74 @@ function _M.check_schema(conf, schema_type)
     if schema_type == core.schema.TYPE_CONSUMER then
         ok, err = core.schema.check(consumer_schema, conf)
     else
-        ok, err = core.schema.check(schema, conf)
+        return core.schema.check(schema, conf)
     end
 
     if not ok then
         return false, err
     end
 
-    if schema_type == core.schema.TYPE_CONSUMER then
-        if conf.algorithm ~= "RS256" and not conf.secret then
-            conf.secret = ngx_encode_base64(resty_random.bytes(32, true))
+    -- in nginx init_worker_by_lua context API calls are disabled,
+    -- also that is a costly operation during system startup.
+    if ngx.get_phase() == "init_worker" then

Review comment:
       Resolved. Thanks




-- 
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


Reply via email to