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

Provide secure way of testing #77

Closed
Nopik opened this issue Sep 11, 2013 · 1 comment
Closed

Provide secure way of testing #77

Nopik opened this issue Sep 11, 2013 · 1 comment

Comments

@Nopik
Copy link

Nopik commented Sep 11, 2013

Currently there is quite a logic trying to figure out the incoming data. So, if one calls validate() without :json => true, and incoming data is not in valid format, validator tries very much to match the data. And does to e.g. by opening files from local hard drive.

If that is not desired, the only way to prevent such behavior is to call :json => true, which, unfortunately means, that in-memory structures need to be serialized to json first.

So, if I have some object of unknown type (which my happen to be "/etc/passwd" string), and I want to securely test it, currently I need to convert it to json, and json-parse it again in validator.

I'd like to have 'dumb' validate method, which do not have any fallbacks, if object does not match, it does not match, do not fallback. I.e. in https://github.com/hoxworth/json-schema/blob/master/lib/json-schema/validator.rb#L629 just be

elsif data.is_a?(String) && @options[ :literal_strings ] != true

kind of option.

@pd
Copy link
Contributor

pd commented Oct 30, 2014

A lot of discussion is happening around this feature; see #148. I'm going to close this just to try to keep discussion centralized. Feel free to chime in. =)

@pd pd closed this as completed Oct 30, 2014
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

No branches or pull requests

2 participants