Files
Дамян Минков ed4780e4c8 perf(prosody): faster JWT handling in luajwtjitsi, drop basexx (#18212)
* perf(prosody): use native base64 and reuse parsed keys in luajwtjitsi

When many clients connect at once, token verification was a visible part of
prosody's CPU. Decoding went through basexx, which is pure Lua, and every
verification parsed the public key PEM again, which takes milliseconds with
OpenSSL 3.

Decode and encode base64url with prosody's util.encodings, which is native
code, and keep the parsed keys. Decoding stays strict about the alphabet
and the length, and accepts padding. The base64url helpers are exported for
the plugins that read token segments themselves.

The specs get a pure Lua stand-in for util.encodings, as it is not there
outside prosody.

* chore(prosody): drop the basexx dependency

The token libraries now use prosody's util.encodings and the base64url
helpers of luajwtjitsi, so nothing needs basexx any more. Drop it from the
jitsi-meet-prosody dependencies, the plugin tests workflow and the
integration test image.

* fix(prosody): return an error for undecodable token segments

from_url64 returns nil and a message for input it cannot decode. Both values
went to cjson.safe.decode, which throws when it gets a second argument, so
parse_token threw instead of returning "Invalid header" or "Invalid body".
Only the decoded string is passed now.
2026-11-04 13:47:47 -06:00
..
2026-10-27 18:08:19 +02:00