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

selfservice: Form BodyParser should assert types using JSON Schema #109

Closed
aeneasr opened this issue Nov 5, 2019 · 0 comments · Fixed by #116
Closed

selfservice: Form BodyParser should assert types using JSON Schema #109

aeneasr opened this issue Nov 5, 2019 · 0 comments · Fixed by #116
Assignees
Labels
bug Something is not working. help wanted We are looking for help on this one. package/selfservice Affects selfservice components

Comments

@aeneasr
Copy link
Member

aeneasr commented Nov 5, 2019

Describe the bug

At the moment, selfservice.BodyParser assert types based on possible conversion. "true" is always converted to true, "12345" always to 12345. This doesn't make sense because users might use a random number as their e.g. name (due to laziness or privacy reasons). Instead of asserting based on user input, we need to assert types based on the JSON Schema for that identity.

Reproducing the bug

Steps to reproduce the behavior:

  1. Create a JSON Schema that accepts a string as a trait
  2. Send form data containing only numbers for that trait

Expected behavior

The types should be set correctly and the JSON Schema should be used as a source of truth, not the user input.

Additional context

Follow up to #98

If you wish to tackle this please comment here.

@aeneasr aeneasr added bug Something is not working. help wanted We are looking for help on this one. package/selfservice Affects selfservice components labels Nov 5, 2019
@aeneasr aeneasr modified the milestones: v0.0.2, v0.0.1 Nov 5, 2019
@aeneasr aeneasr self-assigned this Nov 6, 2019
aeneasr added a commit that referenced this issue Nov 9, 2019
aeneasr added a commit that referenced this issue Nov 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is not working. help wanted We are looking for help on this one. package/selfservice Affects selfservice components
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant