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

Validate base64 URI safe strings #1746

Closed
tswindell opened this issue Mar 9, 2019 · 1 comment
Closed

Validate base64 URI safe strings #1746

tswindell opened this issue Mar 9, 2019 · 1 comment
Assignees
Labels
feature New functionality or improvement
Milestone

Comments

@tswindell
Copy link

Context

  • node v10.15.3
  • joi 14.3.1
  • node
  • express

What are you trying to achieve or the steps to reproduce ?

I'm attempting to validate a Base64 encoded string in the URL/Filename Safe profile. The spec defines this as:

NOTE: In the URL and Filename safe variant, character 62 (0x3E) is replaced with a "-" (minus sign) and character 63 (0x3F) is replaced with a "_" (underscore).
const schema = Joi.string().base64({paddingRequired: false}).validate('BMGzZagVwSz0WQl3DLrvdWI1HSNS9bO5kTp8tQf2ldEexg_sYGOQoi7hz7Uc0PUHRoCkHAjrTke5eY2H9beUYPI')

Which result you had ?

Validation Fails

What did you expect ?

Validation Should Succeed

@Marsup Marsup added the request label Apr 12, 2019
@Marsup
Copy link
Collaborator

Marsup commented Apr 12, 2019

I'm going to qualify this as a request rather than a bug. You're asking for a variant of b64, that would likely require a new flag because not everyone wants that.

@hueniverse hueniverse added this to the 16.0.0 milestone Jun 1, 2019
@hueniverse hueniverse self-assigned this Jun 1, 2019
@hueniverse hueniverse added feature New functionality or improvement and removed request labels Jun 2, 2019
@hueniverse hueniverse changed the title Base64 URI safe strings not validated. Validate base64 URI safe strings Aug 10, 2019
@hueniverse hueniverse added the v16 label Aug 10, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Feb 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature New functionality or improvement
Projects
None yet
Development

No branches or pull requests

3 participants