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

Error on complex JSON objects as literals #3

Open
peacekeeper opened this issue Sep 30, 2014 · 1 comment
Open

Error on complex JSON objects as literals #3

peacekeeper opened this issue Sep 30, 2014 · 1 comment
Assignees
Labels

Comments

@peacekeeper
Copy link
Member

The Graph implementation seems to have problems if the value of an XDI literal is a complex JSON object, e.g. a serialized XDI message.

Example: Sending the following message:

([=]!:uuid:1111[$msg]!:uuid:1234$do/$set)[=]!:uuid:1111[$card]!:uuid:5678$public<#connect><#button>&/&/{"[=]!:uuid:1111[$msg]@0<$sig>&/&":".....","[=]!:uuid:1111[$msg]@0<$sig>/$is#":["$sha$256$rsa$2048"],"[=]!:uuid:1111[$msg]@0$do/$set":["[=]!:uuid:1111[$card]!:uuid:5678"],"[=]!:uuid:1111[$msg]@0$do/$is{$do}":["+respect#forever{$do}"],"[=]!:uuid:1111[$msg]@0{$card}/$is":["[=]!:uuid:1111[$card]!:uuid:5678"],"[=]!:uuid:1111[$msg]@0/$is()":["({$to})"],"[=]!:uuid:1111[$msg]@0/$do":["(=bob/+ca)+ca#community$do"]}

will result in the following error:

Error message result (check server logs!): { "serverUsed" : "localhost/127.0.0.1:27017" , "err" : "not okForStorage" , "code" : 12527 , "n" : 0 , "connectionId" : 2 , "ok" : 1.0}

Perhaps certain characters are not properly escaped when handing them off to the MongoDB driver.

@peacekeeper peacekeeper self-assigned this Sep 30, 2014
@peacekeeper peacekeeper changed the title Error on complex JSON values as literals Error on complex JSON objects as literals Sep 30, 2014
@peacekeeper
Copy link
Member Author

Update: This seems to be caused by the fact that MongoDB does not allow $ and . characters in field names. We will have to either escape those characters, or Base64-encode the entire JSON object.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant