Skip to content

Commit

Permalink
Merge branch 'release/0.3.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
mirceanis committed Sep 19, 2019
2 parents cddbef2 + 3210e6a commit e97864b
Show file tree
Hide file tree
Showing 28 changed files with 1,259 additions and 164 deletions.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

This is the Kotlin implementation of the basic JWT methods for DID-JWTs

[FAQ and helpdesk support](http://bit.ly/uPort_helpdesk)

# did-jwt

The kotlin-did-JWT library allows you to sign and verify
Expand Down Expand Up @@ -54,7 +56,7 @@ allprojects {
In your application `build.gradle` file, add:

```groovy
def did_jwt_version = "0.3.1"
def did_jwt_version = "0.3.2"
dependencies {
//...
implementation "com.github.uport-project.kotlin-did-jwt:jwt:$did_jwt_version"
Expand Down Expand Up @@ -134,6 +136,10 @@ so that only tokens intended for your app are considered valid.

## CHANGELOG

* 0.3.2
- feat: support multi-network ethr-did ( #20 )
- refactor: use lowercase coordinates for kethereum libs ( #21 )
- refactor: use kethereum 0.76.1 and kotlin-common 0.3.1 ( #22 )
* 0.3.1
- allow override or removal of `iat` field when creating JWTs (#17)
* 0.3.0
Expand Down
15 changes: 8 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
buildscript {

ext {
kotlin_version = '1.3.41'
kotlin_serialization_version = '0.11.1'
coroutines_version = "1.2.0"
kotlin_version = '1.3.50'
kotlin_serialization_version = '0.12.0'
coroutines_version = "1.3.0"

junit_version = "4.12"
mockk_version = "1.9.3"
Expand All @@ -16,12 +16,13 @@ buildscript {
okhttp_version = "3.14.1"

bivrost_version = "v0.7.1"
kmnid_version = "0.3.2"
kethereum_version = "0.75.1"
kmnid_version = "0.4.1"
kethereum_version = "0.76.1"
khex_version = "1.0.0-RC3"
spongycastle_version = "1.58.0.0"
uport_kotlin_common_version = "0.1.1"
uport_kotlin_common_version = "0.3.1"

current_release_version = "0.3.1"
current_release_version = "0.3.2"
}

repositories {
Expand Down
13 changes: 10 additions & 3 deletions ethr-did/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,22 @@ dependencies {

implementation "com.github.gnosis.bivrost-kotlin:bivrost-solidity-types:$bivrost_version"

api "com.github.komputing.KEthereum:extensions:$kethereum_version"
api "com.github.komputing.KEthereum:model:$kethereum_version"
api "com.github.komputing.kethereum:extensions:$kethereum_version"
api "com.github.komputing.kethereum:model:$kethereum_version"
api "com.github.komputing.khex:extensions-jvm:$khex_version"
implementation "com.github.komputing.kethereum:base58:$kethereum_version"
implementation "com.github.komputing.kethereum:crypto:$kethereum_version"
implementation "com.github.komputing.kethereum:crypto_impl_spongycastle:$kethereum_version"

api "com.github.uport-project.kotlin-common:core:$uport_kotlin_common_version"
api "com.github.uport-project.kotlin-common:jsonrpc:$uport_kotlin_common_version"
api "com.github.uport-project.kotlin-common:signer-common:$uport_kotlin_common_version"

api project(":universal-did")

testImplementation "junit:junit:$junit_version"
testImplementation "io.mockk:mockk:$mockk_version"
testImplementation "com.willowtreeapps.assertk:assertk-jvm:$assertk_version"
testImplementation project(":jwt-test")
}
testImplementation "com.github.uport-project.kotlin-common:test-helpers:$uport_kotlin_common_version"
}
6 changes: 3 additions & 3 deletions ethr-did/src/main/java/me/uport/sdk/ethrdid/EthrDID.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import me.uport.sdk.universaldid.PublicKeyType
import org.kethereum.extensions.hexToBigInteger
import org.kethereum.model.Address
import org.kethereum.model.createTransactionWithDefaults
import org.walleth.khex.hexToByteArray
import org.walleth.khex.prepend0xPrefix
import org.walleth.khex.toHexString
import org.komputing.khex.extensions.hexToByteArray
import org.komputing.khex.extensions.prepend0xPrefix
import org.komputing.khex.extensions.toHexString
import pm.gnosis.model.Solidity
import java.math.BigInteger

Expand Down
49 changes: 49 additions & 0 deletions ethr-did/src/main/java/me/uport/sdk/ethrdid/EthrDIDNetwork.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
package me.uport.sdk.ethrdid

import me.uport.sdk.core.EthNetwork
import me.uport.sdk.jsonrpc.JsonRPC

/**
* Encapsulates the configuration necessary to resolve an ethr-did (ERC1056)
*
* You can specify multiple of these configurations to an [EthrDIDResolver.Builder] to allow it to resolve ethr-DIDs
* anchored in the respective networks.
* example: `did:ethr:rinkeby:0xcf03dd0a894ef79cb5b601a43c4b25e3ae4c67ed`
*
* Please see https://github.com/uport-project/ethr-did-registry#contract-deployments for the known registry addresses.
*/
class EthrDIDNetwork (
/**
* name of the ethereum network (ex: "mainnet", "rinkeby")
*/
val name: String,

/**
* address of the ERC1056 contract.
* The default for the more popular networks is "0xdca7ef03e98e0dc2b855be647c39abe984fcf21b"
*/
val registryAddress: String,

/**
* A JsonRPC instance
*
* for example JsonRPC("https://rinkeby.infura.io/v3/<your infura api key>")
*/
val rpc: JsonRPC,

/**
* The chain ID (see EIP-155 https://github.com/ethereum/EIPs/blob/master/EIPS/eip-155.md)
*/
val chainId: String? = null
)

/**
* converts a network description to an [EthrDIDNetwork] instance
*/
fun EthNetwork.toEthrDIDNetwork() =
EthrDIDNetwork(
name = name,
chainId = networkId,
registryAddress = ethrDidRegistry,
rpc = JsonRPC(rpcUrl)
)
Loading

0 comments on commit e97864b

Please sign in to comment.