Skip to content
This repository has been archived by the owner on Feb 1, 2021. It is now read-only.

Commit

Permalink
Merge branch 'release/0.3.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
mirceanis committed Nov 19, 2018
2 parents 3f78ff0 + ebd1b26 commit 0a4ddad
Show file tree
Hide file tree
Showing 107 changed files with 2,839 additions and 659 deletions.
13 changes: 6 additions & 7 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,11 @@ jobs:
build:
docker:
# specify the version you desire here
- image: circleci/android:api-27-alpha
- image: circleci/android:api-28-alpha

# Specify service dependencies here if necessary
# CircleCI maintains a library of pre-built images
# documented at https://circleci.com/docs/2.0/circleci-images/
# - image: circleci/postgres:9.4

working_directory: ~/repo

Expand All @@ -27,19 +26,19 @@ jobs:
# Download and cache dependencies
- restore_cache:
keys:
- v1-dependencies-{{ checksum "build.gradle" }}
- v3-dependencies-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}-{{ checksum "build.gradle" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-
- v3-dependencies-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}

- run: ./gradlew dependencies androidDependencies
- run: ./gradlew dependencies androidDependencies --no-daemon

- save_cache:
key: v3-dependencies-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}-{{ checksum "build.gradle" }}
paths:
- ~/.gradle
- ./gradle
key: v1-dependencies-{{ checksum "build.gradle" }}

# run tests!
- run: ./gradlew test --no-parallel
- run: ./gradlew test --no-parallel --no-daemon


30 changes: 30 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#### Guidlines for writing User Stories and Pull Requests
This is the first draft of this documents which be continuous revised.

# User Stories:
#### Goal

This should be 1 - 2 sentences max and should clearly state what the User Story ie expected to achieve. A user story should have just one goal

#### Description

This should specify any important steps which needed to achieve the above goal. Important technical information such as specific steps, sample data, user experience considerations, etc should go into the description

#### Acceptance Criteria

Each story must have a minimum 2 and a maximum of 5 acceptance criteria. These are conditions which can be verified by the test engineer and must be met for the task to be seen as completed.

#### Test Cases

A User Story should have at least one test case. This is a scenario or example which can validates the acceptance criteria above


# Pull Requests:

Every PR should have:

1. Brief explanation of what was actually done
2. Screenshots if applicable
3. Unit tests for new code
4. Testing instructions in PR description
5. Comments (dokka, javadoc) for new methods
26 changes: 25 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ Identity for your Android dApps.
Many intended features are still missing, and the ones already present are under heavy development.
Expect breaking changes!**

Planning is done at https://www.pivotaltracker.com/n/projects/2198688

### Installation

This SDK is available through [jitpack](https://jitpack.io/)
Expand All @@ -25,7 +27,7 @@ allprojects {

In your application `build.gradle`:
```groovy
def uport_sdk_version = "v0.2.2"
def uport_sdk_version = "v0.3.0"
dependencies {
...
// core SDK
Expand Down Expand Up @@ -127,6 +129,22 @@ val receipt = Networks.rinkeby.awaitConfirmation(txHash)

```

#### off-chain interaction

Off-chain interaction is essentially signing and verifying JWTs using uport-specific JWT algorithms.
Verification of such tokens implies resolving a
[Decentralized Identity (DID) document](https://github.com/uport-project/specs/blob/develop/pki/diddocument.md)
that will contain the keys or address that should match a JWT signature.

To obtain a `DIDDocument` one needs to use a `DIDResolver`.
`UniversalDID` is a global registry of `DIDResolver`s for apps using the SDK.
During SDK initialization this registry gets populated with resolvers for
[uport-did](https://github.com/uport-project/uport-did-resolver) and [ethr-did](https://github.com/uport-project/ethr-did-resolver)

```
//TODO: Details about how to use these docs for verification of JWTs to be added when
JWT verification functionality is finalized
```

### Dependencies

Expand All @@ -140,6 +158,12 @@ but that may be removed when pure kotlin implementations of the required cryptog

### Changelog

* 0.3.0 - upcoming release with breaking changes
* add universal DID resolver
* add cleaner way of creating JWTs with abstracted signer
* updated to kethereum 0.63 which has a different key derivation and mnemonic API.
If you're using an older version in parallel, you need to update as well.

* 0.2.2
* update of dependencies for coroutines and build tools

Expand Down
26 changes: 13 additions & 13 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,36 @@ buildscript {

ext {

kotlin_version = '1.2.61'
kotlin_serialization_version = '0.6.1'
coroutines_version = "0.26.1"
kotlin_version = '1.2.71'
kotlin_serialization_version = '0.6.2'
coroutines_version = "0.30.2"

android_tools_version = '3.3.0-alpha11'
android_tools_version = '3.3.0-beta04'

build_tools_version = "28.0.2"
build_tools_version = "28.0.3"

min_sdk_version = 19
compile_sdk_version = 27
compile_sdk_version = 28
target_sdk_version = compile_sdk_version

test_runner_version = "1.0.2"
test_rules_version = test_runner_version
support_lib_version = "27.1.1"
support_lib_version = "28.0.0"
play_services_version = "15.0.0"
espresso_version = "3.0.2"
junit_version = "4.12"
mockito_version = "2.19.0"
mockito_kotlin_version = "2.0.0-RC1"
mockito_version = "2.23.0"
mockito_kotlin_version = "2.0.0-RC3"

moshi_version = "1.6.0"
moshi_version = "1.7.0"
okhttp_version = "3.10.0"

bivrost_version = "1c0efeb7f3"//"v0.6.2"
kmnid_version = "0.2.1"
kethereum_version = "0.53"
kethereum_version = "0.63"
khex_version = "0.5"

uport_sdk_version = "0.2.2"
uport_sdk_version = "0.3.0"
}

repositories {
Expand Down Expand Up @@ -82,7 +82,7 @@ subprojects { subproject ->

}

if (subproject.plugins.hasPlugin("com.android.application") || subproject.plugins.hasPlugin("com.android.library") ) {
if (subproject.plugins.hasPlugin("com.android.application") || subproject.plugins.hasPlugin("com.android.library")) {
subproject.android.packagingOptions.exclude("META-INF/main.kotlin_module")
}
}
Expand Down
22 changes: 22 additions & 0 deletions core/src/main/java/me/uport/sdk/core/ITimeProvider.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package me.uport.sdk.core

/**
* An interface for getting "current" timestamp.
*
* The default implementation is [SystemTimeProvider] but other implementations may be used during testing and for "was valid at" scenarios.
*/
interface ITimeProvider {
/**
* Returns the current timestamp in milliseconds
* @return the difference, measured in milliseconds, between the current time and midnight, January 1, 1970 UTC.
*/
fun now() : Long
}


/**
* Default time provider
*/
object SystemTimeProvider : ITimeProvider {
override fun now() = System.currentTimeMillis()
}
65 changes: 0 additions & 65 deletions core/src/main/java/me/uport/sdk/core/Signer.kt

This file was deleted.

15 changes: 15 additions & 0 deletions core/src/test/java/me/uport/sdk/core/TimeProviderTest.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package me.uport.sdk.core

import org.junit.Assert.assertTrue
import org.junit.Test

class TimeProviderTest {

@Test
fun `default provider is close to current time`() {
val systemTime = System.currentTimeMillis()
val defaultProvider = SystemTimeProvider
//some systems have tens of milliseconds as the lowest granularity
assertTrue(defaultProvider.now() - systemTime < 100L)
}
}
58 changes: 58 additions & 0 deletions credentials/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
apply plugin: "com.android.library"
apply plugin: "kotlin-android"
apply plugin: "kotlinx-serialization"
apply plugin: "maven"

//apply from: 'https://raw.github.com/chrisbanes/gradle-mvn-push/master/gradle-mvn-push.gradle'

android {
compileSdkVersion compile_sdk_version
buildToolsVersion build_tools_version


defaultConfig {
minSdkVersion min_sdk_version
targetSdkVersion target_sdk_version
versionCode 1
versionName "1.0"

multiDexEnabled true

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}

dexOptions {
jumboMode true
}

}

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutines_version"

api project(":serialization")
api project(":jwt")
api project(":universal-did")
api project(":signer")

implementation "com.android.support:support-annotations:$support_lib_version"

testImplementation "junit:junit:$junit_version"
testImplementation "org.mockito:mockito-inline:$mockito_version"
testImplementation "com.nhaarman.mockitokotlin2:mockito-kotlin:$mockito_kotlin_version"
}

kotlin {
experimental {
coroutines "enable"
}
}
5 changes: 5 additions & 0 deletions credentials/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="me.uport.sdk.credentials">

<uses-permission android:name="android.permission.INTERNET" />
</manifest>
Loading

0 comments on commit 0a4ddad

Please sign in to comment.