From 232f9d34f163a9bf61e57f80144936bebf4b8d36 Mon Sep 17 00:00:00 2001 From: Bassam Riman Date: Thu, 1 Feb 2024 16:01:23 -0500 Subject: [PATCH] fix(prism-agent): fix credential schema parsing as spec Signed-off-by: Bassam Riman --- .../pollux/core/model/schema/CredentialSchema.scala | 1 - .../core/service/CredentialDefinitionServiceImpl.scala | 2 +- .../pollux/core/service/PresentationServiceImpl.scala | 5 ----- .../anoncred-presentation-schema-example.json | 10 ---------- 4 files changed, 1 insertion(+), 17 deletions(-) delete mode 100644 pollux/lib/core/src/test/resources/anoncred-presentation-schema-example.json diff --git a/pollux/lib/core/src/main/scala/io/iohk/atala/pollux/core/model/schema/CredentialSchema.scala b/pollux/lib/core/src/main/scala/io/iohk/atala/pollux/core/model/schema/CredentialSchema.scala index 1881137ca9..ea77c80792 100644 --- a/pollux/lib/core/src/main/scala/io/iohk/atala/pollux/core/model/schema/CredentialSchema.scala +++ b/pollux/lib/core/src/main/scala/io/iohk/atala/pollux/core/model/schema/CredentialSchema.scala @@ -13,7 +13,6 @@ import io.iohk.atala.pollux.core.service.URIDereferencer import zio.* import zio.json.* import zio.json.ast.Json -import zio.prelude.Validation import java.net.URI import java.time.{OffsetDateTime, ZoneOffset} diff --git a/pollux/lib/core/src/main/scala/io/iohk/atala/pollux/core/service/CredentialDefinitionServiceImpl.scala b/pollux/lib/core/src/main/scala/io/iohk/atala/pollux/core/service/CredentialDefinitionServiceImpl.scala index 219bd43aec..a7ec38bb81 100644 --- a/pollux/lib/core/src/main/scala/io/iohk/atala/pollux/core/service/CredentialDefinitionServiceImpl.scala +++ b/pollux/lib/core/src/main/scala/io/iohk/atala/pollux/core/service/CredentialDefinitionServiceImpl.scala @@ -5,10 +5,10 @@ import io.iohk.atala.agent.walletapi.storage.GenericSecretStorage import io.iohk.atala.pollux.anoncreds.{AnoncredLib, SchemaDef} import io.iohk.atala.pollux.core.model.error.CredentialSchemaError import io.iohk.atala.pollux.core.model.error.CredentialSchemaError.URISyntaxError +import io.iohk.atala.pollux.core.model.schema.CredentialDefinition import io.iohk.atala.pollux.core.model.schema.CredentialDefinition.{Filter, FilteredEntries} import io.iohk.atala.pollux.core.model.schema.`type`.anoncred.AnoncredSchemaSerDesV1 import io.iohk.atala.pollux.core.model.schema.validator.JsonSchemaError -import io.iohk.atala.pollux.core.model.schema.{CredentialDefinition, CredentialSchema} import io.iohk.atala.pollux.core.model.secret.CredentialDefinitionSecret import io.iohk.atala.pollux.core.repository.CredentialDefinitionRepository import io.iohk.atala.pollux.core.repository.Repository.SearchQuery diff --git a/pollux/lib/core/src/main/scala/io/iohk/atala/pollux/core/service/PresentationServiceImpl.scala b/pollux/lib/core/src/main/scala/io/iohk/atala/pollux/core/service/PresentationServiceImpl.scala index 927ff7e58e..8022b26ea9 100644 --- a/pollux/lib/core/src/main/scala/io/iohk/atala/pollux/core/service/PresentationServiceImpl.scala +++ b/pollux/lib/core/src/main/scala/io/iohk/atala/pollux/core/service/PresentationServiceImpl.scala @@ -8,19 +8,14 @@ import io.circe.syntax.* import io.iohk.atala.mercury.model.* import io.iohk.atala.mercury.protocol.presentproof.* import io.iohk.atala.pollux.core.model.* -import io.iohk.atala.pollux.core.model.error.CredentialSchemaError.CredentialSchemaParsingError import io.iohk.atala.pollux.core.model.error.PresentationError import io.iohk.atala.pollux.core.model.error.PresentationError.* import io.iohk.atala.pollux.core.model.presentation.* -import io.iohk.atala.pollux.core.model.schema.CredentialDefinition -import io.iohk.atala.pollux.core.model.schema.`type`.anoncred.AnoncredSchemaSerDesV1 import io.iohk.atala.pollux.core.repository.{CredentialRepository, PresentationRepository} import io.iohk.atala.pollux.vc.jwt.* import io.iohk.atala.shared.models.WalletAccessContext import io.iohk.atala.shared.utils.aspects.CustomMetricsAspect import zio.* -import zio.{ZIO, *} -import zio.json.* import java.rmi.UnexpectedException import java.time.Instant diff --git a/pollux/lib/core/src/test/resources/anoncred-presentation-schema-example.json b/pollux/lib/core/src/test/resources/anoncred-presentation-schema-example.json deleted file mode 100644 index febd78d65d..0000000000 --- a/pollux/lib/core/src/test/resources/anoncred-presentation-schema-example.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "resource:///anoncred-presentation-schema-example.json", - "version": "1.0", - "attrNames": [ - "name", - "sex", - "age" - ], - "issuerId": "did:prism:issuer" -} \ No newline at end of file