Skip to content

Commit

Permalink
chore: cleanup some todos, imports (#1223)
Browse files Browse the repository at this point in the history
Signed-off-by: Pat Losoponkul <[email protected]>
  • Loading branch information
patlo-iog authored Jun 25, 2024
1 parent 5398a75 commit 68626ed
Show file tree
Hide file tree
Showing 49 changed files with 36 additions and 86 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ package org.hyperledger.identus.castor.core.model.did
import org.hyperledger.identus.castor.core.util.GenUtils
import zio.*
import zio.test.*
import zio.test.assert
import zio.test.Assertion.*
import zio.test.Assertion.isLeft

object DIDUrlSpec extends ZIOSpecDefault {
override def spec = suite("DIDUrl")(fromStringSpec)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import org.hyperledger.identus.shared.models.Base64UrlString
import zio.*
import zio.test.Gen

import java.net.URI
import scala.language.implicitConversions

object GenUtils {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import org.hyperledger.identus.iam.authentication.apikey.ApiKeyAuthenticator
import org.hyperledger.identus.iam.entity.http.EntityServerEndpoints
import org.hyperledger.identus.iam.wallet.http.WalletManagementServerEndpoints
import org.hyperledger.identus.issue.controller.IssueServerEndpoints
import org.hyperledger.identus.mercury.{DidAgent, DidOps, HttpClient}
import org.hyperledger.identus.mercury.{DidOps, HttpClient}
import org.hyperledger.identus.oid4vci.CredentialIssuerServerEndpoints
import org.hyperledger.identus.pollux.core.service.{CredentialService, PresentationService}
import org.hyperledger.identus.pollux.credentialdefinition.CredentialDefinitionRegistryServerEndpoints
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ import org.hyperledger.identus.mercury.*
import org.hyperledger.identus.mercury.model.*
import org.hyperledger.identus.mercury.model.error.TransportError
import org.hyperledger.identus.mercury.protocol.presentproof.*
import org.hyperledger.identus.mercury.protocol.reportproblem.v2.ProblemCode
import org.hyperledger.identus.mercury.protocol.reportproblem.v2.ReportProblem
import org.hyperledger.identus.mercury.protocol.reportproblem.v2.{ProblemCode, ReportProblem}
import org.hyperledger.identus.pollux.core.model.*
import org.hyperledger.identus.pollux.core.model.error.{CredentialServiceError, PresentationError}
import org.hyperledger.identus.pollux.core.model.error.PresentationError.*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.hyperledger.identus.api.http

import sttp.model.StatusCode
import sttp.tapir.{oneOfVariantValueMatcher, *}
import sttp.tapir.*
import sttp.tapir.json.zio.jsonBody
import sttp.tapir.EndpointOutput.OneOfVariant

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package org.hyperledger.identus.credentialstatus.controller.http

import org.hyperledger.identus.api.http.Annotation
import org.hyperledger.identus.credentialstatus.controller.http.StatusListCredential.annotations
import org.hyperledger.identus.pollux.core.model.error.CredentialStatusListServiceError
import org.hyperledger.identus.pollux.core.model.CredentialStatusList
import org.hyperledger.identus.pollux.vc.jwt.StatusPurpose
import sttp.tapir.json.zio.schemaForZioJsonValue
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package org.hyperledger.identus.didcomm.controller
import org.hyperledger.identus.api.http.{ErrorResponse, RequestContext}
import org.hyperledger.identus.api.http.EndpointOutputs.{basicFailuresWith, FailureVariant}
import org.hyperledger.identus.didcomm.controller.http.DIDCommMessage
import sttp.tapir.{endpoint, PublicEndpoint, *}
import sttp.tapir.*
import sttp.tapir.json.zio.jsonBody

object DIDCommEndpoints {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import io.getquill.context.json.PostgresJsonExtensions
import io.getquill.doobie.DoobieContext
import org.hyperledger.identus.iam.authentication.apikey.AuthenticationRepositoryError.AuthenticationCompromised
import org.hyperledger.identus.shared.models.{Failure, StatusCode}
import zio.{IO, *}
import zio.*
import zio.interop.catz.*

import java.time.OffsetDateTime
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package org.hyperledger.identus.iam.authorization.core

import org.hyperledger.identus.agent.walletapi.model.error.EntityServiceError
import org.hyperledger.identus.agent.walletapi.model.BaseEntity
import org.hyperledger.identus.shared.models.{WalletAdministrationContext, WalletId}
import zio.*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package org.hyperledger.identus.iam.entity.http.controller

import org.hyperledger.identus.agent.walletapi.model.error.EntityServiceError
import org.hyperledger.identus.api.http.{ErrorResponse, RequestContext}
import org.hyperledger.identus.api.http.model.PaginationInput
import org.hyperledger.identus.iam.entity.http.model.{CreateEntityRequest, EntityResponse, EntityResponsePage}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package org.hyperledger.identus.iam.wallet.http

import org.hyperledger.identus.api.http.{EndpointOutputs, ErrorResponse, RequestContext}
import org.hyperledger.identus.api.http.model.PaginationInput
import org.hyperledger.identus.api.http.EndpointOutputs.FailureVariant
import org.hyperledger.identus.iam.authentication.admin.AdminApiKeyCredentials
import org.hyperledger.identus.iam.authentication.admin.AdminApiKeySecurityLogic.adminApiKeyHeader
import org.hyperledger.identus.iam.authentication.apikey.ApiKeyCredentials
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
package org.hyperledger.identus.iam.wallet.http.controller

import org.hyperledger.identus.agent.walletapi.model.{BaseEntity, Wallet, WalletSeed}
import org.hyperledger.identus.agent.walletapi.service.{WalletManagementService, WalletManagementServiceError}
import org.hyperledger.identus.agent.walletapi.service.WalletManagementServiceError.TooManyPermittedWallet
import org.hyperledger.identus.agent.walletapi.service.WalletManagementService
import org.hyperledger.identus.api.http.{ErrorResponse, RequestContext}
import org.hyperledger.identus.api.http.model.{CollectionStats, PaginationInput}
import org.hyperledger.identus.api.util.PaginationUtils
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ import org.hyperledger.identus.pollux.core.model.{CredentialFormat, DidCommID}
import org.hyperledger.identus.pollux.core.model.CredentialFormat.{AnonCreds, JWT, SDJWT}
import org.hyperledger.identus.pollux.core.model.IssueCredentialRecord.Role
import org.hyperledger.identus.pollux.core.service.CredentialService
import org.hyperledger.identus.shared.models.KeyId
import org.hyperledger.identus.shared.models.WalletAccessContext
import org.hyperledger.identus.shared.models.{KeyId, WalletAccessContext}
import zio.{URLayer, ZIO, ZLayer}

import scala.language.implicitConversions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package org.hyperledger.identus.issue.controller.http

import org.hyperledger.identus.api.http.Annotation
import org.hyperledger.identus.issue.controller.http.AcceptCredentialOfferRequest.annotations
import org.hyperledger.identus.shared.models.KeyId
import sttp.tapir.{Schema, Validator}
import sttp.tapir.Schema.annotations.{description, encodedExample, validate}
import zio.json.{DeriveJsonDecoder, DeriveJsonEncoder, JsonDecoder, JsonEncoder}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package org.hyperledger.identus.oid4vci
import org.hyperledger.identus.agent.walletapi.model.BaseEntity
import org.hyperledger.identus.api.http.ErrorResponse
import org.hyperledger.identus.iam.authentication.{
AuthenticationError,
Authenticator,
Authorizer,
DefaultAuthenticator,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.hyperledger.identus.oid4vci.domain

import com.nimbusds.jose.{JOSEObjectType, JWSAlgorithm, JWSHeader, JWSObject, JWSSigner, Payload}
import org.hyperledger.identus.castor.core.model.did.{DID, DIDUrl, LongFormPrismDID}
import org.hyperledger.identus.castor.core.model.did.DIDUrl
import org.hyperledger.identus.pollux.vc.jwt.JWT
import org.hyperledger.identus.pollux.vc.jwt.JwtSignerImplicits.*
import org.hyperledger.identus.shared.crypto.Secp256k1PrivateKey
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@ case class OIDCCredentialIssuerServiceImpl(
.mapError(dre => InvalidProof(dre.message))
publicKey <- JWTVerification.extractPublicKey(verificationMethod).toZIO.mapError(InvalidProof.apply)
_ <- JWTVerification.validateEncodedJwt(jwt, publicKey).toZIO.mapError(InvalidProof.apply)
_ <- ZIO.succeed(println(s"JWT proof is verified: ${jwt.value}")) // TODO: remove before the release
} yield true
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import org.hyperledger.identus.pollux.core.service.PresentationService
import org.hyperledger.identus.presentproof.controller.http.*
import org.hyperledger.identus.presentproof.controller.PresentProofController.toDidCommID
import org.hyperledger.identus.shared.models.WalletAccessContext
import zio.{URLayer, ZIO, ZLayer, *}
import zio.*
import zio.json.*
import zio.json.ast.Json

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import org.hyperledger.identus.pollux.core.service
import org.hyperledger.identus.pollux.core.service.verification.VcVerification as ServiceVcVerification
import sttp.tapir.Schema
import sttp.tapir.Schema.annotations.description
import zio.{IO, *}
import zio.*
import zio.json.{JsonDecoder, JsonEncoder}

/** Enum representing the various types of verifications that can be performed on a verifiable credential.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import org.hyperledger.identus.shared.models.{WalletAccessContext, WalletAdminis
import org.hyperledger.identus.sharedtest.containers.PostgresTestContainerSupport
import org.hyperledger.identus.test.container.DBTestUtils
import zio.*
import zio.test.{ZIOSpecDefault, *}
import zio.test.*
import zio.test.Assertion.*

import java.net.{URI, URL}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package org.hyperledger.identus.agent.server.config
import monocle.syntax.all.*
import org.hyperledger.identus.agent.server.SystemModule
import zio.*
import zio.test.{ZIOSpecDefault, *}
import zio.test.*
import zio.test.Assertion.*

object AppConfigSpec extends ZIOSpecDefault {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import org.hyperledger.identus.shared.crypto.Apollo
import org.hyperledger.identus.shared.models.{WalletAdministrationContext, WalletId}
import org.hyperledger.identus.sharedtest.containers.PostgresTestContainerSupport
import zio.{Scope, ULayer, ZIO, ZLayer}
import zio.test.{assert, Spec, TestEnvironment, ZIOSpecDefault, *}
import zio.test.*
import zio.test.Assertion.*
import zio.test.TestAspect.sequential
import zio.Runtime.removeDefaultLoggers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package org.hyperledger.identus.iam.authentication.apikey
import org.hyperledger.identus.container.util.MigrationAspects.migrate
import org.hyperledger.identus.iam.authentication.apikey.AuthenticationMethodType.ApiKey
import org.hyperledger.identus.sharedtest.containers.PostgresTestContainerSupport
import zio.test.{TestAspect, ZIOSpecDefault, *}
import zio.test.*
import zio.test.Assertion.*
import zio.test.TestAspect.*
import zio.Runtime.removeDefaultLoggers
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
package org.hyperledger.identus.iam.authorization.keycloak.admin

import org.hyperledger.identus.agent.walletapi.model.Wallet
import org.hyperledger.identus.agent.walletapi.service.{
WalletManagementService,
WalletManagementServiceError,
WalletManagementServiceImpl
}
import org.hyperledger.identus.agent.walletapi.service.{WalletManagementService, WalletManagementServiceImpl}
import org.hyperledger.identus.agent.walletapi.sql.{JdbcWalletNonSecretStorage, JdbcWalletSecretStorage}
import org.hyperledger.identus.iam.authentication.oidc.*
import org.hyperledger.identus.iam.authentication.AuthenticationError.ResourceNotPermitted
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import org.hyperledger.identus.pollux.credentialschema.*
import org.hyperledger.identus.pollux.credentialschema.controller.CredentialSchemaController
import org.hyperledger.identus.pollux.credentialschema.http.{CredentialSchemaInput, CredentialSchemaResponse}
import sttp.client3.basicRequest
import sttp.client3.ziojson.{asJsonAlways, *}
import sttp.client3.ziojson.*
import sttp.model.StatusCode
import zio.*
import zio.json.*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import org.hyperledger.identus.castor.core.model.did.{
import org.hyperledger.identus.mercury.model.DidId
import org.hyperledger.identus.mercury.PeerDID
import org.hyperledger.identus.shared.crypto.{Ed25519KeyPair, Secp256k1KeyPair, X25519KeyPair}
import zio.{mock, *}
import zio.*
import zio.mock.*
import zio.test.Assertion

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import org.hyperledger.identus.agent.walletapi.model.{
UpdateManagedDIDAction,
WalletSeed
}
import org.hyperledger.identus.agent.walletapi.model.error.{UpdateManagedDIDError, *}
import org.hyperledger.identus.agent.walletapi.model.error.*
import org.hyperledger.identus.agent.walletapi.model.error.given
import org.hyperledger.identus.agent.walletapi.storage.{DIDNonSecretStorage, DIDSecretStorage, WalletSecretStorage}
import org.hyperledger.identus.agent.walletapi.util.OperationFactory
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.hyperledger.identus.mercury

import io.circe.{JsonObject, *}
import io.circe.*
import org.hyperledger.identus.mercury.model.*
import org.hyperledger.identus.mercury.model.error.*
import org.hyperledger.identus.mercury.protocol.routing.*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.hyperledger.identus.mercury.protocol.reportproblem.v2

import io.circe.{Decoder, Encoder, *}
import io.circe.*
import io.circe.generic.semiauto.{deriveDecoder, deriveEncoder}
import io.circe.syntax.*
import org.hyperledger.identus.mercury.model.{DidId, Message, PIURI}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.hyperledger.identus.mercury.protocol.reportproblem.v2

import io.circe.{Json, *}
import io.circe.*
import io.circe.parser.*
import io.circe.syntax.*
import munit.*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package org.hyperledger.identus.pollux.core.model.error

import org.hyperledger.identus.pollux.core.model.error.CredentialSchemaError
import org.hyperledger.identus.pollux.core.model.schema.CredentialSchema
import org.hyperledger.identus.pollux.core.model.schema.CredentialSchema.*
import org.hyperledger.identus.shared.models.{Failure, StatusCode}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ import org.hyperledger.identus.mercury.protocol.issuecredential.{IssueCredential
import org.hyperledger.identus.pollux.anoncreds.AnoncredCredentialRequestMetadata
import org.hyperledger.identus.pollux.core.model.*
import org.hyperledger.identus.pollux.core.model.IssueCredentialRecord.ProtocolState
import org.hyperledger.identus.shared.models.KeyId
import org.hyperledger.identus.shared.models.WalletAccessContext
import org.hyperledger.identus.shared.models.{KeyId, WalletAccessContext}
import zio.*

trait CredentialRepository {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ import org.hyperledger.identus.mercury.protocol.issuecredential.{IssueCredential
import org.hyperledger.identus.pollux.anoncreds.AnoncredCredentialRequestMetadata
import org.hyperledger.identus.pollux.core.model.*
import org.hyperledger.identus.pollux.core.model.IssueCredentialRecord.ProtocolState
import org.hyperledger.identus.shared.models.{WalletAccessContext, WalletId}
import org.hyperledger.identus.shared.models.KeyId
import org.hyperledger.identus.shared.models.{KeyId, WalletAccessContext, WalletId}
import zio.*

import java.time.Instant
Expand Down
Original file line number Diff line number Diff line change
@@ -1,29 +1,13 @@
package org.hyperledger.identus.pollux.core.repository

import cats.data.NonEmptyList
import doobie.*
import doobie.free.connection
import doobie.implicits.*
import doobie.postgres.*
import doobie.postgres.circe.json.implicits.*
import doobie.postgres.implicits.*
import io.circe
import io.circe.*
import io.circe.parser.*
import io.circe.syntax.*
import org.hyperledger.identus.mercury.protocol.presentproof.*
import org.hyperledger.identus.pollux.core.model.*
import org.hyperledger.identus.pollux.core.model.error.PresentationError.*
import org.hyperledger.identus.pollux.core.model.PresentationRecord.ProtocolState
import org.hyperledger.identus.pollux.core.repository.PresentationRepository
import org.hyperledger.identus.shared.db.ContextAwareTask
import org.hyperledger.identus.shared.db.Implicits.*
import org.hyperledger.identus.shared.models.{WalletAccessContext, WalletId}
import zio.*
import zio.interop.catz.*
import zio.json.*
import zio.json.ast.Json
import zio.json.ast.Json.*

import java.time.Instant

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ import org.hyperledger.identus.pollux.core.model.*
import org.hyperledger.identus.pollux.core.model.error.CredentialServiceError
import org.hyperledger.identus.pollux.core.model.error.CredentialServiceError.*
import org.hyperledger.identus.pollux.vc.jwt.Issuer
import org.hyperledger.identus.shared.models.KeyId
import org.hyperledger.identus.shared.models.WalletAccessContext
import org.hyperledger.identus.shared.models.{KeyId, WalletAccessContext}
import zio.{Duration, IO, UIO, URIO, ZIO}

import java.nio.charset.StandardCharsets
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,10 @@ import org.hyperledger.identus.pollux.core.model.CredentialFormat.AnonCreds
import org.hyperledger.identus.pollux.core.model.IssueCredentialRecord.ProtocolState.OfferReceived
import org.hyperledger.identus.pollux.core.repository.{CredentialRepository, CredentialStatusListRepository}
import org.hyperledger.identus.pollux.sdjwt.*
import org.hyperledger.identus.pollux.vc.jwt.{ES256KSigner, Issuer as JwtIssuer, *}
import org.hyperledger.identus.pollux.vc.jwt.{Issuer as JwtIssuer, *}
import org.hyperledger.identus.shared.crypto.{Ed25519KeyPair, Ed25519PublicKey, Secp256k1KeyPair}
import org.hyperledger.identus.shared.http.{DataUrlResolver, GenericUriResolver}
import org.hyperledger.identus.shared.models.KeyId
import org.hyperledger.identus.shared.models.WalletAccessContext
import org.hyperledger.identus.shared.models.{KeyId, WalletAccessContext}
import org.hyperledger.identus.shared.utils.aspects.CustomMetricsAspect
import zio.*
import zio.json.*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ import org.hyperledger.identus.pollux.core.model.{DidCommID, IssueCredentialReco
import org.hyperledger.identus.pollux.core.model.error.CredentialServiceError
import org.hyperledger.identus.pollux.core.model.error.CredentialServiceError.*
import org.hyperledger.identus.pollux.vc.jwt.Issuer
import org.hyperledger.identus.shared.models.KeyId
import org.hyperledger.identus.shared.models.WalletAccessContext
import org.hyperledger.identus.shared.models.{KeyId, WalletAccessContext}
import zio.{Duration, UIO, URIO, URLayer, ZIO, ZLayer}

import java.util.UUID
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package org.hyperledger.identus.pollux.core.service

import org.hyperledger.identus.pollux.core.model.{CredentialStatusList, CredentialStatusListWithCreds, DidCommID}
import org.hyperledger.identus.pollux.core.model.error.CredentialServiceError
import org.hyperledger.identus.pollux.core.model.error.CredentialStatusListServiceError.{
InvalidRoleForOperation,
StatusListNotFound,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ import org.hyperledger.identus.pollux.core.model.{DidCommID, IssueCredentialReco
import org.hyperledger.identus.pollux.core.model.error.CredentialServiceError
import org.hyperledger.identus.pollux.core.model.error.CredentialServiceError.*
import org.hyperledger.identus.pollux.vc.jwt.Issuer
import org.hyperledger.identus.shared.models.KeyId
import org.hyperledger.identus.shared.models.WalletAccessContext
import org.hyperledger.identus.shared.models.{KeyId, WalletAccessContext}
import zio.{mock, Duration, IO, UIO, URIO, URLayer, ZIO, ZLayer}
import zio.mock.{Mock, Proxy}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package org.hyperledger.identus.pollux.core.service.verification
import org.hyperledger.identus.pollux.core.model.schema.CredentialSchema
import org.hyperledger.identus.pollux.core.service.URIDereferencer
import org.hyperledger.identus.pollux.vc.jwt.{DidResolver, JWT, JWTVerification, JwtCredential}
import zio.{IO, *}
import zio.*

import java.time.OffsetDateTime

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import zio.*
import zio.json.*
import zio.json.ast.Json
import zio.json.ast.Json.*
import zio.test.{assertZIO, *}
import zio.test.*
import zio.test.Assertion.*

import scala.util.Random
Expand Down
Loading

0 comments on commit 68626ed

Please sign in to comment.