github.com/hyperledger/aries-framework-go@v0.3.2/pkg/doc/didconfig/interop_test.go (about) 1 /* 2 Copyright SecureKey Technologies Inc. All Rights Reserved. 3 4 SPDX-License-Identifier: Apache-2.0 5 */ 6 7 package didconfig 8 9 import ( 10 "encoding/json" 11 "net/http" 12 "net/http/httptest" 13 "testing" 14 15 "github.com/stretchr/testify/require" 16 17 "github.com/hyperledger/aries-framework-go/pkg/doc/did" 18 "github.com/hyperledger/aries-framework-go/pkg/doc/ldcontext" 19 "github.com/hyperledger/aries-framework-go/pkg/internal/ldtestutil" 20 "github.com/hyperledger/aries-framework-go/pkg/vdr" 21 "github.com/hyperledger/aries-framework-go/pkg/vdr/httpbinding" 22 ) 23 24 func TestInterop(t *testing.T) { 25 loader, err := ldtestutil.DocumentLoader( 26 ldcontext.Document{ 27 URL: ContextV1, 28 Content: json.RawMessage(didCfgCtxV1), 29 }, 30 ldcontext.Document{ 31 URL: ContextV0, 32 Content: json.RawMessage(didCfgCtxV0), 33 }, 34 ) 35 require.NoError(t, err) 36 37 t.Run("success - MS interop", func(t *testing.T) { 38 testServer := httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) { 39 require.Equal(t, "/"+msDID, req.URL.String()) 40 res.Header().Add("Content-type", "application/did+ld+json") 41 res.WriteHeader(http.StatusOK) 42 _, err := res.Write([]byte(msResolutionResponse)) 43 require.NoError(t, err) 44 })) 45 46 defer func() { testServer.Close() }() 47 48 resolver, err := httpbinding.New(testServer.URL) 49 require.NoError(t, err) 50 51 gotDocument, err := resolver.Read(msDID) 52 require.NoError(t, err) 53 didDoc, err := did.ParseDocument([]byte(msDoc)) 54 require.NoError(t, err) 55 require.Equal(t, didDoc.ID, gotDocument.DIDDocument.ID) 56 57 err = VerifyDIDAndDomain([]byte(msCfg), msDID, msDomain, 58 WithJSONLDDocumentLoader(loader), 59 WithVDRegistry(vdr.New(vdr.WithVDR(resolver)))) 60 require.NoError(t, err) 61 }) 62 } 63 64 // ms constants. 65 const ( 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dNaHlSczRucTFDeEg1V1ZyUjVkUFZYV09MYmciLCJyZWNvdmVyeUNvbW1pdG1lbnQiOiJFaUF1cGoxRWZsOHdjWlRQZTI3X0lGWEJ3MjlzOEN5SXBRX3UzVkRwUmswdkNRIn19" 68 msDomain = "https://did.rohitgulati.com/" 69 70 didCfgCtxV0 = ` 71 { 72 "@context": [ 73 { 74 "@version": 1.1, 75 "didcfg": "https://identity.foundation/.well-known/contexts/did-configuration-v0.0#", 76 "domainLinkageAssertion": "didcfg:domainLinkageAssertion", 77 "origin": "didcfg:origin", 78 "linked_dids": "didcfg:linked_dids", 79 "did": "didcfg:did", 80 "vc": "didcfg:vc" 81 } 82 ] 83 }` 84 85 // source: https://did.rohitgulati.com/.well-known/did-configuration.json 86 // nolint: lll 87 msCfg = ` 88 { 89 "@context": "https://identity.foundation/.well-known/contexts/did-configuration-v0.0.jsonld", 90 "linked_dids": [ 91 "eyJhbGciOiJFUzI1NksiLCJraWQiOiJkaWQ6aW9uOkVpQ01kVkx0enFxVzVuNnpVQzNfc3JaeFdQQ3NlVnhLWHU5RnFROEx5UzFtVEE6ZXlKa1pXeDBZU0k2ZXlKd1lYUmphR1Z6SWpwYmV5SmhZM1JwYjI0aU9pSnlaWEJzWVdObElpd2laRzlqZFcxbGJuUWlPbnNpY0hWaWJHbGpTMlY1Y3lJNlczc2lhV1FpT2lJMk5tUmtOVEZtWlRCallXTTBaakZoWVdVNE1USmtNR0ZoTVRBNVltTXlZWFpqVTJsbmJtbHVaMHRsZVMweVpUazNOU0lzSW5CMVlteHBZMHRsZVVwM2F5STZleUpqY25ZaU9pSnpaV053TWpVMmF6RWlMQ0pyZEhraU9pSkZReUlzSW5naU9pSnFOVlE0UzFGZlExOUlSR3hTYlhsRlgxcHdSamx0YkUxUlozQjROMTlmTUZKUVJIaFBWbU00ZFd0M0lpd2llU0k2SW5weWJEQldTbGxIV25oVkxYRmpaV3QyU2xZNE5HczVVMngyU1RReGFtNTNORzR5VFMxV01uQjRNR01pZ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SIsInB1YmxpY0tleUp3ayI6eyJjcnYiOiJzZWNwMjU2azEiLCJrdHkiOiJFQyIsIngiOiJqNVQ4S1FfQ19IRGxSbXlFX1pwRjltbE1RZ3B4N19fMFJQRHhPVmM4dWt3IiwieSI6InpybDBWSllHWnhVLXFjZWt2SlY4NGs5U2x2STQxam53NG4yTS1WMnB4MGMifSwicHVycG9zZXMiOlsiYXV0aGVudGljYXRpb24iLCJhc3NlcnRpb25NZXRob2QiXSwidHlwZSI6IkVjZHNhU2VjcDI1NmsxVmVyaWZpY2F0aW9uS2V5MjAxOSJ9XSwic2VydmljZXMiOlt7ImlkIjoibGlua2VkZG9tYWlucyIsInNlcnZpY2VFbmRwb2ludCI6eyJvcmlnaW5zIjpbImh0dHBzOi8vZGlkLnJvaGl0Z3VsYXRpLmNvbS8iXX0sInR5cGUiOiJMaW5rZWREb21haW5zIn0seyJpZCI6Imh1YiIsInNlcnZpY2VFbmRwb2ludCI6eyJpbnN0YW5jZXMiOlsiaHR0cHM6Ly9iZXRhLmh1Yi5tc2lkZW50aXR5LmNvbS92MS4wL2E0OTJjZmYyLWQ3MzMtNDA1Ny05NWE1LWE3MWZjMzY5NWJjOCJdfSwidHlwZSI6IklkZW50aXR5SHViIn1dfX1dLCJ1cGRhdGVDb21taXRtZW50IjoiRWlDcXRpZnUwSHg4RUVkbGlrVnZIWGpYZzRLb0pZZUV0cDdZeGlvRzVYWmRKZyJ9LCJzdWZmaXhEYXRhIjp7ImRlbHRhSGFzaCI6IkVpQ1NVQklmYTBXZHBXNm5oVTdNaHlSczRucTFDeEg1V1ZyUjVkUFZYV09MYmciLCJyZWNvdmVyeUNvbW1pdG1lbnQiOiJFaUF1cGoxRWZsOHdjWlRQZTI3X0lGWEJ3MjlzOEN5SXBRX3UzVkRwUmswdkNRIn19" 103 } 104 ], 105 "service": [ 106 { 107 "id": "#linkeddomains", 108 "type": "LinkedDomains", 109 "serviceEndpoint": { 110 "origins": [ 111 "https://did.rohitgulati.com/" 112 ] 113 } 114 }, 115 { 116 "id": "#hub", 117 "type": "IdentityHub", 118 "serviceEndpoint": { 119 "instances": [ 120 "https://beta.hub.msidentity.com/v1.0/a492cff2-d733-4057-95a5-a71fc3695bc8" 121 ], 122 "origins": [] 123 } 124 } 125 ], 126 "verificationMethod": [ 127 { 128 "id": "#66dd51fe0cac4f1aae812d0aa109bc2avcSigningKey-2e975", 129 "controller": "did:ion:EiCMdVLtzqqW5n6zUC3_srZxWPCseVxKXu9FqQ8LyS1mTA:eyJkZWx0YSI6eyJwYXRjaGVzIjpbeyJhY3Rpb24iOiJyZXBsYWNlIiwiZG9jdW1lbnQiOnsicHVibGljS2V5cyI6W3siaWQiOiI2NmRkNTFmZTBjYWM0ZjFhYWU4MTJkMGFhMTA5YmMyYXZjU2lnbmluZ0tleS0yZTk3NSIsInB1YmxpY0tleUp3ayI6eyJjcnYiOiJzZWNwMjU2azEiLCJrdHkiOiJFQyIsIngiOiJqNVQ4S1FfQ19IRGxSbXlFX1pwRjltbE1RZ3B4N19fMFJQRHhPVmM4dWt3IiwieSI6InpybDBWSllHWnhVLXFjZWt2SlY4NGs5U2x2STQxam53NG4yTS1WMnB4MGMifSwicHVycG9zZXMiOlsiYXV0aGVudGljYXRpb24iLCJhc3NlcnRpb25NZXRob2QiXSwidHlwZSI6IkVjZHNhU2VjcDI1NmsxVmVyaWZpY2F0aW9uS2V5MjAxOSJ9XSwic2VydmljZXMiOlt7ImlkIjoibGlua2VkZG9tYWlucyIsInNlcnZpY2VFbmRwb2ludCI6eyJvcmlnaW5zIjpbImh0dHBzOi8vZGlkLnJvaGl0Z3VsYXRpLmNvbS8iXX0sInR5cGUiOiJMaW5rZWREb21haW5zIn0seyJpZCI6Imh1YiIsInNlcnZpY2VFbmRwb2ludCI6eyJpbnN0YW5jZXMiOlsiaHR0cHM6Ly9iZXRhLmh1Yi5tc2lkZW50aXR5LmNvbS92MS4wL2E0OTJjZmYyLWQ3MzMtNDA1Ny05NWE1LWE3MWZjMzY5NWJjOCJdfSwidHlwZSI6IklkZW50aXR5SHViIn1dfX1dLCJ1cGRhdGVDb21taXRtZW50IjoiRWlDcXRpZnUwSHg4RUVkbGlrVnZIWGpYZzRLb0pZZUV0cDdZeGlvRzVYWmRKZyJ9LCJzdWZmaXhEYXRhIjp7ImRlbHRhSGFzaCI6IkVpQ1NVQklmYTBXZHBXNm5oVTdNaHlSczRucTFDeEg1V1ZyUjVkUFZYV09MYmciLCJyZWNvdmVyeUNvbW1pdG1lbnQiOiJFaUF1cGoxRWZsOHdjWlRQZTI3X0lGWEJ3MjlzOEN5SXBRX3UzVkRwUmswdkNRIn19", 130 "type": "EcdsaSecp256k1VerificationKey2019", 131 "publicKeyJwk": { 132 "kty": "EC", 133 "crv": "secp256k1", 134 "x": "j5T8KQ_C_HDlRmyE_ZpF9mlMQgpx7__0RPDxOVc8ukw", 135 "y": "zrl0VJYGZxU-qcekvJV84k9SlvI41jnw4n2M-V2px0c" 136 } 137 } 138 ], 139 "authentication": [ 140 "#66dd51fe0cac4f1aae812d0aa109bc2avcSigningKey-2e975" 141 ], 142 "assertionMethod": [ 143 "#66dd51fe0cac4f1aae812d0aa109bc2avcSigningKey-2e975" 144 ] 145 }` 146 147 msDocMetadata = ` 148 { 149 "method": { 150 "published": true, 151 "recoveryCommitment": "EiAupj1Efl8wcZTPe27_IFXBw29s8CyIpQ_u3VDpRk0vCQ", 152 "updateCommitment": "EiCqtifu0Hx8EEdlikVvHXjXg4KoJYeEtp7YxioG5XZdJg" 153 }, 154 "equivalentId": [ 155 "did:ion:EiCMdVLtzqqW5n6zUC3_srZxWPCseVxKXu9FqQ8LyS1mTA" 156 ], 157 "canonicalId": "did:ion:EiCMdVLtzqqW5n6zUC3_srZxWPCseVxKXu9FqQ8LyS1mTA" 158 }` 159 160 // nolint:lll 161 msResolutionMetadata = ` 162 { 163 "contentType": "application/did+ld+json", 164 "pattern": "^(did:ion:(?!test).+)$", 165 "driverUrl": "http://driver-did-ion:8080/1.0/identifiers/", 166 "duration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DcXRpZnUwSHg4RUVkbGlrVnZIWGpYZzRLb0pZZUV0cDdZeGlvRzVYWmRKZyJ9LCJzdWZmaXhEYXRhIjp7ImRlbHRhSGFzaCI6IkVpQ1NVQklmYTBXZHBXNm5oVTdNaHlSczRucTFDeEg1V1ZyUjVkUFZYV09MYmciLCJyZWNvdmVyeUNvbW1pdG1lbnQiOiJFaUF1cGoxRWZsOHdjWlRQZTI3X0lGWEJ3MjlzOEN5SXBRX3UzVkRwUmswdkNRIn19", 170 "method": "ion" 171 } 172 }` 173 174 msResolutionResponse = `{ 175 "@context": "https://w3id.org/did-resolution/v1", 176 "didDocument": ` + msDoc + `, 177 "didDocumentMetadata": ` + msDocMetadata + `, 178 "didResolutionMetadata": ` + msResolutionMetadata + ` 179 }` 180 )