Skip to content

Commit

Permalink
Merge branch 'main' into oidc
Browse files Browse the repository at this point in the history
  • Loading branch information
Pat Losoponkul committed Jun 3, 2024
2 parents 94fa370 + 3608aaf commit f22f1e8
Show file tree
Hide file tree
Showing 429 changed files with 1,309 additions and 1,406 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ff-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ name: Fast-forward merge
# This workflow helps to merge multiple commits from PR to main branch of the repository
# without loosing of PGP signature.
#
# Related GitHub discussions:
# Related GitHub discussions:
# https://github.com/community/community/discussions/10410
# https://github.com/orgs/community/discussions/5524

Expand All @@ -29,5 +29,5 @@ jobs:
uses: endre-spotlab/[email protected]
with:
GITHUB_TOKEN: ${{ secrets.ATALA_GITHUB_TOKEN }}
success_message: 'Success! Fast forwarded ***target_base*** to ***source_head***! ```git checkout target_base && git merge source_head --ff-only``` '
failure_message: 'Failed! Cannot do fast forward!'
success_message: "Success! Fast forwarded ***target_base*** to ***source_head***! ```git checkout target_base && git merge source_head --ff-only``` "
failure_message: "Failed! Cannot do fast forward!"
5 changes: 5 additions & 0 deletions .scalafix.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
rules = [ OrganizeImports ]

OrganizeImports.groupedImports = Merge
OrganizeImports.removeUnused = false
OrganizeImports.targetDialect = Scala3
8 changes: 8 additions & 0 deletions .scalafmt.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,11 @@ runner.dialect = scala3

maxColumn = 120
trailingCommas = preserve

rewrite.rules = [Imports]
rewrite.imports.expand = false
rewrite.imports.sort = original
rewrite.imports.groups = [
[".*"],
["java\\..*", "scala\\..*"]
]
6 changes: 2 additions & 4 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ lazy val V = new {
val vaultDriver = "6.2.0"
val micrometer = "1.11.11"

val nimbusJwt = "10.0.0"
val nimbusJwt = "9.37.3"
val keycloak = "23.0.7" // scala-steward:off //TODO 24.0.3 // update all quay.io/keycloak/keycloak

}
Expand Down Expand Up @@ -129,9 +129,7 @@ lazy val D = new {
val peerDidcommx: ModuleID = "org.didcommx" % "peerdid" % "0.5.0"
val didScala: ModuleID = "app.fmgp" %% "did" % "0.0.0+113-61efa271-SNAPSHOT"

// Customized version of numbus jose jwt
// from https://github.com/goncalo-frade-iohk/Nimbus-JWT_Fork/commit/8a6665c25979e771afae29ce8c965c8b0312fefb
val nimbusJwt: ModuleID = "io.iohk.atala" % "nimbus-jose-jwt" % V.nimbusJwt
val nimbusJwt: ModuleID = "com.nimbusds" % "nimbus-jose-jwt" % V.nimbusJwt

val typesafeConfig: ModuleID = "com.typesafe" % "config" % V.typesafeConfig
val scalaPbRuntime: ModuleID =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ package org.hyperledger.identus.castor.core.model

import com.google.protobuf.ByteString
import io.circe.Json
import org.hyperledger.identus.castor.core.model.did.ServiceEndpoint.UriOrJsonEndpoint
import io.iohk.atala.prism.protos.{common_models, node_api, node_models}
import io.iohk.atala.prism.protos.common_models.OperationStatus
import io.iohk.atala.prism.protos.node_models.KeyUsage
import io.iohk.atala.prism.protos.node_models.PublicKey.KeyData
import org.hyperledger.identus.castor.core.model.did.{
DIDData,
EllipticCurve,
Expand All @@ -21,15 +24,13 @@ import org.hyperledger.identus.castor.core.model.did.{
UpdateDIDAction,
VerificationRelationship
}
import io.iohk.atala.prism.protos.common_models.OperationStatus
import io.iohk.atala.prism.protos.node_models.KeyUsage
import io.iohk.atala.prism.protos.node_models.PublicKey.KeyData
import io.iohk.atala.prism.protos.{common_models, node_api, node_models}
import org.hyperledger.identus.castor.core.model.did.ServiceEndpoint.UriOrJsonEndpoint
import org.hyperledger.identus.shared.models.Base64UrlString
import org.hyperledger.identus.shared.utils.Traverse.*
import zio.*

import java.time.Instant
import scala.language.implicitConversions
import zio.*

object ProtoModelHelper extends ProtoModelHelper

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package org.hyperledger.identus.castor.core.model.did

import org.hyperledger.identus.castor.core.model.ProtoModelHelper
import org.hyperledger.identus.shared.crypto.Sha256Hash
import io.iohk.atala.prism.protos.node_models
import io.iohk.atala.prism.protos.node_models.AtalaOperation.Operation
import org.hyperledger.identus.shared.models.Base64UrlString
import org.hyperledger.identus.shared.models.HexString
import scala.util.Try
import org.hyperledger.identus.castor.core.model.ProtoModelHelper
import org.hyperledger.identus.shared.crypto.Sha256Hash
import org.hyperledger.identus.shared.models.{Base64UrlString, HexString}

import scala.util.matching.Regex
import scala.util.Try

/** Represents a [Did] used in PRISM with prism-specific method and keys as [PrismDid]
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package org.hyperledger.identus.castor.core.model.did

import io.iohk.atala.prism.protos.node_models
import org.hyperledger.identus.castor.core.model.ProtoModelHelper
import org.hyperledger.identus.shared.crypto.Sha256Hash

import scala.collection.compat.immutable.ArraySeq
import io.iohk.atala.prism.protos.node_models

sealed trait PrismDIDOperation {
def did: CanonicalPrismDID
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@ import io.circe.Json
import org.hyperledger.identus.castor.core.model.did.*
import org.hyperledger.identus.castor.core.model.did.ServiceEndpoint.UriOrJsonEndpoint
import org.hyperledger.identus.shared.crypto.Apollo
import org.hyperledger.identus.shared.models.Base64UrlString
import org.hyperledger.identus.shared.models.HexString
import org.hyperledger.identus.shared.models.{Base64UrlString, HexString}

import java.time.Instant
import java.time.ZoneOffset
import java.time.{Instant, ZoneOffset}
import java.time.format.DateTimeFormatter

object W3CModelHelper extends W3CModelHelper
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package org.hyperledger.identus.castor.core.service

import org.hyperledger.identus.castor.core.model.ProtoModelHelper
import io.iohk.atala.prism.protos.{node_api, node_models}
import io.iohk.atala.prism.protos.node_api.NodeServiceGrpc.NodeService
import io.iohk.atala.prism.protos.node_models.OperationOutput.OperationMaybe
import org.hyperledger.identus.castor.core.model.did.{
CanonicalPrismDID,
DIDData,
Expand All @@ -13,16 +15,14 @@ import org.hyperledger.identus.castor.core.model.did.{
ScheduledDIDOperationDetail,
SignedPrismDIDOperation
}
import org.hyperledger.identus.castor.core.model.error.OperationValidationError
import org.hyperledger.identus.castor.core.model.error.{DIDOperationError, DIDResolutionError}
import org.hyperledger.identus.castor.core.model.error.{DIDOperationError, DIDResolutionError, OperationValidationError}
import org.hyperledger.identus.castor.core.model.ProtoModelHelper
import org.hyperledger.identus.castor.core.util.DIDOperationValidator
import io.iohk.atala.prism.protos.node_api.NodeServiceGrpc.NodeService
import io.iohk.atala.prism.protos.node_models.OperationOutput.OperationMaybe
import io.iohk.atala.prism.protos.{node_api, node_models}
import org.hyperledger.identus.shared.models.HexString
import zio.*

import java.time.Instant
import scala.collection.immutable.ArraySeq
import zio.*

trait DIDService {
def scheduleOperation(operation: SignedPrismDIDOperation): IO[DIDOperationError, ScheduleDIDOperationOutcome]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@ package org.hyperledger.identus.castor.core.service

import org.hyperledger.identus.castor.core.model.did.*
import org.hyperledger.identus.castor.core.model.error
import org.hyperledger.identus.shared.crypto.Apollo
import org.hyperledger.identus.shared.crypto.Secp256k1KeyPair
import org.hyperledger.identus.shared.crypto.{Apollo, Secp256k1KeyPair}
import org.hyperledger.identus.shared.models.Base64UrlString
import zio.{mock, IO, URLayer, ZIO, ZLayer}
import zio.mock.{Expectation, Mock, Proxy}
import zio.test.Assertion
import zio.{IO, URLayer, ZIO, ZLayer, mock}

import scala.collection.immutable.ArraySeq

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package org.hyperledger.identus.castor.core.util

import io.lemonlabs.uri.{Uri, Url, Urn, QueryString}
import io.lemonlabs.uri.{QueryString, Uri, Url, Urn}
import io.lemonlabs.uri.config.UriConfig
import io.lemonlabs.uri.encoding.PercentEncoder
import io.lemonlabs.uri.decoding.UriDecodeException
import io.lemonlabs.uri.encoding.PercentEncoder

// TODO: unify with the logic used in Node
// https://github.com/input-output-hk/atala-prism/blob/ba7b3e3ef307f6bd06734af2bf8fed9b119ee98e/prism-backend/common/src/main/scala/io/iohk/atala/prism/utils/UriUtils.scala
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
package org.hyperledger.identus.castor.core.model

import com.google.protobuf.timestamp.Timestamp
import io.circe.Json
import io.circe.JsonObject
import org.hyperledger.identus.castor.core.model.did.ServiceEndpoint
import org.hyperledger.identus.castor.core.model.did.ServiceEndpoint.UriOrJsonEndpoint
import org.hyperledger.identus.castor.core.model.did.ServiceEndpoint.UriValue
import org.hyperledger.identus.castor.core.model.did.ServiceType
import org.hyperledger.identus.castor.core.util.GenUtils
import io.circe.{Json, JsonObject}
import io.iohk.atala.prism.protos.common_models.Ledger
import io.iohk.atala.prism.protos.node_models
import java.time.Instant
import scala.language.implicitConversions
import org.hyperledger.identus.castor.core.model.did.{ServiceEndpoint, ServiceType}
import org.hyperledger.identus.castor.core.model.did.ServiceEndpoint.{UriOrJsonEndpoint, UriValue}
import org.hyperledger.identus.castor.core.util.GenUtils
import zio.*
import zio.test.*
import zio.test.Assertion.*

import java.time.Instant
import scala.language.implicitConversions

object ProtoModelHelperSpec extends ZIOSpecDefault {

import ProtoModelHelper.*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package org.hyperledger.identus.castor.core.model.did

import com.google.protobuf.ByteString
import org.hyperledger.identus.shared.crypto.Sha256Hash
import io.iohk.atala.prism.protos.node_models
import org.hyperledger.identus.shared.crypto.Sha256Hash
import org.hyperledger.identus.shared.models.Base64UrlString
import zio.*
import zio.test.*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
package org.hyperledger.identus.castor.core.service

import com.google.protobuf.ByteString
import org.hyperledger.identus.castor.core.model.did.{DIDData, PrismDID, PrismDIDOperation}
import org.hyperledger.identus.castor.core.model.error.DIDResolutionError
import org.hyperledger.identus.castor.core.util.{GenUtils}
import org.hyperledger.identus.castor.core.util.DIDOperationValidator
import io.iohk.atala.prism.protos.{node_api, node_models}
import io.iohk.atala.prism.protos.common_models.{HealthCheckRequest, HealthCheckResponse}
import io.iohk.atala.prism.protos.node_api
import io.iohk.atala.prism.protos.node_models
import io.iohk.atala.prism.protos.node_api.{
GetBatchStateRequest,
GetBatchStateResponse,
Expand All @@ -27,6 +22,9 @@ import io.iohk.atala.prism.protos.node_api.{
ScheduleOperationsRequest,
ScheduleOperationsResponse
}
import org.hyperledger.identus.castor.core.model.did.{DIDData, PrismDID, PrismDIDOperation}
import org.hyperledger.identus.castor.core.model.error.DIDResolutionError
import org.hyperledger.identus.castor.core.util.{DIDOperationValidator, GenUtils}
import zio.*
import zio.test.*
import zio.test.Assertion.*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ package org.hyperledger.identus.castor.core.util

import io.circe.Json
import org.hyperledger.identus.castor.core.model.did.*
import org.hyperledger.identus.castor.core.model.did.ServiceEndpoint.UriOrJsonEndpoint
import org.hyperledger.identus.castor.core.model.did.ServiceEndpoint.UriValue
import org.hyperledger.identus.castor.core.model.did.ServiceEndpoint.{UriOrJsonEndpoint, UriValue}
import org.hyperledger.identus.shared.crypto.Apollo
import org.hyperledger.identus.shared.models.Base64UrlString
import zio.*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ pollux {
syncRevocationStatusesBgJobRecurrenceDelay = ${?SYNC_REVOCATION_STATUSES_BG_JOB_RECURRENCE_DELAY}
syncRevocationStatusesBgJobProcessingParallelism = 5
syncRevocationStatusesBgJobProcessingParallelism = ${?SYNC_REVOCATION_STATUSES_BG_JOB_PROCESSING_PARALLELISM}
credential.sdJwt.expiry = 30 days
credential.sdJwt.expiry = ${?CREDENTIAL_SD_JWT_EXPIRY}
}

connect {
Expand Down
4 changes: 3 additions & 1 deletion cloud-agent/service/server/src/main/resources/logback.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
<pattern>%d{yyyy-MM-dd_HH:mm:ss.SSS} %highlight(%-5level) %cyan(%logger{5}@L%line:[%-4.30thread]) {%mdc} - %msg%n%xException</pattern>
</encoder>
</appender>

<logger name="io.getquill" level="WARN">
<appender-ref ref="STDOUT" />
</logger>
<root level="info">
<appender-ref ref="STDOUT"/>
</root>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package org.hyperledger.identus

import zio.*
import org.hyperledger.identus.api.http.RequestContext
import sttp.model.Header
import zio.*

object LogUtils {
inline val headerName = "X-Request-ID"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,14 @@ import org.hyperledger.identus.agent.server.config.AppConfig
import org.hyperledger.identus.agent.walletapi.model.ManagedDIDDetail
import org.hyperledger.identus.agent.walletapi.service.WalletManagementService
import org.hyperledger.identus.connect.core.model.ConnectionRecord
import org.hyperledger.identus.event.notification.EventNotificationConfig
import org.hyperledger.identus.event.notification.{Event, EventConsumer, EventNotificationService}
import org.hyperledger.identus.event.notification.{
Event,
EventConsumer,
EventNotificationConfig,
EventNotificationService
}
import org.hyperledger.identus.pollux.core.model.{IssueCredentialRecord, PresentationRecord}
import org.hyperledger.identus.shared.models.WalletAccessContext
import org.hyperledger.identus.shared.models.WalletId
import org.hyperledger.identus.shared.models.{WalletAccessContext, WalletId}
import zio.*
import zio.http.*
import zio.json.*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
package org.hyperledger.identus.agent.server

import org.hyperledger.identus.agent.walletapi.model.PublicationState.Published
import org.hyperledger.identus.agent.walletapi.model.error.GetManagedDIDError
import org.hyperledger.identus.agent.walletapi.model.{ManagedDIDState, PublicationState}
import org.hyperledger.identus.agent.walletapi.model.error.GetManagedDIDError
import org.hyperledger.identus.agent.walletapi.model.PublicationState.Published
import org.hyperledger.identus.agent.walletapi.service.ManagedDIDService
import org.hyperledger.identus.api.http.ErrorResponse
import org.hyperledger.identus.castor.core.model.did.{LongFormPrismDID, PrismDID}
import org.hyperledger.identus.connect.core.model.ConnectionRecord
import org.hyperledger.identus.connect.core.model.ConnectionRecord.{ProtocolState, Role}
import org.hyperledger.identus.connect.core.model.error.ConnectionServiceError
import org.hyperledger.identus.connect.core.model.error.ConnectionServiceError.{
InvalidStateForOperation,
RecordIdNotFound
}
import org.hyperledger.identus.connect.core.model.ConnectionRecord
import org.hyperledger.identus.connect.core.model.ConnectionRecord.{ProtocolState, Role}
import org.hyperledger.identus.connect.core.service.ConnectionService
import org.hyperledger.identus.mercury.model.DidId
import org.hyperledger.identus.shared.models.WalletAccessContext
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,13 @@ import org.hyperledger.identus.connect.controller.ConnectionControllerImpl
import org.hyperledger.identus.connect.core.service.{ConnectionServiceImpl, ConnectionServiceNotifier}
import org.hyperledger.identus.connect.sql.repository.{JdbcConnectionRepository, Migrations as ConnectMigrations}
import org.hyperledger.identus.credential.status.controller.CredentialStatusControllerImpl
import org.hyperledger.identus.didcomm.controller.DIDCommControllerImpl
import org.hyperledger.identus.event.controller.EventControllerImpl
import org.hyperledger.identus.event.notification.EventNotificationServiceImpl
import org.hyperledger.identus.iam.authentication.DefaultAuthenticator
import org.hyperledger.identus.iam.authentication.apikey.JdbcAuthenticationRepository
import org.hyperledger.identus.iam.authorization.DefaultPermissionManagementService
import org.hyperledger.identus.iam.authentication.DefaultAuthenticator
import org.hyperledger.identus.iam.authorization.core.EntityPermissionManagementService
import org.hyperledger.identus.iam.authorization.DefaultPermissionManagementService
import org.hyperledger.identus.iam.entity.http.controller.{EntityController, EntityControllerImpl}
import org.hyperledger.identus.iam.wallet.http.controller.WalletManagementControllerImpl
import org.hyperledger.identus.issue.controller.IssueControllerImpl
Expand All @@ -45,12 +46,12 @@ import org.hyperledger.identus.pollux.credentialschema.controller.{
CredentialSchemaControllerImpl,
VerificationPolicyControllerImpl
}
import org.hyperledger.identus.pollux.sql.repository.JdbcOID4VCIIssuerMetadataRepository
import org.hyperledger.identus.pollux.sql.repository.{
JdbcCredentialDefinitionRepository,
JdbcCredentialRepository,
JdbcCredentialSchemaRepository,
JdbcCredentialStatusListRepository,
JdbcOID4VCIIssuerMetadataRepository,
JdbcPresentationRepository,
JdbcVerificationPolicyRepository,
Migrations as PolluxMigrations
Expand All @@ -59,11 +60,10 @@ import org.hyperledger.identus.presentproof.controller.PresentProofControllerImp
import org.hyperledger.identus.resolvers.DIDResolver
import org.hyperledger.identus.system.controller.SystemControllerImpl
import org.hyperledger.identus.verification.controller.VcVerificationControllerImpl
import org.hyperledger.identus.didcomm.controller.DIDCommControllerImpl
import zio.*
import zio.logging.*
import zio.logging.LogFormat.*
import zio.logging.backend.SLF4J
import zio.logging.LogFormat.*
import zio.metrics.connectors.micrometer
import zio.metrics.connectors.micrometer.MicrometerConfig
import zio.metrics.jvm.DefaultJvmMetrics
Expand Down
Loading

0 comments on commit f22f1e8

Please sign in to comment.