[GitHub] [apisix] spacewander commented on a diff in pull request #8660: change(jwt-auth): unify apisix/core/vault.lua and apisix/secret/vault.lua

2023-01-17 Thread GitBox


spacewander commented on code in PR #8660:
URL: https://github.com/apache/apisix/pull/8660#discussion_r1073050987


##
apisix/plugins/jwt-auth.lua:
##
@@ -274,32 +234,16 @@ end
 local function get_rsa_or_ecdsa_keypair(conf, consumer_name)
 local public_key = conf.public_key
 local private_key = conf.private_key
--- if keys are present in conf, no need to query vault (fallback)
+
 if public_key and private_key then
 return public_key, private_key
+elseif public_key and not private_key then
+return public_key, nil, "missing private key"

Review Comment:
   Will it be a problem in 
https://github.com/shreemaan-abhishek/apisix/blob/09f6c5971176b6fd60b9c090aacd1c556c072d1d/apisix/plugins/jwt-auth.lua#L291?



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



[GitHub] [apisix] spacewander commented on a diff in pull request #8660: change(jwt-auth): unify apisix/core/vault.lua and apisix/secret/vault.lua

2023-01-27 Thread via GitHub


spacewander commented on code in PR #8660:
URL: https://github.com/apache/apisix/pull/8660#discussion_r1089581139


##
apisix/plugins/jwt-auth.lua:
##
@@ -274,32 +234,16 @@ end
 local function get_rsa_or_ecdsa_keypair(conf, consumer_name)
 local public_key = conf.public_key
 local private_key = conf.private_key
--- if keys are present in conf, no need to query vault (fallback)
+
 if public_key and private_key then
 return public_key, private_key
+elseif public_key and not private_key then
+return public_key, nil, "missing private key"

Review Comment:
   
https://github.com/apache/apisix/blob/9c899b87648039e2c6c73b087d627aea2df90f55/apisix/plugins/jwt-auth.lua#L347
   Here we check if public_key is nil to detect the err.



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