You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2020/11/04 00:40:49 UTC

[GitHub] [apisix] membphis commented on a change in pull request #2594: example: the use of the RS256 algorithm to run the jwt-auth plugin #2523

membphis commented on a change in pull request #2594:
URL: https://github.com/apache/apisix/pull/2594#discussion_r517035325



##########
File path: apisix/plugins/jwt-auth.lua
##########
@@ -105,6 +106,12 @@ function _M.check_schema(conf, schema_type)
             conf.secret = ngx_encode_base64(resty_random.bytes(32, true))
         end
 
+        if conf.algorithm == "RS256" then
+            if not conf.public_key or not conf.private_key then
+                return false, "when using RS256 algorithm, the parameter 'public_key' and 'private_key' is both required."

Review comment:
       and we should use JSONSchema to check it.

##########
File path: apisix/plugins/jwt-auth.lua
##########
@@ -105,6 +106,12 @@ function _M.check_schema(conf, schema_type)
             conf.secret = ngx_encode_base64(resty_random.bytes(32, true))
         end
 
+        if conf.algorithm == "RS256" then
+            if not conf.public_key or not conf.private_key then
+                return false, "when using RS256 algorithm, the parameter 'public_key' and 'private_key' is both required."

Review comment:
       this line is long




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org