Skip to content

Commit

Permalink
fix: createCredentialIssueRecordRequest schemaId field to be Option[S…
Browse files Browse the repository at this point in the history
…tring] (#1481)

Signed-off-by: Yurii Shynbuiev <[email protected]>
  • Loading branch information
yshyn-iohk authored Dec 16, 2024
1 parent 2fb833a commit 7524ec7
Show file tree
Hide file tree
Showing 12 changed files with 13 additions and 243 deletions.
6 changes: 0 additions & 6 deletions cloud-agent/client/kotlin/.openapi-generator-ignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ src/main/kotlin/org/hyperledger/identus/client/models/DateTimeParameter.kt
src/main/kotlin/org/hyperledger/identus/client/models/DidParameter.kt
src/main/kotlin/org/hyperledger/identus/client/models/VcVerificationParameter.kt

src/main/kotlin/org/hyperledger/identus/client/models/CreateIssueCredentialRecordRequest.kt
src/main/kotlin/org/hyperledger/identus/client/models/CreateIssueCredentialRecordRequestSchemaId.kt

src/test/kotlin/org/hyperledger/identus/client/models/UpdateManagedDIDServiceActionTest.kt
src/test/kotlin/org/hyperledger/identus/client/models/UpdateManagedDIDServiceActionTypeTest.kt

Expand All @@ -29,6 +26,3 @@ src/test/kotlin/org/hyperledger/identus/client/models/ServiceTypeTest.kt
src/test/kotlin/org/hyperledger/identus/client/models/StatusPurposeTest.kt
src/test/kotlin/org/hyperledger/identus/client/models/CredentialSubjectTest.kt

src/test/kotlin/org/hyperledger/identus/client/models/CreateIssueCredentialRecordRequestTest.kt
src/test/kotlin/org/hyperledger/identus/client/models/CreateIssueCredentialRecordRequestSchemaIdTest.kt

This file was deleted.

1 change: 0 additions & 1 deletion cloud-agent/client/typescript/.openapi-generator-ignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@ models/CredentialRequest.ts
models/Proof2.ts
models/Service.ts
models/UpdateManagedDIDServiceAction.ts
models/CreateIssueCredentialRecordRequest.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ trait CredentialSchemaReferenceParsingLogic {
// The "type" property in the "credentialSchema" object must be "JsonSchemaValidator2018".
// Multiple schemas are not allowed in VCDM 1.1.
def parseCredentialSchemaRef_VCDM1_1(
deprecatedSchemaIdProperty: Option[String | List[String]],
deprecatedSchemaIdProperty: Option[String],
credentialSchemaRefOption: Option[HTTPCredentialSchemaRef]
): IO[ErrorResponse, DomainCredentialSchemaRef] = {
credentialSchemaRefOption match {
Expand All @@ -31,7 +31,7 @@ trait CredentialSchemaReferenceParsingLogic {
}

def parseSchemaIdForAnonCredsModelV1(
deprecatedSchemaIdProperty: Option[String | List[String]],
deprecatedSchemaIdProperty: Option[String],
schemaIdProperty: Option[String]
): IO[ErrorResponse, UriString] = {
schemaIdProperty
Expand All @@ -40,13 +40,11 @@ trait CredentialSchemaReferenceParsingLogic {
}

private def handleDeprecatedSchemaId(
deprecatedSchemaIdProperty: Option[String | List[String]]
deprecatedSchemaIdProperty: Option[String]
): IO[ErrorResponse, String] = {
deprecatedSchemaIdProperty match {
case Some(schemaId: String) =>
ZIO.succeed(schemaId)
case Some(_: List[String]) =>
ZIO.fail(ErrorResponse.badRequest(detail = Some("Multiple credential schemas are not allowed.")))
case None =>
ZIO.fail(ErrorResponse.badRequest(detail = Some("Credential schema property missed.")))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ final case class CreateIssueCredentialRecordRequest(
@description(annotations.schemaId.description)
@encodedExample(annotations.schemaId.example)
@deprecated("Use anoncredsVcPropertiesV1.schemaId instead", "2.0.0")
schemaId: Option[String | List[String]] = None,
schemaId: Option[String] = None,
@description(annotations.credentialDefinitionId.description)
@encodedExample(annotations.credentialDefinitionId.example)
@deprecated("Use anoncredsVcPropertiesV1.credentialDefinitionId instead", "2.0.0")
Expand Down
2 changes: 1 addition & 1 deletion tests/integration-tests/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ dependencies {
testImplementation("io.ktor:ktor-server-netty:2.3.0")
testImplementation("io.ktor:ktor-client-apache:2.3.0")
// RestAPI client
testImplementation("org.hyperledger.identus:cloud-agent-client-kotlin:1.39.1-19ab426")
testImplementation("org.hyperledger.identus:cloud-agent-client-kotlin:1.40.1-d092f31")
// Test helpers library
testImplementation("io.iohk.atala:atala-automation:0.4.0")
// Hoplite for configuration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class ConnectionLessSteps {
issuer.recall("longFormDid")
}
val credentialOfferRequest = CreateIssueCredentialRecordRequest(
schemaId = schemaId?.let { listOf(it) },
schemaId = schemaId,
claims = claims,
issuingDID = did,
issuingKid = "assertion-1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class JwtCredentialSteps {
}

val credentialOfferRequest = CreateIssueCredentialRecordRequest(
schemaId = schemaId?.let { listOf(it) },
schemaId = schemaId,
claims = claims,
issuingDID = did,
issuingKid = issuingKid,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class SdJwtCredentialSteps {
}

val credentialOfferRequest = CreateIssueCredentialRecordRequest(
schemaId = schemaId?.let { listOf(it) },
schemaId = schemaId,
claims = CredentialSchema.ID_SCHEMA.claims,
issuingDID = did,
connectionId = connectionId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"webpack": "webpack"
},
"dependencies": {
"@hyperledger/identus-cloud-agent-client-ts": "^1.40.0",
"@hyperledger/identus-cloud-agent-client-ts": "^1.40.1-d092f31",
"uuid": "^9.0.0"
}
}
8 changes: 4 additions & 4 deletions tests/performance-tests/agent-performance-tests-k6/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -993,10 +993,10 @@
resolved "https://registry.yarnpkg.com/@discoveryjs/json-ext/-/json-ext-0.5.7.tgz#1d572bfbbe14b7704e0ba0f39b74815b84870d70"
integrity sha512-dBVuXR082gk3jsFp7Rd/JI4kytwGHecnCoTtXFb7DB6CNHp4rg5k1bhg0nWdLGLnOV71lmDzGQaLMy8iPLY0pw==

"@hyperledger/identus-cloud-agent-client-ts@^1.40.0":
version "1.40.0"
resolved "https://npm.pkg.github.com/download/@hyperledger/identus-cloud-agent-client-ts/1.40.0/ce8120a0483b02cda6aa348dd7e2f175c7a5b846#ce8120a0483b02cda6aa348dd7e2f175c7a5b846"
integrity sha512-uvxDYP8lJM7Dl7HMSX44fodVOxUaqsXy4WfNL2pdVCNBOksGFyAmxcAOlU8VNoCTCtKowyoPBnCK6zl9jyhgIw==
"@hyperledger/identus-cloud-agent-client-ts@^1.40.1-d092f31":
version "1.40.1-d092f31"
resolved "https://npm.pkg.github.com/download/@hyperledger/identus-cloud-agent-client-ts/1.40.1-d092f31/4bc6944b9b4141337ffdb5b139a33a202cadab6a#4bc6944b9b4141337ffdb5b139a33a202cadab6a"
integrity sha512-tXsUf/zalpTwK0x5ydD8zJTcp4aV9cnTZPoCmoywhIY3EP+jwUA/NRROjbrNpmu6jajssj6U5xKeHKoBEkrumg==
dependencies:
es6-promise "^4.2.4"
url-parse "^1.4.3"
Expand Down

0 comments on commit 7524ec7

Please sign in to comment.