haproxytech / haproxy-lua-oauth

JWT Validation implementation for HAProxy Lua host
Apache License 2.0
105 stars 50 forks source link

Call decode as method #2

Closed nkvojvodic closed 5 years ago

nkvojvodic commented 5 years ago

Was getting error:

[ALERT] 093/142357 (68933) : Lua function 'jwtverify': runtime error: /usr/local/share/lua/5.3/json.lua:687: JSON:decode must be called in method format from [C] global 'assert', /usr/local/share/lua/5.3/json.lua:687 method 'onDecodeError', /usr/local/share/lua/5.3/json.lua:1005 field 'decode', /usr/local/Cellar/lua/5.3.5_1/jwtverify.lua:75 upvalue 'decodeJwt', /usr/local/Cellar/lua/5.3.5_1/jwtverify.lua:128 C function line 122.

Using the script within haproxy with lua 5.3 and current master of lua-json.

NickMRamirez commented 5 years ago

You're using the json.lua from https://github.com/rxi/json.lua? The docs for that library say to use the dot, not the colon.

nkvojvodic commented 5 years ago

@NickMRamirez Apologies, was using a different library that was previously installed. Closing this PR.