From ba64c55a1fc65fb44f60723d7ed957d64fa3048c Mon Sep 17 00:00:00 2001 From: David Galeano Date: Mon, 7 Sep 2020 13:59:28 +0100 Subject: [PATCH] Declare "_" as local When running luacheck on this file it will warn that several lines are "setting non-standard global variable _". To avoid the warning an declare "_" as local I added it to the list of local variables. --- lib/resty/jwt.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/resty/jwt.lua b/lib/resty/jwt.lua index a1a8b11..0aee1c1 100644 --- a/lib/resty/jwt.lua +++ b/lib/resty/jwt.lua @@ -236,7 +236,7 @@ local function parse_jwe(self, preshared_key, encoded_header, encoded_encrypted_ error({reason="invalid algorithm: " .. alg}) end - local key, enc_key + local key, enc_key, _ if alg == str_const.DIR then if not preshared_key then error({reason="preshared key must not be null"}) @@ -437,7 +437,7 @@ local function sign_jwe(self, secret_key, jwt_obj) end -- TODO: implement logic for creating enc key and mac key and then encrypt key - local key, encrypted_key, mac_key, enc_key + local key, encrypted_key, mac_key, enc_key, _ if alg == str_const.DIR then _, mac_key, enc_key = derive_keys(enc, secret_key) encrypted_key = ""