From def6d9791f1bac19e85366a8493c036b49c888f4 Mon Sep 17 00:00:00 2001 From: Oleg Lomaka Date: Wed, 12 Jul 2023 09:54:10 -0400 Subject: [PATCH 1/2] if selective disclosure field name is a dot-separated path, create nested object from it --- inputs_sig.go | 13 +++ inputs_sig_test.go | 44 +++++++++ ...c_query_mtp_v2_on_chain_status_output.json | 2 +- ...v2_nested_selective_disclosure_inputs.json | 97 +++++++++++++++++++ ...v2_nested_selective_disclosure_output.json | 1 + testdata/httpresp_iden3proofs.jsonld | 25 ++--- testdata/httpresp_rev_status_214490175.json | 1 + testdata/httpresp_rev_status_2575161389.json | 1 + ...4WQogfhqpi6j8S8XTmZdmg7hpaVr4eGynW.json-ld | 1 + 9 files changed, 172 insertions(+), 13 deletions(-) create mode 100644 testdata/atomic_query_sig_v2_nested_selective_disclosure_inputs.json create mode 100644 testdata/atomic_query_sig_v2_nested_selective_disclosure_output.json create mode 100644 testdata/httpresp_rev_status_214490175.json create mode 100644 testdata/httpresp_rev_status_2575161389.json create mode 100644 testdata/ipfs_QmcAJCriUKiU4WQogfhqpi6j8S8XTmZdmg7hpaVr4eGynW.json-ld diff --git a/inputs_sig.go b/inputs_sig.go index 525084f..8f940f3 100644 --- a/inputs_sig.go +++ b/inputs_sig.go @@ -493,6 +493,16 @@ func verifiablePresentationFromCred(ctx context.Context, return } +func mkVPObj(field string, value any) (string, any) { + idx := strings.Index(field, ".") + if idx == -1 { + return field, value + } + + nestedField, value := mkVPObj(field[idx+1:], value) + return field[:idx], map[string]any{nestedField: value} +} + func fmtVerifiablePresentation(context string, tp string, field string, value any) map[string]any { @@ -510,6 +520,9 @@ func fmtVerifiablePresentation(context string, tp string, field string, vcTypes = append(vcTypes, tp) } + // if field name is a dot-separated path, create nested object from it. + field, value = mkVPObj(field, value) + return map[string]any{ "@context": baseContext, "@type": "VerifiablePresentation", diff --git a/inputs_sig_test.go b/inputs_sig_test.go index 86cf6bf..912d745 100644 --- a/inputs_sig_test.go +++ b/inputs_sig_test.go @@ -536,6 +536,50 @@ func TestPrepareInputs(t *testing.T) { "", AtomicQuerySigV2InputsFromJson, nil, cfg, "credential is revoked") }) + + t.Run("AtomicQuerySigV2InputsFromJson Nested Disclosure", func(t *testing.T) { + + ipfsURL := os.Getenv("IPFS_URL") + if ipfsURL == "" { + t.Skip("IPFS_URL is not set") + } + + cid := uploadIPFSFile(t, ipfsURL, "testdata/ipfs_QmcAJCriUKiU4WQogfhqpi6j8S8XTmZdmg7hpaVr4eGynW.json-ld") + // CID should correspond to the URL + require.Equal(t, "QmcAJCriUKiU4WQogfhqpi6j8S8XTmZdmg7hpaVr4eGynW", cid) + + defer mockHttpClient(t, map[string]string{ + "https://www.w3.org/2018/credentials/v1": "testdata/httpresp_credentials_v1.json", + "https://dev.polygonid.me/api/v1/identities/did%3Apolygonid%3Apolygon%3Amumbai%3A2qLPqvayNQz9TA2r5VPxUugoF18teGU583zJ859wfy/claims/revocation/status/214490175": "testdata/httpresp_rev_status_214490175.json", + "https://dev.polygonid.me/api/v1/identities/did%3Apolygonid%3Apolygon%3Amumbai%3A2qLPqvayNQz9TA2r5VPxUugoF18teGU583zJ859wfy/claims/revocation/status/2575161389": "testdata/httpresp_rev_status_2575161389.json", + "https://schema.iden3.io/core/jsonld/iden3proofs.jsonld": "testdata/httpresp_iden3proofs.jsonld", + })() + + wantVerifiablePresentation := map[string]any{ + "@context": []any{"https://www.w3.org/2018/credentials/v1"}, + "@type": "VerifiablePresentation", + "verifiableCredential": map[string]any{ + "@context": []any{ + "https://www.w3.org/2018/credentials/v1", + "ipfs://QmcAJCriUKiU4WQogfhqpi6j8S8XTmZdmg7hpaVr4eGynW", + }, + "@type": []any{"VerifiableCredential", "DeliveryAddress"}, + "credentialSubject": map[string]any{ + "@type": "DeliveryAddress", + "postalProviderInformation": map[string]any{ + "address1": map[string]any{ + "name": "addressName", + }, + }, + }, + }, + } + + doTest(t, "atomic_query_sig_v2_nested_selective_disclosure_inputs.json", + "atomic_query_sig_v2_nested_selective_disclosure_output.json", + AtomicQuerySigV2InputsFromJson, wantVerifiablePresentation, + EnvConfig{IPFSNodeURL: ipfsURL}, "") + }) } func TestEnvConfig_UnmarshalJSON(t *testing.T) { diff --git a/testdata/atomic_query_mtp_v2_on_chain_status_output.json b/testdata/atomic_query_mtp_v2_on_chain_status_output.json index 4692958..4db5480 100644 --- a/testdata/atomic_query_mtp_v2_on_chain_status_output.json +++ b/testdata/atomic_query_mtp_v2_on_chain_status_output.json @@ -1 +1 @@ -{"requestID":"1","userGenesisID":"21889130108254823615772876373128037217273062530127827364430428043065561602","profileNonce":"0","claimSubjectProfileNonce":"0","issuerID":"15581991792744269396064499510702144339217099104593719362405988930886308354","issuerClaim":["14559690932601973492667815902177586678096","21889130108254823615772876373128037217273062530127827364430428043065561602","15697636742427174942378579399424652827970443118166160513092687461470682485670","0","34928098246829792765314585820","0","0","0"],"issuerClaimMtp":["10660818590108639428871982872591489586183290725077275050593284687717172079964","19004583404027319386260877934866626052185781987882873664881072886791630045709","7688551737818240300462500951153481472047294955944044944287841608520632560800","17769487165855930261808351867030953601566316638365313132919095596635885953664","5161693871597286563237588861621057258574279578037312916501715191991470717054","0","0","13324322751273822110620689916704453645987815620794505188533106956429795192902","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"issuerClaimClaimsTreeRoot":"15815313521304851418109067406329464655146418617011377781665616752769897127623","issuerClaimRevTreeRoot":"11962371738883302451524073240861657820349762867024192047397723064194456442418","issuerClaimRootsTreeRoot":"784112478200635040281186990104584409460466157583484839862858223721265258518","issuerClaimIdenState":"20792792603493945806129151122571708658758527512006564312672633241149756273094","issuerClaimNonRevClaimsTreeRoot":"5769420190957475207645102914228801838856588013032559096759080697894420395339","issuerClaimNonRevRevTreeRoot":"11962371738883302451524073240861657820349762867024192047397723064194456442418","issuerClaimNonRevRootsTreeRoot":"19366998096494315454647646959772577850327490978723945038065377546216608821866","issuerClaimNonRevState":"17965448550532712274287845555480752152272481042513305139308272327671568240820","issuerClaimNonRevMtp":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"issuerClaimNonRevMtpAuxHi":"2427988165","issuerClaimNonRevMtpAuxHv":"0","issuerClaimNonRevMtpNoAux":"0","isRevocationChecked":1,"claimSchema":"267831521922558027206082390043321796944","claimPathNotExists":0,"claimPathMtp":["16534428042297633750175000595232097716970128921344508808444542188109524671092","20136408412065421871169513346531928107929237932885840151844569675458908229318","16506659259489187604743512498132257380255841690580446590907927947486131590921","0","21618960417349819791327026112686919154102464675974390953288772823522767060833","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"claimPathMtpNoAux":"0","claimPathMtpAuxHi":"0","claimPathMtpAuxHv":"0","claimPathKey":"20376033832371109177683048456014525905119173674985843915445634726167450989630","claimPathValue":"19960424","operator":1,"slotIndex":0,"timestamp":1687645152,"value":["19960424","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"]} \ No newline at end of file +{"requestID":"1","userGenesisID":"21889130108254823615772876373128037217273062530127827364430428043065561602","profileNonce":"0","claimSubjectProfileNonce":"0","issuerID":"15581991792744269396064499510702144339217099104593719362405988930886308354","issuerClaim":["14559690932601973492667815902177586678096","21889130108254823615772876373128037217273062530127827364430428043065561602","15697636742427174942378579399424652827970443118166160513092687461470682485670","0","34928098246829792765314585820","0","0","0"],"issuerClaimMtp":["10660818590108639428871982872591489586183290725077275050593284687717172079964","19004583404027319386260877934866626052185781987882873664881072886791630045709","7688551737818240300462500951153481472047294955944044944287841608520632560800","17769487165855930261808351867030953601566316638365313132919095596635885953664","5161693871597286563237588861621057258574279578037312916501715191991470717054","0","0","13324322751273822110620689916704453645987815620794505188533106956429795192902","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"issuerClaimClaimsTreeRoot":"15815313521304851418109067406329464655146418617011377781665616752769897127623","issuerClaimRevTreeRoot":"11962371738883302451524073240861657820349762867024192047397723064194456442418","issuerClaimRootsTreeRoot":"784112478200635040281186990104584409460466157583484839862858223721265258518","issuerClaimIdenState":"20792792603493945806129151122571708658758527512006564312672633241149756273094","issuerClaimNonRevClaimsTreeRoot":"5769420190957475207645102914228801838856588013032559096759080697894420395339","issuerClaimNonRevRevTreeRoot":"11962371738883302451524073240861657820349762867024192047397723064194456442418","issuerClaimNonRevRootsTreeRoot":"19366998096494315454647646959772577850327490978723945038065377546216608821866","issuerClaimNonRevState":"17965448550532712274287845555480752152272481042513305139308272327671568240820","issuerClaimNonRevMtp":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"issuerClaimNonRevMtpAuxHi":"2427988165","issuerClaimNonRevMtpAuxHv":"0","issuerClaimNonRevMtpNoAux":"0","isRevocationChecked":1,"claimSchema":"267831521922558027206082390043321796944","claimPathNotExists":0,"claimPathMtp":["16534428042297633750175000595232097716970128921344508808444542188109524671092","12073640998350984734151051363345371934379331094683260764481179727743582419200","4152566071195257884814206217928869294080907926700402283006563196412405035501","0","21618960417349819791327026112686919154102464675974390953288772823522767060833","0","0","0","598337659919446409842087827958890174831314627207995246981557068766765928775","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"claimPathMtpNoAux":"0","claimPathMtpAuxHi":"0","claimPathMtpAuxHv":"0","claimPathKey":"20376033832371109177683048456014525905119173674985843915445634726167450989630","claimPathValue":"19960424","operator":1,"slotIndex":0,"timestamp":1689169530,"value":["19960424","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"]} diff --git a/testdata/atomic_query_sig_v2_nested_selective_disclosure_inputs.json b/testdata/atomic_query_sig_v2_nested_selective_disclosure_inputs.json new file mode 100644 index 0000000..f4b5445 --- /dev/null +++ b/testdata/atomic_query_sig_v2_nested_selective_disclosure_inputs.json @@ -0,0 +1,97 @@ +{ + "id": "2qMELfwwoRkhwjNh4qbZekm7rFddwWb2rTcHYkCh63", + "profileNonce": "123", + "claimSubjectProfileNonce": "234", + "verifiableCredentials": { + "id": "https://dev.polygonid.me/api/v1/identities/did:polygonid:polygon:mumbai:2qLPqvayNQz9TA2r5VPxUugoF18teGU583zJ859wfy/claims/9b401f13-20b1-11ee-9b72-0242ac1d0007", + "@context": [ + "https://www.w3.org/2018/credentials/v1", + "https://schema.iden3.io/core/jsonld/iden3proofs.jsonld", + "ipfs://QmcAJCriUKiU4WQogfhqpi6j8S8XTmZdmg7hpaVr4eGynW" + ], + "type": [ + "VerifiableCredential", + "DeliveryAddress" + ], + "expirationDate": "2030-01-07T00:00:00Z", + "issuanceDate": "2023-07-12T12:42:48.103469079Z", + "credentialSubject": { + "deliveryTime": "2022-02-02T00:00:00Z", + "homeAddress": { + "line1": "l1", + "line2": "l2" + }, + "id": "did:polygonid:polygon:mumbai:2qMELfwwoRkhwjNh4qbZekm7rFddwWb2rTcHYkCh63", + "isPostalProvider": true, + "postalProviderInformation": { + "address1": { + "name": "addressName" + }, + "name": "n1", + "officeNo": 123 + }, + "price": 3.1, + "type": "DeliveryAddress" + }, + "credentialStatus": { + "id": "https://dev.polygonid.me/api/v1/identities/did%3Apolygonid%3Apolygon%3Amumbai%3A2qLPqvayNQz9TA2r5VPxUugoF18teGU583zJ859wfy/claims/revocation/status/214490175", + "revocationNonce": 214490175, + "type": "SparseMerkleTreeProof" + }, + "issuer": "did:polygonid:polygon:mumbai:2qLPqvayNQz9TA2r5VPxUugoF18teGU583zJ859wfy", + "credentialSchema": { + "id": "ipfs://QmX1aAdypawZoVXZ2YT8fHgapeRtDhnP96vPg2Btoe1Ujz", + "type": "JsonSchema2023" + }, + "proof": [ + { + "type": "BJJSignature2021", + "issuerData": { + "id": "did:polygonid:polygon:mumbai:2qLPqvayNQz9TA2r5VPxUugoF18teGU583zJ859wfy", + "state": { + "txId": "0xde8c8e234e9e4c159b9ce6361234c15eaaa123bddf15f395489a75e634e11182", + "blockTimestamp": 1683792462, + "blockNumber": 35452981, + "rootOfRoots": "03beaa14074a91698084d2dc077067babb8334584a7d73a047e6b238341b581d", + "claimsTreeRoot": "a5faef8b1fc67f65c55ad667919e51abfed008ca97475c41b26a5e70fd4c4a0a", + "revocationTreeRoot": "0000000000000000000000000000000000000000000000000000000000000000", + "value": "5ab768f8f2ec3f94e6830908fbf428ca3386ff87a5e704fcd1f11cae3420611f" + }, + "authCoreClaim": "cca3371a6cb1b715004407e325bd993c080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e3b9e422feb1dcf83882b33bddf3c9a64d300e2280e9c286bb75839c824ace27c5560b8ca92be27698a14f6970c32731e73768d74fe83d0fd4f16f14b4402d242dd87d9900000000281cdcdf0200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "mtp": { + "existence": true, + "siblings": [ + "16600125203338042323361216512603158366636445287571403125891881295088432028008", + "11315256355804790111057838658876672619892914293003422319088357823149445991751", + "5953630948937947438067785504646477838099205855387889079750411149043045455341", + "7144700925452824210038939338852356191428773494854012082867969138805603048585", + "3921545027306074721354497759643961758048633515411954472382458013486548057049", + "0", + "0", + "5436254548464410857916946211162171910597645182542037135954554779197265908702" + ] + }, + "credentialStatus": { + "id": "https://dev.polygonid.me/api/v1/identities/did%3Apolygonid%3Apolygon%3Amumbai%3A2qLPqvayNQz9TA2r5VPxUugoF18teGU583zJ859wfy/claims/revocation/status/2575161389", + "revocationNonce": 2575161389, + "type": "SparseMerkleTreeProof" + } + }, + "coreClaim": "2feab48f30556e1d360007ba70de6c0b2a0000000000000000000000000000000212c10920c6b9e7785793a5476724d306bca0d820017ea61b5f6886534a0c002b5c94984280d3e02c5bc84e404894ac2fa978d36d6c5fbb8b169a4e754ef72b00000000000000000000000000000000000000000000000000000000000000003fdcc80c0000000080c1e3700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "signature": "f0bf038137d09c57fe214d74262320137bbb83c83ed827bb7f376d29ac7a441743ee46521e54735fc9e33ece2b1624f3c767a1567f84e011aa02b8c83ba37201" + } + ] + }, + "request": { + "id": 84239, + "circuitId": "credentialAtomicQuerySigV2", + "query": { + "allowedIssuers": "unused", + "context": "ipfs://QmcAJCriUKiU4WQogfhqpi6j8S8XTmZdmg7hpaVr4eGynW", + "type": "DeliveryAddress", + "credentialSubject": { + "postalProviderInformation.address1.name": {} + } + } + } +} diff --git a/testdata/atomic_query_sig_v2_nested_selective_disclosure_output.json b/testdata/atomic_query_sig_v2_nested_selective_disclosure_output.json new file mode 100644 index 0000000..3a876bc --- /dev/null +++ b/testdata/atomic_query_sig_v2_nested_selective_disclosure_output.json @@ -0,0 +1 @@ +{"requestID":"84239","userGenesisID":"21715145837359521933715514511895502047374845187585074005685783165315125762","profileNonce":"123","claimSubjectProfileNonce":"234","issuerID":"22942594156266665426613462771725327314382647426959044863446866613003751938","issuerClaim":["14307046198319830189021749001476556253743","21715145837359521933715514511895502047374845187585074005685783165315125762","19886405212887272255413097588107697207559546546321203245433309161608659098667","0","34937661038957603796397120575","0","0","0"],"issuerClaimNonRevClaimsTreeRoot":"2273017883386303214371303687972676397834901290161619866164194365200553743608","issuerClaimNonRevRevTreeRoot":"20886334301348796748779732232529938054780668195423799235723157520872439548281","issuerClaimNonRevRootsTreeRoot":"12831100563256723258095688566537173268640232986869077257277662735504334139048","issuerClaimNonRevState":"3156341134011552663235425055480181548208096702736185574734553897002545383321","issuerClaimNonRevMtp":["15068099395710279209116088766932267224585678575226717643047729221232916765468","2189070759111494123563493081161468940989812407956040534473128738739860911255","7477205790926779541080640660120305745755434522417143837504559066770052488949","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"issuerClaimNonRevMtpAuxHi":"4136705639","issuerClaimNonRevMtpAuxHv":"0","issuerClaimNonRevMtpNoAux":"0","claimSchema":"15186787640414723560015489342291372591","issuerClaimSignatureR8x":"10450003244126866216196892273805496689430300141271848020719272730442755999530","issuerClaimSignatureR8y":"10524187772347925406661476818307564621153246709294367680347709611682442756080","issuerClaimSignatureS":"654860010397538250500859474929589702562454725713804235343310023326404374083","issuerAuthClaim":["2802810872911077472734549448614968009676","0","18004685840597262513177977764109198106190983513152532833229741162935913593315","16363217233621509147493247026329953659261800857040913370796979771313744467653","227737578863135127232172644397","0","0","0"],"issuerAuthClaimMtp":["16600125203338042323361216512603158366636445287571403125891881295088432028008","11315256355804790111057838658876672619892914293003422319088357823149445991751","5953630948937947438067785504646477838099205855387889079750411149043045455341","7144700925452824210038939338852356191428773494854012082867969138805603048585","3921545027306074721354497759643961758048633515411954472382458013486548057049","0","0","5436254548464410857916946211162171910597645182542037135954554779197265908702","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"issuerAuthClaimNonRevMtp":["15068099395710279209116088766932267224585678575226717643047729221232916765468","12503617142493591559542830210106860642149788086756524276444903023773514357063","15494200977157294465144225269510752380944794946007603451617789527754422425328","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"issuerAuthClaimNonRevMtpAuxHi":"0","issuerAuthClaimNonRevMtpAuxHv":"0","issuerAuthClaimNonRevMtpNoAux":"1","issuerAuthClaimsTreeRoot":"4654406534048944674417006311067465112472974884603602143521678033930482088613","issuerAuthRevTreeRoot":"0","issuerAuthRootsTreeRoot":"13272742905654896452483910063874611565255576170014837106221371541741479050755","isRevocationChecked":1,"claimPathNotExists":0,"claimPathMtp":["2756401501881287459939851604031584574585325012994135273806303908446485628253","21775361197413724229226684499705629957213261514539923323334069982893301189149","2495985945207058213195117170524008247208843076678549066181537608007515894141","0","0","0","20773690219808308743568139423198279465852083475933602111112569109080126125174","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"claimPathMtpNoAux":"0","claimPathMtpAuxHi":"0","claimPathMtpAuxHv":"0","claimPathKey":"2406798944181380033691194242784402730738613510248396192158687726626494205917","claimPathValue":"13526184782216181167557375564702157805009102812029373236610478212247032949768","operator":1,"slotIndex":0,"timestamp":1689169612,"value":["13526184782216181167557375564702157805009102812029373236610478212247032949768","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"]} diff --git a/testdata/httpresp_iden3proofs.jsonld b/testdata/httpresp_iden3proofs.jsonld index 2bc8dd4..286219d 100644 --- a/testdata/httpresp_iden3proofs.jsonld +++ b/testdata/httpresp_iden3proofs.jsonld @@ -19,7 +19,7 @@ "@id": "https://schema.iden3.io/core/jsonld/iden3proofs.jsonld#SparseMerkleTreeProof", "@type": "SparseMerkleTreeProof" }, - "coreClaim": { + "coreClaim": { "@id": "coreClaim", "@type": "xsd:string" }, @@ -82,7 +82,7 @@ "@id": "smt-proof-vocab:existence", "@type": "xsd:boolean" }, - "revocationNonce" : { + "revocationNonce": { "@id": "smt-proof-vocab:revocationNonce", "@type": "xsd:number" }, @@ -113,7 +113,7 @@ "@propagate": true, "type": "@type", "xsd": "http://www.w3.org/2001/XMLSchema#", - "coreClaim": { + "coreClaim": { "@id": "coreClaim", "@type": "xsd:string" }, @@ -228,7 +228,7 @@ "id": "@id", "type": "@type", "iden3-reverse-sparse-merkle-tree-proof-vocab": "https://schema.iden3.io/core/vocab/Iden3ReverseSparseMerkleTreeProof.md#", - "revocationNonce": "iden3-reverse-sparse-merkle-tree-proof-vocab:revocationNonce", + "revocationNonce": "iden3-reverse-sparse-merkle-tree-proof-vocab:revocationNonce", "statusIssuer": { "@context": { "@version": 1.1, @@ -241,14 +241,14 @@ } }, "Iden3commRevocationStatusV1.0": { - "@id": "https://raw.githubusercontent.com/iden3/claim-schema-vocab/main/schemas/json-ld/iden3credential-v2.json-ld#Iden3commRevocationStatusV1.0", + "@id": "https://schema.iden3.io/core/jsonld/iden3proofs.jsonld#Iden3commRevocationStatusV1.0", "@context": { "@version": 1.1, "@protected": true, "id": "@id", "type": "@type", - "iden3-comm-revocation-statusV1.0-vocab": "https://github.com/iden3/claim-schema-vocab/blob/main/proofs/Iden3commRevocationStatusV1.0.md#", - "revocationNonce": "iden3-comm-revocation-statusV1.0-vocab:revocationNonce", + "iden3-comm-revocation-statusV1.0-vocab": "https://schema.iden3.io/core/vocab/Iden3commRevocationStatusV1.0.md#", + "revocationNonce": "iden3-comm-revocation-statusV1.0-vocab:revocationNonce", "statusIssuer": { "@context": { "@version": 1.1, @@ -261,14 +261,14 @@ } }, "Iden3OnchainSparseMerkleTreeProof2023": { - "@id": "https://raw.githubusercontent.com/iden3/claim-schema-vocab/main/schemas/json-ld/iden3credential-v2.json-ld#Iden3OnchainSparseMerkleTreeProof2023", + "@id": "https://schema.iden3.io/core/jsonld/iden3proofs.jsonld#Iden3OnchainSparseMerkleTreeProof2023", "@context": { "@version": 1.1, "@protected": true, "id": "@id", "type": "@type", - "iden3-onchain-sparse-merkle-tree-proof-2023-vocab": "https://github.com/iden3/claim-schema-vocab/blob/main/proofs/Iden3OnchainSparseMerkleTreeProof2023.md#", - "revocationNonce": "iden3-onchain-sparse-merkle-tree-proof-2023-vocab:revocationNonce", + "iden3-onchain-sparse-merkle-tree-proof-2023-vocab": "https://schema.iden3.io/core/vocab/Iden3OnchainSparseMerkleTreeProof2023.md#", + "revocationNonce": "iden3-onchain-sparse-merkle-tree-proof-2023-vocab:revocationNonce", "statusIssuer": { "@context": { "@version": 1.1, @@ -279,6 +279,7 @@ "@id": "iden3-onchain-sparse-merkle-tree-proof-2023-vocab:statusIssuer" } } - } + }, + "JsonSchema2023": "https://www.w3.org/ns/credentials#JsonSchema2023" } -} \ No newline at end of file +} diff --git a/testdata/httpresp_rev_status_214490175.json b/testdata/httpresp_rev_status_214490175.json new file mode 100644 index 0000000..0a9a8d9 --- /dev/null +++ b/testdata/httpresp_rev_status_214490175.json @@ -0,0 +1 @@ +{"issuer":{"state":"99075793163d70b148276c7151004cf3f945f4233693f1dc5929bc7aff6cfa06","rootOfRoots":"a82eb41efa5b582a353a726a514628d9e640d1133651d485f4980f4b43255e1c","claimsTreeRoot":"f81404c8a1652a56b98185b14c0ddb296eb808212164c956fda70423877b0605","revocationTreeRoot":"7909c4d1fe5341f3d0672f31424b47d967a24e137f9ad7b4be4d0b8f0c3f2d2e"},"mtp":{"existence":false,"siblings":["15068099395710279209116088766932267224585678575226717643047729221232916765468","2189070759111494123563493081161468940989812407956040534473128738739860911255","7477205790926779541080640660120305745755434522417143837504559066770052488949"],"node_aux":{"key":"4136705639","value":"0"}}} diff --git a/testdata/httpresp_rev_status_2575161389.json b/testdata/httpresp_rev_status_2575161389.json new file mode 100644 index 0000000..0d3cc74 --- /dev/null +++ b/testdata/httpresp_rev_status_2575161389.json @@ -0,0 +1 @@ +{"issuer":{"state":"99075793163d70b148276c7151004cf3f945f4233693f1dc5929bc7aff6cfa06","rootOfRoots":"a82eb41efa5b582a353a726a514628d9e640d1133651d485f4980f4b43255e1c","claimsTreeRoot":"f81404c8a1652a56b98185b14c0ddb296eb808212164c956fda70423877b0605","revocationTreeRoot":"7909c4d1fe5341f3d0672f31424b47d967a24e137f9ad7b4be4d0b8f0c3f2d2e"},"mtp":{"existence":false,"siblings":["15068099395710279209116088766932267224585678575226717643047729221232916765468","12503617142493591559542830210106860642149788086756524276444903023773514357063","15494200977157294465144225269510752380944794946007603451617789527754422425328"]}} diff --git a/testdata/ipfs_QmcAJCriUKiU4WQogfhqpi6j8S8XTmZdmg7hpaVr4eGynW.json-ld b/testdata/ipfs_QmcAJCriUKiU4WQogfhqpi6j8S8XTmZdmg7hpaVr4eGynW.json-ld new file mode 100644 index 0000000..4c1f38c --- /dev/null +++ b/testdata/ipfs_QmcAJCriUKiU4WQogfhqpi6j8S8XTmZdmg7hpaVr4eGynW.json-ld @@ -0,0 +1 @@ +{"@context":[{"@protected":true,"@version":1.1,"id":"@id","type":"@type","DeliveryAddress":{"@context":{"@propagate":true,"@protected":true,"polygon-vocab":"urn:uuid:cc69bf13-8081-41d3-a74a-fc73261c6d36#","xsd":"http://www.w3.org/2001/XMLSchema#","price":{"@id":"polygon-vocab:price","@type":"xsd:double"},"deliveryTime":{"@id":"polygon-vocab:deliveryTime","@type":"xsd:dateTime"},"isPostalProvider":{"@id":"polygon-vocab:isPostalProvider","@type":"xsd:boolean"},"postalProviderInformation":{"@context":{"address1":{"@context":{"name":{"@id":"polygon-vocab:name","@type":"xsd:string"}},"@id":"polygon-vocab:address1"},"name":{"@id":"polygon-vocab:name","@type":"xsd:string"},"officeNo":{"@id":"polygon-vocab:officeNo","@type":"xsd:integer"}},"@id":"polygon-vocab:postalProviderInformation"},"homeAddress":{"@context":{"line2":{"@id":"polygon-vocab:line2","@type":"xsd:string"},"line1":{"@id":"polygon-vocab:line1","@type":"xsd:string"}},"@id":"polygon-vocab:homeAddress"}},"@id":"urn:uuid:b02d811b-0f4d-4f54-b7bf-818affdd7f29"}}]} \ No newline at end of file From 4b08958ae6716522c02b8b19b2acc2d14ff7d10d Mon Sep 17 00:00:00 2001 From: Oleg Lomaka Date: Wed, 12 Jul 2023 10:38:25 -0400 Subject: [PATCH 2/2] setup IPFS_URL for tests --- .github/workflows/tests.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 114acb7..e2ec74b 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -15,6 +15,8 @@ jobs: - 1.20.3-bullseye runs-on: ubuntu-20.04 container: golang:${{ matrix.containers }} + env: + IPFS_URL: ${{secrets.IPFS_URL }} steps: - uses: actions/checkout@v3 - uses: actions/cache@v3