Tasks #70910
opensts: replace src/rgw/jwt-cpp/ with submodule
0%
Description
point a submodule at https://github.com/Thalhammer/jwt-cpp so it's easier to a) see which commit or upstream release we're currently using, and b) pull up the library to a more recent release
TK Updated by Tahia Khan 17 days ago
I took a stab at this thinking it would be a smaller good-first-issue ticket, but it ended up being more involved than I was expecting so please let me know if I’ve gone off course with my approach here! I have a PR here: https://github.com/ceph/ceph/pull/73914
Turns out Ceph's vendored jwt-cpp wasn't vanilla upstream and had some custom helpers and hooks patched on top in jwt.h (eg setModulusExponentCalcPublicKey, raw BIGNUM/RSA manipulation). I tested some older upstream releases and none included those helpers either.
Because of that, swapping to the upstream v0.7.2 as a clean submodule wasn't a drop-in file swap - I ended up taking this approach:
- Registered upstream
jwt-cppas a clean submodule and worked around thepicojsonexpectmacro collision with Ceph's global macro using #pragma push_macro / #pop_macro inrgw_rest_sts.h. - Refactored
rgw_rest_sts.cc/.hfor upstream API and template shifts (jwt::json::type,get_payload_json()), replacing old custom hooks with ajwk_to_pem()helper inrgw_rest_sts.cc. - Added try-catch exception handling in
rgw_b64.hfor strict upstream base64 decoding to fixTOKEN.BADINPUT/TOKEN.BADINPUT2test failures.
TK Updated by Tahia Khan 15 days ago
I was notified that the updated submodule introduces a regression in tags parsing code in AssumeRoleWithWebIdentity: https://github.com/ceph/ceph/pull/73914#issuecomment-6937739556
I'll see if its possible to cover the regression with a new handler/unit tests and report back