Project

General

Profile

Actions

Tasks #70910

open
CB

sts: replace src/rgw/jwt-cpp/ with submodule

Tasks #70910: sts: replace src/rgw/jwt-cpp/ with submodule

Added by Casey Bodley over 1 year ago. Updated 15 days ago.

Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
Due date:
% Done:

0%

Reviewed:
Affected Versions:
Pull request ID:
Tags (freeform):
Merge Commit:
Fixed In:
Released In:
Upkeep Timestamp:

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 Actions #1

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-cpp as a clean submodule and worked around the picojson expect macro collision with Ceph's global macro using #pragma push_macro / #pop_macro in rgw_rest_sts.h.
  • Refactored rgw_rest_sts.cc/.h for upstream API and template shifts (jwt::json::type, get_payload_json()), replacing old custom hooks with a jwk_to_pem() helper in rgw_rest_sts.cc.
  • Added try-catch exception handling in rgw_b64.h for strict upstream base64 decoding to fix TOKEN.BADINPUT / TOKEN.BADINPUT2 test failures.

TK Updated by Tahia Khan 15 days ago Actions #2

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

Actions

Also available in: PDF Atom