Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add base64url fallback to base64_decode #330

Merged
merged 7 commits into from
May 2, 2024

Conversation

jbohanon
Copy link
Contributor

@jbohanon jbohanon commented Apr 19, 2024

JWTs and other usages use a modified character set from the standard base64. This variant is called base64url. When our Transformation filter is presented with a base64url encoded string to the base64_decode inja callback, the transformation fails silently because the decode returned an empty string.

This PR introduces a new pair of callbacks capable of handling base64url encoding

@solo-changelog-bot
Copy link

Issues linked to changelog:
#329

@jbohanon jbohanon requested review from yuval-k and nfuden May 1, 2024 18:26
@soloio-bulldozer soloio-bulldozer bot merged commit c503b14 into main May 2, 2024
4 checks passed
@soloio-bulldozer soloio-bulldozer bot deleted the jbohanon/transformations-base64url branch May 2, 2024 16:33
nfuden pushed a commit that referenced this pull request May 9, 2024
* add base64url

* clean up cout

* example of test failing without proposed change

* add discrete callbacks for base64url

* fallback on standard base64 for base64url decode

* keep existing behavior without fallback
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants