decentralized-identity / didcomm.org

https://didcomm.org/
Apache License 2.0
37 stars 25 forks source link

Updated v2 context #33

Closed TelegramSam closed 2 years ago

TelegramSam commented 2 years ago

Signed-off-by: Sam Curren telegramsam@gmail.com

TelegramSam commented 2 years ago

need review by @OR13

OR13 commented 2 years ago

https://v.jsld.org and some testing can resolve this.

OR13 commented 2 years ago

@TelegramSam does this look correct?

https://v.jsld.org/a5yy9gGBiHRPaBJY33DgjmSwAtH4JpJaVq6raUW2qaANVWcPqzF4QcrnMaL7b5S7Efhn31N9hgYPWKZasF6Eeswkp5xs9i5PbLGdYeaUFf2Tr7vZ1jXBTzvHDuEyC33vv1sVJME3frxhfY2epKAxVtnV5PhLzWW9Cg8uXSLXU89uDm2qdrFYnCACnk3bk4kXpMZ2fV8jspd4VDb3DLDxmEPqFcpWcemWyrxNXkXAaJoPGphFeRaouSSyhPbkrX1cfSRMiQaW4coioUWrAL57VoqPwXjtsjK5dynFeYyKY9rtiMdLYFEknP9PgCVrFpvy5qzfuG54CF5eMDpgo2E4mYcvnLdWSTMBSEVa7nuaHuyEn8ha3x623q6TZbdtMcg5eSTCr4VkoJzFj2HT6NWecuQtGQeFhADaNJT6mCHBBumkTJiAh2ezCw6aJf2GzcW2c8ETSkgRfZnRgy5yduYEDzdsTLsZ2Z933ME5KPhZiVuaqbLaUgGpxbxpyrav3QK4NKTsztyTFVP

OR13 commented 2 years ago

your edits are not parseable json.... You can use this to clean them up:

https://v.jsld.org/a5yy9gGBiHRPaBJY33DgjmSwAtH4JpJaVq6raUW2qaANVWcPqzF4QcrnMaL7b5S7Efhn31N9hgYPWKZasF6Eeswkp5xs9i5PbLGdYeaUFf2Tr7vZ1jXBTzvHDuEyC33vv1sVJME3frxhfY2epKAxVtnV5PhLzWW9Cg8uXSLXU89uDm2qdrFYnCACnk3bk4kXpMZ2fV8jspd4VDb3DLDxmEPqFcpWcemWyrxNXkXAaJoPGphFeRaouSSyhPbkrX1cfSRMiQaW4coioUWrAL57VoqPwXjtsjK5dynFeYyKY9rtiMdLYFEknP9PgCVrFpvy5qzfuG54CF5eMDpgo2E4mYcvnLdWSTMBSEVa7nuaHuyEn8ha3x623q6TZbdtMcg5eSTCr4VkoJzFj2HT6NWecuQtGQeFhADaNJT6mCHBBumkTJiAh2ezCw6aJf2GzcW2c8ETSkgRfZnRgy5yduYEDzdsTLsZ2Z933ME5KPhZiVuaqbLaUgGpxbxpyrav3QK4NKTsztyTFVP

brianorwhatever commented 2 years ago

I tried to get this sorted but am still missing something.. json-ld playground complains that my serviceEndpoint is redefining a protected term so I'm not sure how to specify what attributes are allowed on a term when it's protected..

work so far https://json-ld.org/playground/#startTab=tab-expanded&json-ld=%7B%22%40context%22%3A%5B%22https%3A%2F%2Fwww.w3.org%2Fns%2Fdid%2Fv1%22%2C%22https%3A%2F%2Fw3id.org%2Fsecurity%2Fsuites%2Fjws-2020%2Fv1%22%2C%7B%22%40version%22%3A1.1%2C%22%40protected%22%3Atrue%2C%22DIDCommMessaging%22%3A%7B%22%40id%22%3A%22https%3A%2F%2Fdidcomm.org%2Fmessaging%2Fv2%2F%23DIDCommMessaging%22%2C%22%40context%22%3A%7B%22serviceEndpoint%22%3A%7B%22%40id%22%3A%22https%3A%2F%2Fwww.w3.org%2Fns%2Fdid%23serviceEndpoint%22%2C%22%40context%22%3A%7B%22uri%22%3A%22https%3A%2F%2Fdidcomm.org%2Fmessaging%2Fv2%2F%23uri%22%2C%22accept%22%3A%22https%3A%2F%2Fdidcomm.org%2Fmessaging%2Fv2%2F%23accept%22%2C%22routingKeys%22%3A%22https%3A%2F%2Fdidcomm.org%2Fmessaging%2Fv2%2F%23routingKeys%22%7D%7D%7D%7D%7D%5D%2C%22id%22%3A%22did%3Aexample%3Aissuer%22%2C%22verificationMethod%22%3A%5B%7B%22controller%22%3A%22did%3Aexample%3Aissuer%22%2C%22id%22%3A%22did%3Aexample%3Aissuer%23key1%22%2C%22publicKeyJwk%22%3A%7B%22kty%22%3A%22EC%22%2C%22crv%22%3A%22P-256%22%2C%22x%22%3A%22IAY6G0xR4kcVkc_KrIyPb1a50qMCMjHPjVfUunrVGvs%22%2C%22y%22%3A%22qzOw6AnovPqnYn2l6MdEBYfVMPNEQTpMxrlcKRDenCk%22%7D%2C%22type%22%3A%22JsonWebKey2020%22%7D%5D%2C%22service%22%3A%5B%7B%22id%22%3A%22did%3Aexample%3Aissuer%23didcomm%22%2C%22serviceEndpoint%22%3A%7B%22uri%22%3A%22https%3A%2F%2Fexample.com%2Fissuer%22%2C%22accept%22%3A%5B%22ok%22%2C%22ok2%22%5D%7D%2C%22type%22%3A%22DIDCommMessaging%22%7D%5D%2C%22assertionMethod%22%3A%5B%22did%3Aexample%3Aissuer%23key1%22%5D%2C%22keyAgreement%22%3A%5B%22did%3Aexample%3Aissuer%23key1%22%5D%7D

brianorwhatever commented 2 years ago

I took another stab at it but am still just mostly guessing. The tools don't like when I try to redefine the protected "serviceEndpoint" term. This is my latest however Orie's tool explodes on a "termType" error

https://v.jsld.org/a5yy9gGBiHRPaBJY33DgjmSwAtH4JpJaVq6raUW2qaANVWcPqzF4QcrnMaL7b5S7Efhn31N9hgYPWKZasF6Eeswkp5xs9i5PbLGdYeaUFf2Tr7vZ1jXBTzvHDuEyC33vv1sVJME3frxhfY2epKAxVtnV5PhLzWW9Cg8uXSLXU89uDm2qdrFYnCACnk3bk4kXpMZ2fV8jspd4VDb3DLDxmEPqFcpWcemWyrxNXkXAaJoPGphFeRaouSSyhPbkrX1cfSRMiQaW4coioUWrAL57VoqPwXjtsjK5dynFeYyKY9rtiMdLYFEknP9PgCVrFpvy5qzfuG54CF5eMDpgo2E4mYcvnLdWSTMBSEVa7nuaHuyEn8ha3x623q6TZbdtMcg5eSTCr4VkoJzFj2HT6NWecuQtGQeFhADaNJT6mCHBBumkTJiAh2ezCw6aJf2GzcW2c8ETSkgRfZnRgy5yduYEDzdsTLsZ2Z933ME5KPhZiVuaqbLaUgGpxbxpyrav3QK4NKTsztyTFVP

brianorwhatever commented 2 years ago

I think we are having issues trying to turn this context file into validation of the schema as normatively defined in the spec. After looking over a number of context files they rarely do things like add "@list" containers. I propose we keep this context simple with just semantics and leave spec validation to implementing libraries. Here is a simple didcomm service schema:

{
      "@version": 1.1,
      "id": "@id",
      "type": "@type",
      "DIDCommMessaging": "https://didcomm.org/messaging/v2#DIDCommMessaging",
      "uri": "https://didcomm.org/messaging/v2#uri",
      "accept": "https://didcomm.org/messaging/v2#accept",
      "routingKeys":  "https://didcomm.org/messaging/v2#routingKeys"                
}
TelegramSam commented 2 years ago

I think we are having issues trying to turn this context file into validation of the schema as normatively defined in the spec. After looking over a number of context files they rarely do things like add "@list" containers.

@brianorwhatever I really dislike your conclusion, but I think you might be right. This is an unfortunate conclusion for the world of JSON-LD.

dhh1128 commented 2 years ago

Note: reviewed (positively) by DIDComm WG on 2022-05-30. WG votes "merge."