From 490e9703b9ae8c4184f568e6b1b1c9be47057471 Mon Sep 17 00:00:00 2001 From: Cristian G Date: Wed, 25 Sep 2024 14:46:12 -0400 Subject: [PATCH] fix: linting issues Signed-off-by: Cristian G --- .../identus/walletsdk/apollo/ApolloImpl.kt | 1 - .../walletsdk/edgeagent/EdgeAgentError.kt | 2 -- .../walletsdk/pollux/DescriptorPath.kt | 2 +- .../identus/walletsdk/pollux/PolluxImpl.kt | 3 +-- .../pollux/models/SDJWTCredential.kt | 21 ------------------- 5 files changed, 2 insertions(+), 27 deletions(-) diff --git a/edge-agent-sdk/src/commonMain/kotlin/org/hyperledger/identus/walletsdk/apollo/ApolloImpl.kt b/edge-agent-sdk/src/commonMain/kotlin/org/hyperledger/identus/walletsdk/apollo/ApolloImpl.kt index 5fe04dea8..89d6ea35b 100644 --- a/edge-agent-sdk/src/commonMain/kotlin/org/hyperledger/identus/walletsdk/apollo/ApolloImpl.kt +++ b/edge-agent-sdk/src/commonMain/kotlin/org/hyperledger/identus/walletsdk/apollo/ApolloImpl.kt @@ -38,7 +38,6 @@ import org.hyperledger.identus.walletsdk.domain.models.keyManagement.PublicKey import org.hyperledger.identus.walletsdk.domain.models.keyManagement.RawKey import org.hyperledger.identus.walletsdk.domain.models.keyManagement.SeedKey import org.hyperledger.identus.walletsdk.domain.models.keyManagement.StorableKey -import org.hyperledger.identus.walletsdk.domain.models.keyManagement.StorablePrivateKey import org.hyperledger.identus.walletsdk.domain.models.keyManagement.TypeKey import org.hyperledger.identus.walletsdk.logger.LogComponent import org.hyperledger.identus.walletsdk.logger.LogLevel diff --git a/edge-agent-sdk/src/commonMain/kotlin/org/hyperledger/identus/walletsdk/edgeagent/EdgeAgentError.kt b/edge-agent-sdk/src/commonMain/kotlin/org/hyperledger/identus/walletsdk/edgeagent/EdgeAgentError.kt index 6b3f71ff6..f2c7065da 100644 --- a/edge-agent-sdk/src/commonMain/kotlin/org/hyperledger/identus/walletsdk/edgeagent/EdgeAgentError.kt +++ b/edge-agent-sdk/src/commonMain/kotlin/org/hyperledger/identus/walletsdk/edgeagent/EdgeAgentError.kt @@ -4,8 +4,6 @@ import org.hyperledger.identus.walletsdk.domain.models.Credential import org.hyperledger.identus.walletsdk.domain.models.CredentialType import org.hyperledger.identus.walletsdk.domain.models.Error import org.hyperledger.identus.walletsdk.domain.models.KnownPrismError -import kotlin.reflect.KClass -import kotlin.reflect.jvm.internal.impl.load.java.structure.JavaClass sealed class EdgeAgentError : KnownPrismError() { diff --git a/edge-agent-sdk/src/commonMain/kotlin/org/hyperledger/identus/walletsdk/pollux/DescriptorPath.kt b/edge-agent-sdk/src/commonMain/kotlin/org/hyperledger/identus/walletsdk/pollux/DescriptorPath.kt index 3064b62b6..f079b4a44 100644 --- a/edge-agent-sdk/src/commonMain/kotlin/org/hyperledger/identus/walletsdk/pollux/DescriptorPath.kt +++ b/edge-agent-sdk/src/commonMain/kotlin/org/hyperledger/identus/walletsdk/pollux/DescriptorPath.kt @@ -17,7 +17,7 @@ import kotlinx.serialization.json.longOrNull class DescriptorPath(private val jsonElement: JsonElement) { - fun getValue (path: String): Any? { + fun getValue(path: String): Any? { val regex = Regex("[/\\[\\]`.]+") val segments = path.split(regex).filter { it.isNotEmpty() } diff --git a/edge-agent-sdk/src/commonMain/kotlin/org/hyperledger/identus/walletsdk/pollux/PolluxImpl.kt b/edge-agent-sdk/src/commonMain/kotlin/org/hyperledger/identus/walletsdk/pollux/PolluxImpl.kt index 4b98b69f1..8d54685fc 100644 --- a/edge-agent-sdk/src/commonMain/kotlin/org/hyperledger/identus/walletsdk/pollux/PolluxImpl.kt +++ b/edge-agent-sdk/src/commonMain/kotlin/org/hyperledger/identus/walletsdk/pollux/PolluxImpl.kt @@ -104,9 +104,9 @@ import org.hyperledger.identus.walletsdk.edgeagent.protocols.proofOfPresentation import org.hyperledger.identus.walletsdk.edgeagent.protocols.proofOfPresentation.PresentationSubmissionOptionsJWT import org.hyperledger.identus.walletsdk.edgeagent.protocols.proofOfPresentation.PresentationSubmissionOptionsSDJWT import org.hyperledger.identus.walletsdk.edgeagent.protocols.proofOfPresentation.SDJWTPresentationOptions +import org.hyperledger.identus.walletsdk.logger.LogComponent import org.hyperledger.identus.walletsdk.logger.Logger import org.hyperledger.identus.walletsdk.logger.LoggerImpl -import org.hyperledger.identus.walletsdk.logger.LogComponent import org.hyperledger.identus.walletsdk.pluto.RestorationID import org.hyperledger.identus.walletsdk.pollux.models.AnonCredential import org.hyperledger.identus.walletsdk.pollux.models.AnoncredsPresentationDefinitionRequest @@ -1247,7 +1247,6 @@ open class PolluxImpl( val inputDescriptor = inputDescriptors.find { it.id == descriptorItem.id } verifyInputDescriptors(inputDescriptor, Json.encodeToJsonElement(verifiableCredential)) - } ?: throw PolluxError.VerificationUnsuccessful("Invalid submission, no value found for $pathNested") return true } diff --git a/edge-agent-sdk/src/commonMain/kotlin/org/hyperledger/identus/walletsdk/pollux/models/SDJWTCredential.kt b/edge-agent-sdk/src/commonMain/kotlin/org/hyperledger/identus/walletsdk/pollux/models/SDJWTCredential.kt index 3d1ae2352..c779a2e81 100644 --- a/edge-agent-sdk/src/commonMain/kotlin/org/hyperledger/identus/walletsdk/pollux/models/SDJWTCredential.kt +++ b/edge-agent-sdk/src/commonMain/kotlin/org/hyperledger/identus/walletsdk/pollux/models/SDJWTCredential.kt @@ -1,30 +1,13 @@ package org.hyperledger.identus.walletsdk.pollux.models -import com.nimbusds.jose.JOSEObjectType -import com.nimbusds.jose.JWSAlgorithm -import com.nimbusds.jose.crypto.ECDSASigner -import com.nimbusds.jwt.SignedJWT -import eu.europa.ec.eudi.sdjwt.ClaimValidations.primitiveClaim import eu.europa.ec.eudi.sdjwt.JsonPointer import eu.europa.ec.eudi.sdjwt.JwtAndClaims import eu.europa.ec.eudi.sdjwt.JwtSignatureVerifier import eu.europa.ec.eudi.sdjwt.NoSignatureValidation import eu.europa.ec.eudi.sdjwt.SdJwt -import eu.europa.ec.eudi.sdjwt.SdJwtFactory -import eu.europa.ec.eudi.sdjwt.SdJwtIssuer import eu.europa.ec.eudi.sdjwt.SdJwtVerifier -import eu.europa.ec.eudi.sdjwt.exp -import eu.europa.ec.eudi.sdjwt.iat -import eu.europa.ec.eudi.sdjwt.iss -import eu.europa.ec.eudi.sdjwt.name -import eu.europa.ec.eudi.sdjwt.nimbus -import eu.europa.ec.eudi.sdjwt.plain import eu.europa.ec.eudi.sdjwt.present -import eu.europa.ec.eudi.sdjwt.recreateClaims -import eu.europa.ec.eudi.sdjwt.sd -import eu.europa.ec.eudi.sdjwt.sdJwt import eu.europa.ec.eudi.sdjwt.serialize -import eu.europa.ec.eudi.sdjwt.sub import kotlinx.coroutines.runBlocking import kotlinx.serialization.ExperimentalSerializationApi import kotlinx.serialization.Transient @@ -44,11 +27,7 @@ import org.hyperledger.identus.walletsdk.domain.models.CredentialOperationsOptio import org.hyperledger.identus.walletsdk.domain.models.PolluxError import org.hyperledger.identus.walletsdk.domain.models.ProvableCredential import org.hyperledger.identus.walletsdk.domain.models.StorableCredential -import org.hyperledger.identus.walletsdk.domain.models.keyManagement.PrivateKey -import org.hyperledger.identus.walletsdk.domain.models.keyManagement.SignableKey -import java.security.interfaces.ECPrivateKey import java.util.* -import kotlinx.serialization.json.put @OptIn(ExperimentalSerializationApi::class) data class SDJWTCredential(