Skip to content

JWT Decoding Processor#400

Merged
Anilm3 merged 36 commits into
masterfrom
anilm3/jwt-decoder
May 6, 2025
Merged

JWT Decoding Processor#400
Anilm3 merged 36 commits into
masterfrom
anilm3/jwt-decoder

Conversation

@Anilm3

@Anilm3 Anilm3 commented Apr 25, 2025

Copy link
Copy Markdown
Collaborator

This PR introduces a new processor for decoding JWT tokens. This new processor can be used as a preprocessor to generate an address containing the JWT token contents as a map with the following schema:

{
  "header": { ... },
  "payload": { ... },
  "signature": {
    "available" : true | false 
  }
}

In addition, the following supporting changes have been introduced:

  • The base64_decode transformer has been "forked" into the base64url_decode transformer, as used by JWT.
  • The underlying JSON within the token is being parsed using rapidjson.

Related Jiras: APPSEC-57472

@pr-commenter

pr-commenter Bot commented Apr 25, 2025

Copy link
Copy Markdown

Benchmarks clang

Benchmark execution time: 2025-05-02 14:54:56

Comparing candidate commit 50f86d5 in PR branch anilm3/jwt-decoder with baseline commit 501deb6 in branch master.

Found 1 performance improvements and 0 performance regressions! Performance is the same for 0 metrics, 0 unstable metrics.

scenario:global-benchmark.random.clang

  • 🟩 execution_time [-14.574ms; -14.559ms] or [-5.677%; -5.671%]

@pr-commenter

pr-commenter Bot commented Apr 25, 2025

Copy link
Copy Markdown

Benchmarks gcc

Benchmark execution time: 2025-05-02 14:57:37

Comparing candidate commit 50f86d5 in PR branch anilm3/jwt-decoder with baseline commit 501deb6 in branch master.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 1 metrics, 0 unstable metrics.

@pr-commenter

pr-commenter Bot commented Apr 25, 2025

Copy link
Copy Markdown

Benchmarks clang-pgo

Benchmark execution time: 2025-05-02 15:11:07

Comparing candidate commit 50f86d5 in PR branch anilm3/jwt-decoder with baseline commit 501deb6 in branch master.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 1 metrics, 0 unstable metrics.

@codecov-commenter

codecov-commenter commented Apr 25, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 79.68127% with 51 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.09%. Comparing base (501deb6) to head (74a0178).
⚠️ Report is 58 commits behind head on master.

Files with missing lines Patch % Lines
src/json_utils.cpp 75.43% 14 Missing and 14 partials ⚠️
src/processor/jwt_decode.cpp 83.78% 2 Missing and 10 partials ⚠️
src/transformer/base64_decode.cpp 80.64% 2 Missing and 4 partials ⚠️
src/configuration/processor_parser.cpp 60.00% 2 Missing and 2 partials ⚠️
src/configuration/common/transformer_parser.cpp 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #400      +/-   ##
==========================================
- Coverage   85.21%   85.09%   -0.12%     
==========================================
  Files         166      169       +3     
  Lines        8364     8600     +236     
  Branches     3687     3777      +90     
==========================================
+ Hits         7127     7318     +191     
- Misses        477      497      +20     
- Partials      760      785      +25     
Flag Coverage Δ
waf_test 85.09% <79.68%> (-0.12%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Anilm3
Anilm3 marked this pull request as ready for review April 30, 2025 08:45
@Anilm3
Anilm3 requested a review from a team as a code owner April 30, 2025 08:45
Comment thread CMakeLists.txt
Comment thread src/builder/processor_builder.cpp Outdated
Comment thread src/transformer/base64_decode.cpp Outdated
Comment thread src/json_utils.cpp Outdated
Comment thread src/json_utils.cpp
Comment thread src/json_utils.cpp Outdated
@Anilm3
Anilm3 merged commit b8c0a53 into master May 6, 2025
@Anilm3
Anilm3 deleted the anilm3/jwt-decoder branch May 6, 2025 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants