From 4ac8730e1a211f509f82729e40d5033a5653ae0b Mon Sep 17 00:00:00 2001 From: conanoc Date: Fri, 8 Mar 2024 17:34:11 +0900 Subject: [PATCH 1/2] Fix compatibility issues with JS framework Signed-off-by: conanoc --- DEVELOP.md | 6 ------ app/build.gradle | 4 ++-- app/src/main/assets/bcovrin-genesis.txn | 10 ++++------ .../java/org/hyperledger/ariesproject/WalletApp.kt | 6 ++---- .../src/androidTest/assets/bcovrin-genesis.txn | 10 ++++------ .../org/hyperledger/ariesframework/agent/AgentTest.kt | 2 +- .../ariesframework/oob/OutOfBandInvitationTest.kt | 3 +-- .../ariesframework/agent/HttpOutboundTransport.kt | 7 ++++--- .../ariesframework/oob/models/HandshakeProtocol.kt | 5 ++++- 9 files changed, 22 insertions(+), 31 deletions(-) diff --git a/DEVELOP.md b/DEVELOP.md index ac0608b..5c978a0 100644 --- a/DEVELOP.md +++ b/DEVELOP.md @@ -66,12 +66,6 @@ These tests use `TestHelper.prepareForIssuance()` to register a schema and a cre `AgentTest` requires a mediator and another agent to offer credentials. We use Aries Framework Javascript for this purpose. -First, we need to install Indy SDK on Mac. -```bash -$ brew tap conanoc/libindy -$ brew install --build-from-source libindy -``` - Clone the forked Aries Framework Javascript repository. ```bash git clone https://github.com/conanoc/aries-framework-javascript.git diff --git a/app/build.gradle b/app/build.gradle index 888745a..0372892 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -36,8 +36,8 @@ android { } dependencies { -// implementation project(path: ':ariesframework') - implementation("org.hyperledger:aries-framework-kotlin:2.0.0") + implementation project(path: ':ariesframework') +// implementation("org.hyperledger:aries-framework-kotlin:2.1.0") implementation("org.hyperledger:anoncreds_uniffi:0.1.1-wrapper.1") implementation 'com.otaliastudios:cameraview:2.7.2' diff --git a/app/src/main/assets/bcovrin-genesis.txn b/app/src/main/assets/bcovrin-genesis.txn index 94d3537..0f1e4fa 100644 --- a/app/src/main/assets/bcovrin-genesis.txn +++ b/app/src/main/assets/bcovrin-genesis.txn @@ -1,6 +1,4 @@ -{"reqSignature":{},"txn":{"data":{"data":{"alias":"Node1","blskey":"4N8aUNHSgjQVgkpm8nhNEfDf6txHznoYREg9kirmJrkivgL4oSEimFF6nsQ6M41QvhM2Z33nves5vfSn9n1UwNFJBYtWVnHYMATn76vLuL3zU88KyeAYcHfsih3He6UHcXDxcaecHVz6jhCYz1P2UZn2bDVruL5wXpehgBfBaLKm3Ba","blskey_pop":"RahHYiCvoNCtPTrVtP7nMC5eTYrsUA8WjXbdhNc8debh1agE9bGiJxWBXYNFbnJXoXhWFMvyqhqhRoq737YQemH5ik9oL7R4NTTCz2LEZhkgLJzB3QRQqJyBNyv7acbdHrAT8nQ9UkLbaVL9NBpnWXBTw4LEMePaSHEw66RzPNdAX1","client_ip":"159.203.21.90","client_port":9702,"node_ip":"159.203.21.90","node_port":9701,"services":["VALIDATOR"]},"dest":"Gw6pDLhcBcoQesN72qfotTgFa7cbuqZpkX3Xo6pLhPhv"},"metadata":{"from":"Th7MpTaRZVRYnPiabds81Y"},"type":"0"},"txnMetadata":{"seqNo":1,"txnId":"fea82e10e894419fe2bea7d96296a6d46f50f93f9eeda954ec461b2ed2950b62"},"ver":"1"} -{"reqSignature":{},"txn":{"data":{"data":{"alias":"Node2","blskey":"37rAPpXVoxzKhz7d9gkUe52XuXryuLXoM6P6LbWDB7LSbG62Lsb33sfG7zqS8TK1MXwuCHj1FKNzVpsnafmqLG1vXN88rt38mNFs9TENzm4QHdBzsvCuoBnPH7rpYYDo9DZNJePaDvRvqJKByCabubJz3XXKbEeshzpz4Ma5QYpJqjk","blskey_pop":"Qr658mWZ2YC8JXGXwMDQTzuZCWF7NK9EwxphGmcBvCh6ybUuLxbG65nsX4JvD4SPNtkJ2w9ug1yLTj6fgmuDg41TgECXjLCij3RMsV8CwewBVgVN67wsA45DFWvqvLtu4rjNnE9JbdFTc1Z4WCPA3Xan44K1HoHAq9EVeaRYs8zoF5","client_ip":"159.203.21.90","client_port":9704,"node_ip":"159.203.21.90","node_port":9703,"services":["VALIDATOR"]},"dest":"8ECVSk179mjsjKRLWiQtssMLgp6EPhWXtaYyStWPSGAb"},"metadata":{"from":"EbP4aYNeTHL6q385GuVpRV"},"type":"0"},"txnMetadata":{"seqNo":2,"txnId":"1ac8aece2a18ced660fef8694b61aac3af08ba875ce3026a160acbc3a3af35fc"},"ver":"1"} -{"reqSignature":{},"txn":{"data":{"data":{"alias":"Node3","blskey":"3WFpdbg7C5cnLYZwFZevJqhubkFALBfCBBok15GdrKMUhUjGsk3jV6QKj6MZgEubF7oqCafxNdkm7eswgA4sdKTRc82tLGzZBd6vNqU8dupzup6uYUf32KTHTPQbuUM8Yk4QFXjEf2Usu2TJcNkdgpyeUSX42u5LqdDDpNSWUK5deC5","blskey_pop":"QwDeb2CkNSx6r8QC8vGQK3GRv7Yndn84TGNijX8YXHPiagXajyfTjoR87rXUu4G4QLk2cF8NNyqWiYMus1623dELWwx57rLCFqGh7N4ZRbGDRP4fnVcaKg1BcUxQ866Ven4gw8y4N56S5HzxXNBZtLYmhGHvDtk6PFkFwCvxYrNYjh","client_ip":"159.203.21.90","client_port":9706,"node_ip":"159.203.21.90","node_port":9705,"services":["VALIDATOR"]},"dest":"DKVxG2fXXTU8yT5N7hGEbXB3dfdAnYv1JczDUHpmDxya"},"metadata":{"from":"4cU41vWW82ArfxJxHkzXPG"},"type":"0"},"txnMetadata":{"seqNo":3,"txnId":"7e9f355dffa78ed24668f0e0e369fd8c224076571c51e2ea8be5f26479edebe4"},"ver":"1"} -{"reqSignature":{},"txn":{"data":{"data":{"alias":"Node4","blskey":"2zN3bHM1m4rLz54MJHYSwvqzPchYp8jkHswveCLAEJVcX6Mm1wHQD1SkPYMzUDTZvWvhuE6VNAkK3KxVeEmsanSmvjVkReDeBEMxeDaayjcZjFGPydyey1qxBHmTvAnBKoPydvuTAqx5f7YNNRAdeLmUi99gERUU7TD8KfAa6MpQ9bw","blskey_pop":"RPLagxaR5xdimFzwmzYnz4ZhWtYQEj8iR5ZU53T2gitPCyCHQneUn2Huc4oeLd2B2HzkGnjAff4hWTJT6C7qHYB1Mv2wU5iHHGFWkhnTX9WsEAbunJCV2qcaXScKj4tTfvdDKfLiVuU2av6hbsMztirRze7LvYBkRHV3tGwyCptsrP","client_ip":"159.203.21.90","client_port":9708,"node_ip":"159.203.21.90","node_port":9707,"services":["VALIDATOR"]},"dest":"4PS3EDQ3dW1tci1Bp6543CfuuebjFrg36kLAUcskGfaA"},"metadata":{"from":"TWwCRQRZ2ZHMJFn9TzLp7W"},"type":"0"},"txnMetadata":{"seqNo":4,"txnId":"aa5e817d7cc626170eca175822029339a444eb0ee8f0bd20d3b0b76e566fb008"},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"2dZN1uUvDt68K9CKu9CJM2","value":"47m26iub4kiS1LX6hKEruqPN3DeSg5Znw2fvnNvWxfpryvs6QqGxdpGCzJARxG5CC7jTSew6F5zGRoBcyt9QVWnt"}]},"txn":{"data":{"data":{"alias":"Node5","blskey":"2zN3bHM1m4rLz54MJHYSwvqzPchYp8jkHswveCLAEJVcX6Mm1wHQD1SkPYMzUDTZvWvhuE6VNAkK3KxVeEmsanSmvjVkReDeBEMxeDaayjcZjFGPydyey1qxBHmTvAnBKoPydvuTAqx5f7YNNRAdeLmUi99gERUU7TD8KfAa6MpQ9bw","blskey_pop":"RPLagxaR5xdimFzwmzYnz4ZhWtYQEj8iR5ZU53T2gitPCyCHQneUn2Huc4oeLd2B2HzkGnjAff4hWTJT6C7qHYB1Mv2wU5iHHGFWkhnTX9WsEAbunJCV2qcaXScKj4tTfvdDKfLiVuU2av6hbsMztirRze7LvYBkRHV3tGwyCptsrP","client_ip":"127.0.0.2","client_port":9711,"node_ip":"127.0.0.1","node_port":9710,"services":["VALIDATOR"]},"dest":"4SWokCJWJc69Tn74VvLS6t2G2ucvXqM9FDMsWJjmsUxe"},"metadata":{"digest":"200976d2f8a99130e38eb6ea4fa68910c274ecfea1fbc39c866c05af2d891d5a","from":"2dZN1uUvDt68K9CKu9CJM2","payloadDigest":"7242e7b337c4670e8e33bb9748a6017670896f7ce6d34fe1acfd54b32a9968bd","reqId":1581887172448041000},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":5,"txnTime":1581887174},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"V4SGRU86Z58d6TV7PBUe6f","value":"4qEZWAWoEqpqa36yUiJWVRaHL9s5e2ua4TZNoJu2MUcWtGrsTi8uNMbedx9vp98pg9YhTVy8Yz7ZmujvXXQF1tAF"}]},"txn":{"data":{"data":{"alias":"Node5","services":[]},"dest":"4SWokCJWJc69Tn74VvLS6t2G2ucvXqM9FDMsWJjmsUxe"},"metadata":{"digest":"219f193e4dcfeb622b724cf47f38f5aaf4372f7b4038cf42df58fbc520640b4a","from":"V4SGRU86Z58d6TV7PBUe6f","payloadDigest":"fe5710e5733390a04ecb83fc832de8c2859f57c7a9cff68576b212c795459704","reqId":1587649729343646804},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":6,"txnTime":1587649804},"ver":"1"} \ No newline at end of file +{"reqSignature":{},"txn":{"data":{"data":{"alias":"Node1","blskey":"4N8aUNHSgjQVgkpm8nhNEfDf6txHznoYREg9kirmJrkivgL4oSEimFF6nsQ6M41QvhM2Z33nves5vfSn9n1UwNFJBYtWVnHYMATn76vLuL3zU88KyeAYcHfsih3He6UHcXDxcaecHVz6jhCYz1P2UZn2bDVruL5wXpehgBfBaLKm3Ba","blskey_pop":"RahHYiCvoNCtPTrVtP7nMC5eTYrsUA8WjXbdhNc8debh1agE9bGiJxWBXYNFbnJXoXhWFMvyqhqhRoq737YQemH5ik9oL7R4NTTCz2LEZhkgLJzB3QRQqJyBNyv7acbdHrAT8nQ9UkLbaVL9NBpnWXBTw4LEMePaSHEw66RzPNdAX1","client_ip":"138.197.138.255","client_port":9702,"node_ip":"138.197.138.255","node_port":9701,"services":["VALIDATOR"]},"dest":"Gw6pDLhcBcoQesN72qfotTgFa7cbuqZpkX3Xo6pLhPhv"},"metadata":{"from":"Th7MpTaRZVRYnPiabds81Y"},"type":"0"},"txnMetadata":{"seqNo":1,"txnId":"fea82e10e894419fe2bea7d96296a6d46f50f93f9eeda954ec461b2ed2950b62"},"ver":"1"} +{"reqSignature":{},"txn":{"data":{"data":{"alias":"Node2","blskey":"37rAPpXVoxzKhz7d9gkUe52XuXryuLXoM6P6LbWDB7LSbG62Lsb33sfG7zqS8TK1MXwuCHj1FKNzVpsnafmqLG1vXN88rt38mNFs9TENzm4QHdBzsvCuoBnPH7rpYYDo9DZNJePaDvRvqJKByCabubJz3XXKbEeshzpz4Ma5QYpJqjk","blskey_pop":"Qr658mWZ2YC8JXGXwMDQTzuZCWF7NK9EwxphGmcBvCh6ybUuLxbG65nsX4JvD4SPNtkJ2w9ug1yLTj6fgmuDg41TgECXjLCij3RMsV8CwewBVgVN67wsA45DFWvqvLtu4rjNnE9JbdFTc1Z4WCPA3Xan44K1HoHAq9EVeaRYs8zoF5","client_ip":"138.197.138.255","client_port":9704,"node_ip":"138.197.138.255","node_port":9703,"services":["VALIDATOR"]},"dest":"8ECVSk179mjsjKRLWiQtssMLgp6EPhWXtaYyStWPSGAb"},"metadata":{"from":"EbP4aYNeTHL6q385GuVpRV"},"type":"0"},"txnMetadata":{"seqNo":2,"txnId":"1ac8aece2a18ced660fef8694b61aac3af08ba875ce3026a160acbc3a3af35fc"},"ver":"1"} +{"reqSignature":{},"txn":{"data":{"data":{"alias":"Node3","blskey":"3WFpdbg7C5cnLYZwFZevJqhubkFALBfCBBok15GdrKMUhUjGsk3jV6QKj6MZgEubF7oqCafxNdkm7eswgA4sdKTRc82tLGzZBd6vNqU8dupzup6uYUf32KTHTPQbuUM8Yk4QFXjEf2Usu2TJcNkdgpyeUSX42u5LqdDDpNSWUK5deC5","blskey_pop":"QwDeb2CkNSx6r8QC8vGQK3GRv7Yndn84TGNijX8YXHPiagXajyfTjoR87rXUu4G4QLk2cF8NNyqWiYMus1623dELWwx57rLCFqGh7N4ZRbGDRP4fnVcaKg1BcUxQ866Ven4gw8y4N56S5HzxXNBZtLYmhGHvDtk6PFkFwCvxYrNYjh","client_ip":"138.197.138.255","client_port":9706,"node_ip":"138.197.138.255","node_port":9705,"services":["VALIDATOR"]},"dest":"DKVxG2fXXTU8yT5N7hGEbXB3dfdAnYv1JczDUHpmDxya"},"metadata":{"from":"4cU41vWW82ArfxJxHkzXPG"},"type":"0"},"txnMetadata":{"seqNo":3,"txnId":"7e9f355dffa78ed24668f0e0e369fd8c224076571c51e2ea8be5f26479edebe4"},"ver":"1"} +{"reqSignature":{},"txn":{"data":{"data":{"alias":"Node4","blskey":"2zN3bHM1m4rLz54MJHYSwvqzPchYp8jkHswveCLAEJVcX6Mm1wHQD1SkPYMzUDTZvWvhuE6VNAkK3KxVeEmsanSmvjVkReDeBEMxeDaayjcZjFGPydyey1qxBHmTvAnBKoPydvuTAqx5f7YNNRAdeLmUi99gERUU7TD8KfAa6MpQ9bw","blskey_pop":"RPLagxaR5xdimFzwmzYnz4ZhWtYQEj8iR5ZU53T2gitPCyCHQneUn2Huc4oeLd2B2HzkGnjAff4hWTJT6C7qHYB1Mv2wU5iHHGFWkhnTX9WsEAbunJCV2qcaXScKj4tTfvdDKfLiVuU2av6hbsMztirRze7LvYBkRHV3tGwyCptsrP","client_ip":"138.197.138.255","client_port":9708,"node_ip":"138.197.138.255","node_port":9707,"services":["VALIDATOR"]},"dest":"4PS3EDQ3dW1tci1Bp6543CfuuebjFrg36kLAUcskGfaA"},"metadata":{"from":"TWwCRQRZ2ZHMJFn9TzLp7W"},"type":"0"},"txnMetadata":{"seqNo":4,"txnId":"aa5e817d7cc626170eca175822029339a444eb0ee8f0bd20d3b0b76e566fb008"},"ver":"1"} diff --git a/app/src/main/java/org/hyperledger/ariesproject/WalletApp.kt b/app/src/main/java/org/hyperledger/ariesproject/WalletApp.kt index 52b3f16..25de02a 100644 --- a/app/src/main/java/org/hyperledger/ariesproject/WalletApp.kt +++ b/app/src/main/java/org/hyperledger/ariesproject/WalletApp.kt @@ -24,9 +24,7 @@ class WalletApp : Application() { private fun copyResourceFile(resource: String) { val inputStream = applicationContext.assets.open(resource) val file = File(applicationContext.filesDir.absolutePath, resource) - if (!file.exists()) { - file.outputStream().use { inputStream.copyTo(it) } - } + file.outputStream().use { inputStream.copyTo(it) } } private suspend fun openWallet() { @@ -36,8 +34,8 @@ class WalletApp : Application() { if (key == null) { key = Agent.generateWalletKey() pref.edit().putString("walletKey", key).apply() - copyResourceFile(genesisPath) } + copyResourceFile(genesisPath) val invitationUrl = "https://public.mediator.indiciotech.io?c_i=eyJAdHlwZSI6ICJkaWQ6c292OkJ6Q2JzTlloTXJqSGlxWkRUVUFTSGc7c3BlYy9jb25uZWN0aW9ucy8xLjAvaW52aXRhdGlvbiIsICJAaWQiOiAiMDVlYzM5NDItYTEyOS00YWE3LWEzZDQtYTJmNDgwYzNjZThhIiwgInNlcnZpY2VFbmRwb2ludCI6ICJodHRwczovL3B1YmxpYy5tZWRpYXRvci5pbmRpY2lvdGVjaC5pbyIsICJyZWNpcGllbnRLZXlzIjogWyJDc2dIQVpxSktuWlRmc3h0MmRIR3JjN3U2M3ljeFlEZ25RdEZMeFhpeDIzYiJdLCAibGFiZWwiOiAiSW5kaWNpbyBQdWJsaWMgTWVkaWF0b3IifQ==" // ktlint-disable max-line-length // val invitationUrl = URL("http://10.0.2.2:3001/invitation").readText() // This uses local AFJ mediator and needs MediatorPickupStrategy.PickUpV1 diff --git a/ariesframework/src/androidTest/assets/bcovrin-genesis.txn b/ariesframework/src/androidTest/assets/bcovrin-genesis.txn index 94d3537..0f1e4fa 100644 --- a/ariesframework/src/androidTest/assets/bcovrin-genesis.txn +++ b/ariesframework/src/androidTest/assets/bcovrin-genesis.txn @@ -1,6 +1,4 @@ -{"reqSignature":{},"txn":{"data":{"data":{"alias":"Node1","blskey":"4N8aUNHSgjQVgkpm8nhNEfDf6txHznoYREg9kirmJrkivgL4oSEimFF6nsQ6M41QvhM2Z33nves5vfSn9n1UwNFJBYtWVnHYMATn76vLuL3zU88KyeAYcHfsih3He6UHcXDxcaecHVz6jhCYz1P2UZn2bDVruL5wXpehgBfBaLKm3Ba","blskey_pop":"RahHYiCvoNCtPTrVtP7nMC5eTYrsUA8WjXbdhNc8debh1agE9bGiJxWBXYNFbnJXoXhWFMvyqhqhRoq737YQemH5ik9oL7R4NTTCz2LEZhkgLJzB3QRQqJyBNyv7acbdHrAT8nQ9UkLbaVL9NBpnWXBTw4LEMePaSHEw66RzPNdAX1","client_ip":"159.203.21.90","client_port":9702,"node_ip":"159.203.21.90","node_port":9701,"services":["VALIDATOR"]},"dest":"Gw6pDLhcBcoQesN72qfotTgFa7cbuqZpkX3Xo6pLhPhv"},"metadata":{"from":"Th7MpTaRZVRYnPiabds81Y"},"type":"0"},"txnMetadata":{"seqNo":1,"txnId":"fea82e10e894419fe2bea7d96296a6d46f50f93f9eeda954ec461b2ed2950b62"},"ver":"1"} -{"reqSignature":{},"txn":{"data":{"data":{"alias":"Node2","blskey":"37rAPpXVoxzKhz7d9gkUe52XuXryuLXoM6P6LbWDB7LSbG62Lsb33sfG7zqS8TK1MXwuCHj1FKNzVpsnafmqLG1vXN88rt38mNFs9TENzm4QHdBzsvCuoBnPH7rpYYDo9DZNJePaDvRvqJKByCabubJz3XXKbEeshzpz4Ma5QYpJqjk","blskey_pop":"Qr658mWZ2YC8JXGXwMDQTzuZCWF7NK9EwxphGmcBvCh6ybUuLxbG65nsX4JvD4SPNtkJ2w9ug1yLTj6fgmuDg41TgECXjLCij3RMsV8CwewBVgVN67wsA45DFWvqvLtu4rjNnE9JbdFTc1Z4WCPA3Xan44K1HoHAq9EVeaRYs8zoF5","client_ip":"159.203.21.90","client_port":9704,"node_ip":"159.203.21.90","node_port":9703,"services":["VALIDATOR"]},"dest":"8ECVSk179mjsjKRLWiQtssMLgp6EPhWXtaYyStWPSGAb"},"metadata":{"from":"EbP4aYNeTHL6q385GuVpRV"},"type":"0"},"txnMetadata":{"seqNo":2,"txnId":"1ac8aece2a18ced660fef8694b61aac3af08ba875ce3026a160acbc3a3af35fc"},"ver":"1"} -{"reqSignature":{},"txn":{"data":{"data":{"alias":"Node3","blskey":"3WFpdbg7C5cnLYZwFZevJqhubkFALBfCBBok15GdrKMUhUjGsk3jV6QKj6MZgEubF7oqCafxNdkm7eswgA4sdKTRc82tLGzZBd6vNqU8dupzup6uYUf32KTHTPQbuUM8Yk4QFXjEf2Usu2TJcNkdgpyeUSX42u5LqdDDpNSWUK5deC5","blskey_pop":"QwDeb2CkNSx6r8QC8vGQK3GRv7Yndn84TGNijX8YXHPiagXajyfTjoR87rXUu4G4QLk2cF8NNyqWiYMus1623dELWwx57rLCFqGh7N4ZRbGDRP4fnVcaKg1BcUxQ866Ven4gw8y4N56S5HzxXNBZtLYmhGHvDtk6PFkFwCvxYrNYjh","client_ip":"159.203.21.90","client_port":9706,"node_ip":"159.203.21.90","node_port":9705,"services":["VALIDATOR"]},"dest":"DKVxG2fXXTU8yT5N7hGEbXB3dfdAnYv1JczDUHpmDxya"},"metadata":{"from":"4cU41vWW82ArfxJxHkzXPG"},"type":"0"},"txnMetadata":{"seqNo":3,"txnId":"7e9f355dffa78ed24668f0e0e369fd8c224076571c51e2ea8be5f26479edebe4"},"ver":"1"} -{"reqSignature":{},"txn":{"data":{"data":{"alias":"Node4","blskey":"2zN3bHM1m4rLz54MJHYSwvqzPchYp8jkHswveCLAEJVcX6Mm1wHQD1SkPYMzUDTZvWvhuE6VNAkK3KxVeEmsanSmvjVkReDeBEMxeDaayjcZjFGPydyey1qxBHmTvAnBKoPydvuTAqx5f7YNNRAdeLmUi99gERUU7TD8KfAa6MpQ9bw","blskey_pop":"RPLagxaR5xdimFzwmzYnz4ZhWtYQEj8iR5ZU53T2gitPCyCHQneUn2Huc4oeLd2B2HzkGnjAff4hWTJT6C7qHYB1Mv2wU5iHHGFWkhnTX9WsEAbunJCV2qcaXScKj4tTfvdDKfLiVuU2av6hbsMztirRze7LvYBkRHV3tGwyCptsrP","client_ip":"159.203.21.90","client_port":9708,"node_ip":"159.203.21.90","node_port":9707,"services":["VALIDATOR"]},"dest":"4PS3EDQ3dW1tci1Bp6543CfuuebjFrg36kLAUcskGfaA"},"metadata":{"from":"TWwCRQRZ2ZHMJFn9TzLp7W"},"type":"0"},"txnMetadata":{"seqNo":4,"txnId":"aa5e817d7cc626170eca175822029339a444eb0ee8f0bd20d3b0b76e566fb008"},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"2dZN1uUvDt68K9CKu9CJM2","value":"47m26iub4kiS1LX6hKEruqPN3DeSg5Znw2fvnNvWxfpryvs6QqGxdpGCzJARxG5CC7jTSew6F5zGRoBcyt9QVWnt"}]},"txn":{"data":{"data":{"alias":"Node5","blskey":"2zN3bHM1m4rLz54MJHYSwvqzPchYp8jkHswveCLAEJVcX6Mm1wHQD1SkPYMzUDTZvWvhuE6VNAkK3KxVeEmsanSmvjVkReDeBEMxeDaayjcZjFGPydyey1qxBHmTvAnBKoPydvuTAqx5f7YNNRAdeLmUi99gERUU7TD8KfAa6MpQ9bw","blskey_pop":"RPLagxaR5xdimFzwmzYnz4ZhWtYQEj8iR5ZU53T2gitPCyCHQneUn2Huc4oeLd2B2HzkGnjAff4hWTJT6C7qHYB1Mv2wU5iHHGFWkhnTX9WsEAbunJCV2qcaXScKj4tTfvdDKfLiVuU2av6hbsMztirRze7LvYBkRHV3tGwyCptsrP","client_ip":"127.0.0.2","client_port":9711,"node_ip":"127.0.0.1","node_port":9710,"services":["VALIDATOR"]},"dest":"4SWokCJWJc69Tn74VvLS6t2G2ucvXqM9FDMsWJjmsUxe"},"metadata":{"digest":"200976d2f8a99130e38eb6ea4fa68910c274ecfea1fbc39c866c05af2d891d5a","from":"2dZN1uUvDt68K9CKu9CJM2","payloadDigest":"7242e7b337c4670e8e33bb9748a6017670896f7ce6d34fe1acfd54b32a9968bd","reqId":1581887172448041000},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":5,"txnTime":1581887174},"ver":"1"} -{"reqSignature":{"type":"ED25519","values":[{"from":"V4SGRU86Z58d6TV7PBUe6f","value":"4qEZWAWoEqpqa36yUiJWVRaHL9s5e2ua4TZNoJu2MUcWtGrsTi8uNMbedx9vp98pg9YhTVy8Yz7ZmujvXXQF1tAF"}]},"txn":{"data":{"data":{"alias":"Node5","services":[]},"dest":"4SWokCJWJc69Tn74VvLS6t2G2ucvXqM9FDMsWJjmsUxe"},"metadata":{"digest":"219f193e4dcfeb622b724cf47f38f5aaf4372f7b4038cf42df58fbc520640b4a","from":"V4SGRU86Z58d6TV7PBUe6f","payloadDigest":"fe5710e5733390a04ecb83fc832de8c2859f57c7a9cff68576b212c795459704","reqId":1587649729343646804},"protocolVersion":2,"type":"0"},"txnMetadata":{"seqNo":6,"txnTime":1587649804},"ver":"1"} \ No newline at end of file +{"reqSignature":{},"txn":{"data":{"data":{"alias":"Node1","blskey":"4N8aUNHSgjQVgkpm8nhNEfDf6txHznoYREg9kirmJrkivgL4oSEimFF6nsQ6M41QvhM2Z33nves5vfSn9n1UwNFJBYtWVnHYMATn76vLuL3zU88KyeAYcHfsih3He6UHcXDxcaecHVz6jhCYz1P2UZn2bDVruL5wXpehgBfBaLKm3Ba","blskey_pop":"RahHYiCvoNCtPTrVtP7nMC5eTYrsUA8WjXbdhNc8debh1agE9bGiJxWBXYNFbnJXoXhWFMvyqhqhRoq737YQemH5ik9oL7R4NTTCz2LEZhkgLJzB3QRQqJyBNyv7acbdHrAT8nQ9UkLbaVL9NBpnWXBTw4LEMePaSHEw66RzPNdAX1","client_ip":"138.197.138.255","client_port":9702,"node_ip":"138.197.138.255","node_port":9701,"services":["VALIDATOR"]},"dest":"Gw6pDLhcBcoQesN72qfotTgFa7cbuqZpkX3Xo6pLhPhv"},"metadata":{"from":"Th7MpTaRZVRYnPiabds81Y"},"type":"0"},"txnMetadata":{"seqNo":1,"txnId":"fea82e10e894419fe2bea7d96296a6d46f50f93f9eeda954ec461b2ed2950b62"},"ver":"1"} +{"reqSignature":{},"txn":{"data":{"data":{"alias":"Node2","blskey":"37rAPpXVoxzKhz7d9gkUe52XuXryuLXoM6P6LbWDB7LSbG62Lsb33sfG7zqS8TK1MXwuCHj1FKNzVpsnafmqLG1vXN88rt38mNFs9TENzm4QHdBzsvCuoBnPH7rpYYDo9DZNJePaDvRvqJKByCabubJz3XXKbEeshzpz4Ma5QYpJqjk","blskey_pop":"Qr658mWZ2YC8JXGXwMDQTzuZCWF7NK9EwxphGmcBvCh6ybUuLxbG65nsX4JvD4SPNtkJ2w9ug1yLTj6fgmuDg41TgECXjLCij3RMsV8CwewBVgVN67wsA45DFWvqvLtu4rjNnE9JbdFTc1Z4WCPA3Xan44K1HoHAq9EVeaRYs8zoF5","client_ip":"138.197.138.255","client_port":9704,"node_ip":"138.197.138.255","node_port":9703,"services":["VALIDATOR"]},"dest":"8ECVSk179mjsjKRLWiQtssMLgp6EPhWXtaYyStWPSGAb"},"metadata":{"from":"EbP4aYNeTHL6q385GuVpRV"},"type":"0"},"txnMetadata":{"seqNo":2,"txnId":"1ac8aece2a18ced660fef8694b61aac3af08ba875ce3026a160acbc3a3af35fc"},"ver":"1"} +{"reqSignature":{},"txn":{"data":{"data":{"alias":"Node3","blskey":"3WFpdbg7C5cnLYZwFZevJqhubkFALBfCBBok15GdrKMUhUjGsk3jV6QKj6MZgEubF7oqCafxNdkm7eswgA4sdKTRc82tLGzZBd6vNqU8dupzup6uYUf32KTHTPQbuUM8Yk4QFXjEf2Usu2TJcNkdgpyeUSX42u5LqdDDpNSWUK5deC5","blskey_pop":"QwDeb2CkNSx6r8QC8vGQK3GRv7Yndn84TGNijX8YXHPiagXajyfTjoR87rXUu4G4QLk2cF8NNyqWiYMus1623dELWwx57rLCFqGh7N4ZRbGDRP4fnVcaKg1BcUxQ866Ven4gw8y4N56S5HzxXNBZtLYmhGHvDtk6PFkFwCvxYrNYjh","client_ip":"138.197.138.255","client_port":9706,"node_ip":"138.197.138.255","node_port":9705,"services":["VALIDATOR"]},"dest":"DKVxG2fXXTU8yT5N7hGEbXB3dfdAnYv1JczDUHpmDxya"},"metadata":{"from":"4cU41vWW82ArfxJxHkzXPG"},"type":"0"},"txnMetadata":{"seqNo":3,"txnId":"7e9f355dffa78ed24668f0e0e369fd8c224076571c51e2ea8be5f26479edebe4"},"ver":"1"} +{"reqSignature":{},"txn":{"data":{"data":{"alias":"Node4","blskey":"2zN3bHM1m4rLz54MJHYSwvqzPchYp8jkHswveCLAEJVcX6Mm1wHQD1SkPYMzUDTZvWvhuE6VNAkK3KxVeEmsanSmvjVkReDeBEMxeDaayjcZjFGPydyey1qxBHmTvAnBKoPydvuTAqx5f7YNNRAdeLmUi99gERUU7TD8KfAa6MpQ9bw","blskey_pop":"RPLagxaR5xdimFzwmzYnz4ZhWtYQEj8iR5ZU53T2gitPCyCHQneUn2Huc4oeLd2B2HzkGnjAff4hWTJT6C7qHYB1Mv2wU5iHHGFWkhnTX9WsEAbunJCV2qcaXScKj4tTfvdDKfLiVuU2av6hbsMztirRze7LvYBkRHV3tGwyCptsrP","client_ip":"138.197.138.255","client_port":9708,"node_ip":"138.197.138.255","node_port":9707,"services":["VALIDATOR"]},"dest":"4PS3EDQ3dW1tci1Bp6543CfuuebjFrg36kLAUcskGfaA"},"metadata":{"from":"TWwCRQRZ2ZHMJFn9TzLp7W"},"type":"0"},"txnMetadata":{"seqNo":4,"txnId":"aa5e817d7cc626170eca175822029339a444eb0ee8f0bd20d3b0b76e566fb008"},"ver":"1"} diff --git a/ariesframework/src/androidTest/java/org/hyperledger/ariesframework/agent/AgentTest.kt b/ariesframework/src/androidTest/java/org/hyperledger/ariesframework/agent/AgentTest.kt index 0da3842..b398919 100644 --- a/ariesframework/src/androidTest/java/org/hyperledger/ariesframework/agent/AgentTest.kt +++ b/ariesframework/src/androidTest/java/org/hyperledger/ariesframework/agent/AgentTest.kt @@ -157,7 +157,7 @@ class AgentTest { agent = Agent(context, config) agent.initialize() - val faberInvitationUrl = "http://localhost:9001?oob=eyJAdHlwZSI6Imh0dHBzOi8vZGlkY29tbS5vcmcvb3V0LW9mLWJhbmQvMS4xL2ludml0YXRpb24iLCJAaWQiOiI5NTkwMDk2MS1mYjA1LTQ4ZWUtYWVlMy1kZjQ5MjZhZDgyNmIiLCJsYWJlbCI6ImZhYmVyIiwiYWNjZXB0IjpbImRpZGNvbW0vYWlwMSIsImRpZGNvbW0vYWlwMjtlbnY9cmZjMTkiXSwiaGFuZHNoYWtlX3Byb3RvY29scyI6WyJodHRwczovL2RpZGNvbW0ub3JnL2RpZGV4Y2hhbmdlLzEuMCIsImh0dHBzOi8vZGlkY29tbS5vcmcvY29ubmVjdGlvbnMvMS4wIl0sInNlcnZpY2VzIjpbeyJpZCI6IiNpbmxpbmUtMCIsInNlcnZpY2VFbmRwb2ludCI6Imh0dHA6Ly8xMC4wLjIuMjo5MDAxIiwidHlwZSI6ImRpZC1jb21tdW5pY2F0aW9uIiwicmVjaXBpZW50S2V5cyI6WyJkaWQ6a2V5Ono2TWtzRVBEeE1nWEM1M3YzeDJ5SlhzQmtSQ0FZZWo1bk5qOUNnR0prdW4ybnExeiJdLCJyb3V0aW5nS2V5cyI6W119XX0" // ktlint-disable max-line-length + val faberInvitationUrl = "http://localhost:9001?oob=eyJAdHlwZSI6Imh0dHBzOi8vZGlkY29tbS5vcmcvb3V0LW9mLWJhbmQvMS4xL2ludml0YXRpb24iLCJAaWQiOiIyNDFjNjNkMC1mMjZkLTRlNDktYjkyYy00N2JhYTk1MzAwMzUiLCJsYWJlbCI6ImZhYmVyIiwiYWNjZXB0IjpbImRpZGNvbW0vYWlwMSIsImRpZGNvbW0vYWlwMjtlbnY9cmZjMTkiXSwiaGFuZHNoYWtlX3Byb3RvY29scyI6WyJodHRwczovL2RpZGNvbW0ub3JnL2RpZGV4Y2hhbmdlLzEuMSIsImh0dHBzOi8vZGlkY29tbS5vcmcvY29ubmVjdGlvbnMvMS4wIl0sInNlcnZpY2VzIjpbeyJpZCI6IiNpbmxpbmUtMCIsInNlcnZpY2VFbmRwb2ludCI6Imh0dHA6Ly8xMC4wLjIuMjo5MDAxIiwidHlwZSI6ImRpZC1jb21tdW5pY2F0aW9uIiwicmVjaXBpZW50S2V5cyI6WyJkaWQ6a2V5Ono2TWttcDZNNjhNeHFuazlGUzdFZU5lUHpETmNSWXhpR1lUcUJFVm4yRjhENk41YSJdLCJyb3V0aW5nS2V5cyI6W119XX0" // ktlint-disable max-line-length val invitation = OutOfBandInvitation.fromUrl(faberInvitationUrl) agent.oob.receiveInvitation(invitation) diff --git a/ariesframework/src/androidTest/java/org/hyperledger/ariesframework/oob/OutOfBandInvitationTest.kt b/ariesframework/src/androidTest/java/org/hyperledger/ariesframework/oob/OutOfBandInvitationTest.kt index 9b69bb8..935d6dd 100644 --- a/ariesframework/src/androidTest/java/org/hyperledger/ariesframework/oob/OutOfBandInvitationTest.kt +++ b/ariesframework/src/androidTest/java/org/hyperledger/ariesframework/oob/OutOfBandInvitationTest.kt @@ -1,6 +1,5 @@ package org.hyperledger.ariesframework.oob -import kotlinx.serialization.decodeFromString import kotlinx.serialization.json.Json import org.hyperledger.ariesframework.agent.MessageSerializer import org.hyperledger.ariesframework.connection.messages.TrustPingMessage @@ -51,7 +50,7 @@ class OutOfBandInvitationTest { assertEquals(invitation.goal, "To issue a Faber College Graduate credential") assertEquals( invitation.handshakeProtocols, - listOf(HandshakeProtocol.DidExchange, HandshakeProtocol.Connections), + listOf(HandshakeProtocol.DidExchange10, HandshakeProtocol.Connections), ) if (invitation.services[0] is PublicDidService) { assertEquals((invitation.services[0] as PublicDidService).did, "did:sov:LjgpST2rjsoxYegQDRm7EL") diff --git a/ariesframework/src/main/java/org/hyperledger/ariesframework/agent/HttpOutboundTransport.kt b/ariesframework/src/main/java/org/hyperledger/ariesframework/agent/HttpOutboundTransport.kt index 6b5c582..88812b3 100644 --- a/ariesframework/src/main/java/org/hyperledger/ariesframework/agent/HttpOutboundTransport.kt +++ b/ariesframework/src/main/java/org/hyperledger/ariesframework/agent/HttpOutboundTransport.kt @@ -5,10 +5,9 @@ import kotlinx.coroutines.GlobalScope import kotlinx.coroutines.delay import kotlinx.coroutines.launch import kotlinx.coroutines.withContext -import kotlinx.serialization.decodeFromString import kotlinx.serialization.encodeToString import kotlinx.serialization.json.Json -import okhttp3.MediaType.Companion.toMediaTypeOrNull +import okhttp3.MediaType.Companion.toMediaType import okhttp3.RequestBody.Companion.toRequestBody import org.hyperledger.ariesframework.EncryptedMessage import org.hyperledger.ariesframework.OutboundPackage @@ -28,7 +27,9 @@ class HttpOutboundTransport(val agent: Agent) : OutboundTransport { val responseText = withContext(Dispatchers.IO) { val request = okhttp3.Request.Builder() .url(_package.endpoint) - .post(Json.encodeToString(_package.payload).toRequestBody(DidCommMimeType.V1.value.toMediaTypeOrNull())) + .post(Json.encodeToString(_package.payload) + .toByteArray() // prevent okHttp from adding charset=utf-8 to the content type + .toRequestBody(DidCommMimeType.V1.value.toMediaType())) .build() val response = AgentHttpClient.client.newCall(request).execute() logger.debug("response with status code: {}", response.code) diff --git a/ariesframework/src/main/java/org/hyperledger/ariesframework/oob/models/HandshakeProtocol.kt b/ariesframework/src/main/java/org/hyperledger/ariesframework/oob/models/HandshakeProtocol.kt index 28ebc13..c118592 100644 --- a/ariesframework/src/main/java/org/hyperledger/ariesframework/oob/models/HandshakeProtocol.kt +++ b/ariesframework/src/main/java/org/hyperledger/ariesframework/oob/models/HandshakeProtocol.kt @@ -9,5 +9,8 @@ enum class HandshakeProtocol { Connections, @SerialName("https://didcomm.org/didexchange/1.0") - DidExchange, + DidExchange10, + + @SerialName("https://didcomm.org/didexchange/1.1") + DidExchange11, } From cb6f573abfa60793297efc79e268d24aceef5f96 Mon Sep 17 00:00:00 2001 From: conanoc Date: Fri, 8 Mar 2024 17:50:41 +0900 Subject: [PATCH 2/2] fix lint error Signed-off-by: conanoc --- .../java/org/hyperledger/ariesframework/SerializationTest.kt | 2 -- 1 file changed, 2 deletions(-) diff --git a/ariesframework/src/test/java/org/hyperledger/ariesframework/SerializationTest.kt b/ariesframework/src/test/java/org/hyperledger/ariesframework/SerializationTest.kt index b754bd2..71bba05 100644 --- a/ariesframework/src/test/java/org/hyperledger/ariesframework/SerializationTest.kt +++ b/ariesframework/src/test/java/org/hyperledger/ariesframework/SerializationTest.kt @@ -3,7 +3,6 @@ package org.hyperledger.ariesframework import kotlinx.coroutines.test.runTest import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable -import kotlinx.serialization.decodeFromString import kotlinx.serialization.encodeToString import kotlinx.serialization.json.Json import kotlinx.serialization.json.JsonObject @@ -11,7 +10,6 @@ import kotlinx.serialization.json.jsonPrimitive import kotlinx.serialization.modules.SerializersModule import kotlinx.serialization.modules.polymorphic import kotlinx.serialization.modules.subclass -import org.hyperledger.ariesframework.connection.models.didauth.DidDocService import org.hyperledger.ariesframework.proofs.models.RequestedCredentials import org.hyperledger.ariesframework.util.concurrentForEach import org.hyperledger.ariesframework.util.concurrentMap