Skip to content

Commit

Permalink
feat: connectionless credential offer
Browse files Browse the repository at this point in the history
Signed-off-by: Cristian G <cristian.castro@iohk.io>
  • Loading branch information
cristianIOHK committed Sep 17, 2024
1 parent eed1736 commit 3c59ee3
Show file tree
Hide file tree
Showing 55 changed files with 1,528 additions and 698 deletions.
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
root = true

[*.{kt,kts}]
ij_kotlin_packages_to_use_import_on_demand = unset
ij_kotlin_name_count_to_use_star_import_for_members = 99
ij_kotlin_name_count_to_use_star_import = 99
ktlint_experimental = disabled
ktlint_code_style = intellij_idea
ktlint_standard_no_semi = disabled
Expand Down
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@goncalo-frade-iohk @yshyn-iohk @elribonazo @cristianIOHK
@elribonazo @cristianIOHK

# Test related:
/tests/ @amagyar-iohk
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:
required: true
description: Mediator out-of-band url
default: https://beta-mediator.atalaprism.io/invitationOOB
prismAgentUrl:
agentUrl:
required: true
description: Prism-agent server url
default: https://sit-prism-agent-issuer.atalaprism.io/prism-agent/
Expand Down Expand Up @@ -74,7 +74,7 @@ jobs:
- name: Run tests
env:
MEDIATOR_OOB_URL: ${{ inputs.mediatorOobUrl || vars.MEDIATOR_OOB_URL }}
PRISM_AGENT_URL: ${{ inputs.prismAgentUrl || vars.PRISM_AGENT_URL }}
AGENT_URL: ${{ inputs.agentUrl || vars.AGENT_URL }}
PUBLISHED_DID: ${{ inputs.publishedDid || vars.PUBLISHED_DID }}
JWT_SCHEMA_GUID: ${{ inputs.jwtSchemaGuid || vars.SCHEMA_ID }}
ANONCRED_DEFINITION_GUID: ${{ inputs.anoncredDefinitionGuid || vars.ANONCRED_DEFINITION_GUID }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
token: ${{ secrets.IDENTUS_CI }}
fetch-depth: 0
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ The complete platform is separated into multiple repositories:
* [edge-agent-sdk-swift](https://github.com/hyperledger/identus-edge-agent-sdk-swift/) - Repo that implements Edge Agent for Apple platforms in Swift.
* [edge-agent-sdk-ts](https://github.com/hyperledger/identus-edge-agent-sdk-ts/) - Repo that implements Edge Agent for Browser and Node.js platforms in Typescript.
* [identus-cloud-agent](https://github.com/hyperledger/identus-cloud-agent/) - Repo that contains the platform Building Blocks.
* [mediator](https://github.com/hyperledger/identus-mediator/) - Repo for DIDComm V2 Mediator
* [mediator](https://github.com/hyperledger/identus-mediator/) - Repo for DIDComm V2 Mediator.

### Modules / APIs

Expand Down
113 changes: 3 additions & 110 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import org.gradle.internal.os.OperatingSystem

val publishedMavenId = "org.hyperledger.identus"
val groupId = "org.hyperledger.identus"
val os: OperatingSystem = OperatingSystem.current()

plugins {
Expand All @@ -10,8 +10,6 @@ plugins {
id("org.jlleitschuh.gradle.ktlint") version "12.1.0"
id("org.jetbrains.dokka") version "1.9.20"
id("org.jetbrains.kotlin.kapt") version "1.9.10"
id("maven-publish")
id("signing")
id("io.github.gradle-nexus.publish-plugin") version "2.0.0"
}

Expand All @@ -37,7 +35,7 @@ java {
}

allprojects {
this.group = publishedMavenId
this.group = groupId

repositories {
mavenLocal()
Expand Down Expand Up @@ -101,118 +99,13 @@ subprojects {
}
}
}

if (this.name == "edge-agent-sdk") {
apply(plugin = "org.gradle.maven-publish")
apply(plugin = "org.gradle.signing")

publishing {
repositories {
maven {
name = "OSSRH"
url = uri("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/")
credentials {
username =
project.findProperty("sonatypeUsername") as String? ?: System.getenv("OSSRH_USERNAME")
password = project.findProperty("sonatypePassword") as String? ?: System.getenv("OSSRH_TOKEN")
}
}
}
publications {
withType<MavenPublication> {
groupId = publishedMavenId
artifactId = project.name
version = project.version.toString()
pom {
name.set("Edge Agent SDK")
description.set(" Edge Agent SDK - Kotlin Multiplatform (Android/JVM)")
url.set("https://docs.atalaprism.io/")
organization {
name.set("Hyperledger")
url.set("https://hyperledger.org/")
}
issueManagement {
system.set("Github")
url.set("https://github.com/hyperledger/identus-edge-agent-sdk-kmp")
}
licenses {
license {
name.set("The Apache License, Version 2.0")
url.set("https://www.apache.org/licenses/LICENSE-2.0.txt")
}
}
developers {
developer {
id.set("cristianIOHK")
name.set("Cristian Gonzalez")
email.set("cristian.castro@iohk.io")
organization.set("IOG")
roles.add("developer")
url.set("https://github.com/cristianIOHK")
}
developer {
id.set("hamada147")
name.set("Ahmed Moussa")
email.set("ahmed.moussa@iohk.io")
organization.set("IOG")
roles.add("developer")
url.set("https://github.com/hamada147")
}
developer {
id.set("elribonazo")
name.set("Javier Ribó")
email.set("javier.ribo@iohk.io")
organization.set("IOG")
roles.add("developer")
}
developer {
id.set("amagyar-iohk")
name.set("Allain Magyar")
email.set("allain.magyar@iohk.io")
organization.set("IOG")
roles.add("qc")
}
developer {
id.set("antonbaliasnikov")
name.set("Anton Baliasnikov")
email.set("anton.baliasnikov@iohk.io")
organization.set("IOG")
roles.add("qc")
}
developer {
id.set("goncalo-frade-iohk")
name.set("Gonçalo Frade")
email.set("goncalo.frade@iohk.io")
organization.set("IOG")
roles.add("developer")
}
}
scm {
connection.set("scm:git:git://hyperledger/identus-edge-agent-sdk-kmp.git")
developerConnection.set("scm:git:ssh://hyperledger/identus-edge-agent-sdk-kmp.git")
url.set("https://github.com/hyperledger/identus-edge-agent-sdk-kmp")
}
}
signing {
useInMemoryPgpKeys(
project.findProperty("signing.signingSecretKey") as String?
?: System.getenv("OSSRH_GPG_SECRET_KEY"),
project.findProperty("signing.signingSecretKeyPassword") as String?
?: System.getenv("OSSRH_GPG_SECRET_KEY_PASSWORD")
)
sign(this@withType)
}
}
}
}
}
}

nexusPublishing {
repositories {
sonatype {
nexusUrl.set(uri("https://oss.sonatype.org/service/local/"))
snapshotRepositoryUrl.set(uri("https://oss.sonatype.org/content/repositories/snapshots/"))
snapshotRepositoryUrl.set(uri("https://oss.sonatype.org/content/repositories/releases/"))
username.set(System.getenv("OSSRH_USERNAME"))
password.set(System.getenv("OSSRH_TOKEN"))
}
Expand Down
115 changes: 108 additions & 7 deletions edge-agent-sdk/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,107 @@ plugins {
id("com.android.library")
id("org.jetbrains.dokka")
id("org.jetbrains.kotlinx.kover") version "0.7.6"
id("org.gradle.maven-publish")
id("org.gradle.signing")
}

publishing {
repositories {
maven {
name = "OSSRH"
url = uri("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/")
credentials {
username = System.getenv("OSSRH_USERNAME")
password = System.getenv("OSSRH_TOKEN")
}
}
}
publications {
withType<MavenPublication> {
artifactId = project.name
version = project.version.toString()
pom {
name.set("Edge Agent SDK")
description.set(" Edge Agent SDK - Kotlin Multiplatform (Android/JVM)")
url.set("https://docs.atalaprism.io/")
organization {
name.set("Hyperledger")
url.set("https://hyperledger.org/")
}
issueManagement {
system.set("Github")
url.set("https://github.com/hyperledger/identus-edge-agent-sdk-kmp")
}
licenses {
license {
name.set("The Apache License, Version 2.0")
url.set("https://www.apache.org/licenses/LICENSE-2.0.txt")
}
}
developers {
developer {
id.set("cristianIOHK")
name.set("Cristian Gonzalez")
email.set("cristian.castro@iohk.io")
organization.set("IOG")
roles.add("developer")
url.set("https://github.com/cristianIOHK")
}
developer {
id.set("hamada147")
name.set("Ahmed Moussa")
email.set("ahmed.moussa@iohk.io")
organization.set("IOG")
roles.add("developer")
url.set("https://github.com/hamada147")
}
developer {
id.set("elribonazo")
name.set("Javier Ribó")
email.set("javier.ribo@iohk.io")
organization.set("IOG")
roles.add("developer")
}
developer {
id.set("amagyar-iohk")
name.set("Allain Magyar")
email.set("allain.magyar@iohk.io")
organization.set("IOG")
roles.add("qc")
}
developer {
id.set("antonbaliasnikov")
name.set("Anton Baliasnikov")
email.set("anton.baliasnikov@iohk.io")
organization.set("IOG")
roles.add("qc")
}
developer {
id.set("goncalo-frade-iohk")
name.set("Gonçalo Frade")
email.set("goncalo.frade@iohk.io")
organization.set("IOG")
roles.add("developer")
}
}
scm {
connection.set("scm:git:git://hyperledger/identus-edge-agent-sdk-kmp.git")
developerConnection.set("scm:git:ssh://hyperledger/identus-edge-agent-sdk-kmp.git")
url.set("https://github.com/hyperledger/identus-edge-agent-sdk-kmp")
}
}
}
}
}

if (System.getenv().containsKey("OSSRH_GPG_SECRET_KEY")) {
signing {
useInMemoryPgpKeys(
System.getenv("OSSRH_GPG_SECRET_KEY"),
System.getenv("OSSRH_GPG_SECRET_KEY_PASSWORD")
)
sign(publishing.publications)
}
}

kover {
Expand Down Expand Up @@ -80,9 +181,6 @@ kotlin {
jvmTarget = "17"
}
}
testRuns["test"].executionTask.configure {
useJUnitPlatform()
}
publishing {
publications {
withType<MavenPublication> {
Expand Down Expand Up @@ -145,10 +243,9 @@ kotlin {
}
val commonTest by getting {
dependencies {
implementation(kotlin("test"))
implementation(kotlin("test-junit"))
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.8.1")
implementation("io.ktor:ktor-client-mock:2.3.11")
implementation("junit:junit:4.13.2")
implementation("org.mockito:mockito-core:4.4.0")
implementation("org.mockito.kotlin:mockito-kotlin:4.0.0")
}
Expand All @@ -172,10 +269,8 @@ kotlin {
val androidInstrumentedTest by getting {
dependencies {
dependsOn(commonTest)
implementation(kotlin("test"))
implementation("androidx.test.espresso:espresso-core:3.5.1")
implementation("androidx.test.ext:junit:1.1.5")
implementation("junit:junit:4.13.2")
}
}
/*
Expand Down Expand Up @@ -285,6 +380,12 @@ val buildProtoLibsGen: Task by tasks.creating {
}

afterEvaluate {
tasks.withType<PublishToMavenRepository> {
dependsOn(tasks.withType<Sign>())
}
tasks.withType<PublishToMavenLocal> {
dependsOn(tasks.withType<Sign>())
}
tasks.getByName("runKtlintCheckOverCommonMainSourceSet") {
dependsOn(buildProtoLibsGen)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import org.hyperledger.identus.walletsdk.edgeagent.protocols.issueCredential.Off
import org.hyperledger.identus.walletsdk.edgeagent.protocols.proofOfPresentation.PresentationSubmission
import org.hyperledger.identus.walletsdk.edgeagent.protocols.proofOfPresentation.RequestPresentation
import org.hyperledger.identus.walletsdk.domain.models.KeyValue
import org.hyperledger.identus.walletsdk.logger.PrismLoggerMock
import org.hyperledger.identus.walletsdk.logger.LoggerMock
import org.hyperledger.identus.walletsdk.mercury.ApiMock
import org.hyperledger.identus.walletsdk.pollux.PolluxImpl
import org.hyperledger.identus.walletsdk.pollux.models.AnonCredential
Expand Down Expand Up @@ -114,7 +114,7 @@ class AnoncredsTests {
connectionManager = connectionManager,
seed = null,
api = ApiMock(statusCode = HttpStatusCode.OK, response = "{\"success\":\"true\"}"),
logger = PrismLoggerMock()
logger = LoggerMock()
)

val attachmentDescriptor =
Expand Down Expand Up @@ -192,7 +192,7 @@ class AnoncredsTests {
connectionManager = connectionManager,
seed = null,
api = ApiMock(HttpStatusCode.OK, "{\"success\":\"true\"}"),
logger = PrismLoggerMock()
logger = LoggerMock()
)

val attachmentDescriptor =
Expand Down Expand Up @@ -263,7 +263,7 @@ class AnoncredsTests {
connectionManager = connectionManagerMock,
seed = seed,
api = apiMock,
logger = PrismLoggerMock()
logger = LoggerMock()
)

val credential = AnonCredential.fromStorableData(
Expand Down Expand Up @@ -355,7 +355,7 @@ class AnoncredsTests {
connectionManager = connectionManagerMock,
seed = seed,
api = apiMock,
logger = PrismLoggerMock()
logger = LoggerMock()
)
)

Expand Down
Loading

0 comments on commit 3c59ee3

Please sign in to comment.