Base64 URL Safe Implementation
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 11.9k
- Forks
- 1.5k
- Avg merge
- 17h 55m
- Merged PRs (30d)
- 3
Description
Base64 filters were added in Liquid 5.1 together with URL safe variants. There seems to be two variants out in the wild, and the question is can/should Liquid support both? base64_url_safe_decode supports both. base64_url_safe_encode does not.
- Ruby's implementation swaps
+and/only - Microsoft's implementations (Microsoft.IdentityModel.Tokens, System.Buffers.Text of .NET9) also remove the
=padding.
The pad character "=" is typically percent-encoded when used in an URI, but if the data length is known implicitly, this can be avoided by skipping the padding
Mozilla defines it as
A common variant is "Base64 URL safe", which omits the padding and replaces +/
Related to dotliquid#542
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the existing base64_url_safe_encode and base64_url_safe_decode filter implementations, then compare their behavior with RFC 4648 and the Ruby and Microsoft variants described in the issue. Determine whether both padding conventions should be supported, and add tests showing the expected encoding and decoding behavior when the decision is made.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100