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

REST API cannot reliably distinguish strings from record ids #2243

Closed
phpnode opened this issue Apr 16, 2014 · 1 comment
Closed

REST API cannot reliably distinguish strings from record ids #2243

phpnode opened this issue Apr 16, 2014 · 1 comment
Assignees
Milestone

Comments

@phpnode
Copy link
Contributor

phpnode commented Apr 16, 2014

The REST API represents record ids as strings, like "#12:10". This means that I cannot take an arbitrary record and determine which fields are strings and which are links.

For example, let's assume a user enters the string "#12:10" in a field called name and the record is saved. If I later load that record, and if it's schemaless or if I don't have access to the schema, I cannot tell whether that field is a string or a link to another record. If I do something like looking for strings which match a record ID pattern, I can end up in a situation where:

  1. Certain magic strings can break my application, e.g. by returning an object where a string is expected.
  2. Malicious users can manipulate my application into revealing records they should not have access to.

After some discussion we fixed this in oriento by using specialist record id objects.

Fixing this in the current rest API implementation would be a very significant breaking change. Perhaps the solution would be to adopt a standardized JSON format, such as JSON-LD which can accurately express linked document graphs. This new API could then be accessed by content negotiation, asking for the application/ld+json content type.

@lvca
Copy link
Member

lvca commented Jan 8, 2015

Fixed in #3313

@lvca lvca closed this as completed Jan 8, 2015
@lvca lvca added this to the 2.0 Final milestone Jan 8, 2015
@lvca lvca self-assigned this Jan 8, 2015
@lvca lvca modified the milestones: 2.0 Final, 2.0-rc2 Jan 12, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants