Skip to content

Commit

Permalink
chore: rename oid4vci
Browse files Browse the repository at this point in the history
Signed-off-by: Pat Losoponkul <pat.losoponkul@iohk.io>
  • Loading branch information
patlo-iog committed May 8, 2024
1 parent 68a15c6 commit 359b0ad
Show file tree
Hide file tree
Showing 31 changed files with 64 additions and 64 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ 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.{DidOps, HttpClient}
import org.hyperledger.identus.oidc4vc.CredentialIssuerServerEndpoints
import org.hyperledger.identus.oid4vci.CredentialIssuerServerEndpoints
import org.hyperledger.identus.pollux.core.service.{CredentialService, PresentationService}
import org.hyperledger.identus.pollux.credentialdefinition.CredentialDefinitionRegistryServerEndpoints
import org.hyperledger.identus.pollux.credentialschema.{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ import org.hyperledger.identus.iam.entity.http.controller.{EntityController, Ent
import org.hyperledger.identus.iam.wallet.http.controller.WalletManagementControllerImpl
import org.hyperledger.identus.issue.controller.IssueControllerImpl
import org.hyperledger.identus.mercury.*
import org.hyperledger.identus.oidc4vc.controller.CredentialIssuerControllerImpl
import org.hyperledger.identus.oidc4vc.service.OIDCCredentialIssuerServiceImpl
import org.hyperledger.identus.oidc4vc.storage.InMemoryIssuanceSessionService
import org.hyperledger.identus.oid4vci.controller.CredentialIssuerControllerImpl
import org.hyperledger.identus.oid4vci.service.OIDCCredentialIssuerServiceImpl
import org.hyperledger.identus.oid4vci.storage.InMemoryIssuanceSessionService
import org.hyperledger.identus.pollux.core.service.*
import org.hyperledger.identus.pollux.core.service.verification.VcVerificationServiceImpl
import org.hyperledger.identus.pollux.credentialdefinition.controller.CredentialDefinitionControllerImpl
Expand Down Expand Up @@ -205,7 +205,7 @@ object MainApp extends ZIOAppDefault {
// oidc
CredentialIssuerControllerImpl.layer,
InMemoryIssuanceSessionService.layer,
OIDC4VCIssuerMetadataServiceImpl.layer,
OID4VCIIssuerMetadataServiceImpl.layer,
OIDCCredentialIssuerServiceImpl.layer,
// event notification service
ZLayer.succeed(500) >>> EventNotificationServiceImpl.layer,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.hyperledger.identus.oidc4vc
package org.hyperledger.identus.oid4vci

import org.hyperledger.identus.api.http.{EndpointOutputs, ErrorResponse, RequestContext}
import org.hyperledger.identus.castor.controller.http.DIDInput
Expand All @@ -7,7 +7,7 @@ import org.hyperledger.identus.iam.authentication.apikey.ApiKeyCredentials
import org.hyperledger.identus.iam.authentication.apikey.ApiKeyEndpointSecurityLogic.apiKeyHeader
import org.hyperledger.identus.iam.authentication.oidc.JwtCredentials
import org.hyperledger.identus.iam.authentication.oidc.JwtSecurityLogic.jwtAuthHeader
import org.hyperledger.identus.oidc4vc.http.*
import org.hyperledger.identus.oid4vci.http.*
import sttp.apispec.Tag
import sttp.model.StatusCode
import sttp.tapir.*
Expand Down Expand Up @@ -42,7 +42,7 @@ object CredentialIssuerEndpoints {
private val baseEndpoint = endpoint
.tag(tagName)
.in(extractFromRequest[RequestContext](RequestContext.apply))
.in("oidc4vc" / "issuers")
.in("oid4vci" / "issuers")

private val baseIssuerPrivateEndpoint = baseEndpoint
.securityIn(apiKeyHeader)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package org.hyperledger.identus.oidc4vc
package org.hyperledger.identus.oid4vci

import org.hyperledger.identus.LogUtils.*
import org.hyperledger.identus.agent.walletapi.model.BaseEntity
import org.hyperledger.identus.api.http.{ErrorResponse, RequestContext}
import org.hyperledger.identus.iam.authentication.{Authenticator, Authorizer, DefaultAuthenticator, SecurityLogic}
import org.hyperledger.identus.oidc4vc.controller.CredentialIssuerController
import org.hyperledger.identus.oidc4vc.http.{CredentialErrorResponse, CredentialRequest, NonceResponse}
import org.hyperledger.identus.oid4vci.controller.CredentialIssuerController
import org.hyperledger.identus.oid4vci.http.{CredentialErrorResponse, CredentialRequest, NonceResponse}
import sttp.tapir.ztapir.*
import zio.*

Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
package org.hyperledger.identus.oidc4vc.controller
package org.hyperledger.identus.oid4vci.controller

import org.hyperledger.identus.agent.server.config.AppConfig
import org.hyperledger.identus.api.http.ErrorResponse.badRequest
import org.hyperledger.identus.api.http.ErrorResponse.internalServerError
import org.hyperledger.identus.api.http.{ErrorResponse, RequestContext}
import org.hyperledger.identus.api.util.PaginationUtils
import org.hyperledger.identus.castor.core.model.did.{CanonicalPrismDID, PrismDID}
import org.hyperledger.identus.oidc4vc.CredentialIssuerEndpoints.ExtendedErrorResponse
import org.hyperledger.identus.oidc4vc.http.*
import org.hyperledger.identus.oidc4vc.http.CredentialErrorCode.*
import org.hyperledger.identus.oidc4vc.service.OIDCCredentialIssuerService
import org.hyperledger.identus.pollux.core.service.OIDC4VCIssuerMetadataService
import org.hyperledger.identus.oid4vci.CredentialIssuerEndpoints.ExtendedErrorResponse
import org.hyperledger.identus.oid4vci.http.*
import org.hyperledger.identus.oid4vci.http.CredentialErrorCode.*
import org.hyperledger.identus.oid4vci.service.OIDCCredentialIssuerService
import org.hyperledger.identus.pollux.core.service.OID4VCIIssuerMetadataService
import org.hyperledger.identus.shared.models.WalletAccessContext
import zio.{IO, URLayer, ZIO, ZLayer}

Expand Down Expand Up @@ -128,7 +128,7 @@ object CredentialIssuerController {

case class CredentialIssuerControllerImpl(
credentialIssuerService: OIDCCredentialIssuerService,
issuerMetadataService: OIDC4VCIssuerMetadataService,
issuerMetadataService: OID4VCIIssuerMetadataService,
agentBaseUrl: URL
) extends CredentialIssuerController {

Expand Down Expand Up @@ -326,12 +326,12 @@ case class CredentialIssuerControllerImpl(

object CredentialIssuerControllerImpl {
val layer
: URLayer[AppConfig & OIDCCredentialIssuerService & OIDC4VCIssuerMetadataService, CredentialIssuerController] =
: URLayer[AppConfig & OIDCCredentialIssuerService & OID4VCIIssuerMetadataService, CredentialIssuerController] =
ZLayer.fromZIO(
for {
agentBaseUrl <- ZIO.serviceWith[AppConfig](_.agent.httpEndpoint.publicEndpointUrl)
oidcIssuerService <- ZIO.service[OIDCCredentialIssuerService]
oidcIssuerMetadataService <- ZIO.service[OIDC4VCIssuerMetadataService]
oidcIssuerMetadataService <- ZIO.service[OID4VCIIssuerMetadataService]
} yield CredentialIssuerControllerImpl(oidcIssuerService, oidcIssuerMetadataService, agentBaseUrl)
)
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.hyperledger.identus.oidc4vc.domain
package org.hyperledger.identus.oid4vci.domain

import org.hyperledger.identus.castor.core.model.did.CanonicalPrismDID
import org.hyperledger.identus.castor.core.model.did.DID
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.hyperledger.identus.oidc4vc.http
package org.hyperledger.identus.oid4vci.http

import org.hyperledger.identus.api.http.EndpointOutputs.statusCodeMatcher
import org.hyperledger.identus.api.http.ErrorResponse
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.hyperledger.identus.oidc4vc.http
package org.hyperledger.identus.oid4vci.http

import org.hyperledger.identus.pollux.core.model.oidc4vc.CredentialConfiguration as PolluxCredentialConfiguration
import org.hyperledger.identus.pollux.core.model.oid4vci.CredentialConfiguration as PolluxCredentialConfiguration
import sttp.tapir.Schema
import zio.json.*

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.hyperledger.identus.oidc4vc.http
package org.hyperledger.identus.oid4vci.http

import org.hyperledger.identus.pollux.core.model.oidc4vc.CredentialIssuer as PolluxCredentialIssuer
import org.hyperledger.identus.pollux.core.model.oid4vci.CredentialIssuer as PolluxCredentialIssuer
import sttp.tapir.Schema
import zio.json.{DeriveJsonDecoder, DeriveJsonEncoder, JsonDecoder, JsonEncoder}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.hyperledger.identus.oidc4vc.http
package org.hyperledger.identus.oid4vci.http

import sttp.tapir.Schema
import zio.json.{DeriveJsonDecoder, DeriveJsonEncoder, JsonDecoder, JsonEncoder}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.hyperledger.identus.oidc4vc.http
package org.hyperledger.identus.oid4vci.http

import sttp.tapir.Schema
import sttp.tapir.json.zio.schemaForZioJsonValue
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.hyperledger.identus.oidc4vc.http
package org.hyperledger.identus.oid4vci.http

import org.hyperledger.identus.pollux.core.model.CredentialFormat as PolluxCredentialFormat
import sttp.tapir.Schema
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.hyperledger.identus.oidc4vc.http
package org.hyperledger.identus.oid4vci.http

import sttp.tapir.Schema
import sttp.tapir.Schema.annotations.encodedName
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.hyperledger.identus.oidc4vc.http
package org.hyperledger.identus.oid4vci.http

import org.hyperledger.identus.pollux.core.model.oidc4vc as pollux
import org.hyperledger.identus.pollux.core.model.oid4vci as pollux
import sttp.tapir.Schema
import sttp.tapir.Schema.annotations.encodedName
import zio.json.{DeriveJsonDecoder, DeriveJsonEncoder, JsonDecoder, JsonEncoder}
Expand All @@ -25,7 +25,7 @@ object IssuerMetadata {
issuer: pollux.CredentialIssuer,
credentialConfigurations: Seq[pollux.CredentialConfiguration]
): IssuerMetadata = {
val credentialIssuerBaseUrl = agentBaseUrl.toURI().resolve(s"oidc4vc/issuers/${issuer.id}").toString
val credentialIssuerBaseUrl = agentBaseUrl.toURI().resolve(s"oid4vci/issuers/${issuer.id}").toString
IssuerMetadata(
credential_issuer = credentialIssuerBaseUrl,
authorization_servers = Some(Seq(issuer.authorizationServer.toString())),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.hyperledger.identus.oidc4vc.http
package org.hyperledger.identus.oid4vci.http

import sttp.tapir.Schema
import zio.json.{DeriveJsonDecoder, DeriveJsonEncoder, JsonDecoder, JsonEncoder}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.hyperledger.identus.oidc4vc.http
package org.hyperledger.identus.oid4vci.http

import sttp.tapir.Schema
import sttp.tapir.Schema.annotations.encodedName
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.hyperledger.identus.oidc4vc.service
package org.hyperledger.identus.oid4vci.service

import org.hyperledger.identus.oidc4vc.service.NonceService.NonceGenerator
import org.hyperledger.identus.oid4vci.service.NonceService.NonceGenerator
import zio.Task

import java.time.Instant
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package org.hyperledger.identus.oidc4vc.service
package org.hyperledger.identus.oid4vci.service

import io.circe.Json
import org.hyperledger.identus.agent.walletapi.storage.DIDNonSecretStorage
import org.hyperledger.identus.castor.core.model.did.CanonicalPrismDID
import org.hyperledger.identus.castor.core.model.did.{PrismDID, VerificationRelationship}
import org.hyperledger.identus.oidc4vc.domain.IssuanceSession
import org.hyperledger.identus.oidc4vc.http.*
import org.hyperledger.identus.oidc4vc.storage.IssuanceSessionStorage
import org.hyperledger.identus.oid4vci.domain.IssuanceSession
import org.hyperledger.identus.oid4vci.http.*
import org.hyperledger.identus.oid4vci.storage.IssuanceSessionStorage
import org.hyperledger.identus.pollux.core.service.CredentialService
import org.hyperledger.identus.pollux.vc.jwt.{DID, Issuer, JWT, JwtCredential, W3cCredentialPayload}
import org.hyperledger.identus.shared.models.{WalletAccessContext, WalletId}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.hyperledger.identus.oidc4vc.storage
package org.hyperledger.identus.oid4vci.storage

import org.hyperledger.identus.oidc4vc.domain.IssuanceSession
import org.hyperledger.identus.oid4vci.domain.IssuanceSession
import zio.{IO, ULayer, ZIO, ZLayer}

import scala.collection.concurrent.TrieMap
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.hyperledger.identus.oidc4vc.storage
package org.hyperledger.identus.oid4vci.storage

trait NonceStorage {
def getNonce(nonceExpiresAt: Long): String
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import org.hyperledger.identus.iam.authentication.DefaultAuthenticator
import org.hyperledger.identus.iam.entity.http.controller.EntityController
import org.hyperledger.identus.iam.wallet.http.controller.WalletManagementController
import org.hyperledger.identus.issue.controller.IssueController
import org.hyperledger.identus.oidc4vc.controller.CredentialIssuerController
import org.hyperledger.identus.oid4vci.controller.CredentialIssuerController
import org.hyperledger.identus.pollux.credentialdefinition.controller.CredentialDefinitionController
import org.hyperledger.identus.pollux.credentialschema.controller.{
CredentialSchemaController,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package org.hyperledger.identus.oidc4vc.domain
package org.hyperledger.identus.oid4vci.domain

import org.hyperledger.identus.agent.walletapi.memory.GenericSecretStorageInMemory
import org.hyperledger.identus.agent.walletapi.service.{ManagedDIDService, MockManagedDIDService}
import org.hyperledger.identus.agent.walletapi.storage.{DIDNonSecretStorage, MockDIDNonSecretStorage}
import org.hyperledger.identus.castor.core.model.did.VerificationRelationship
import org.hyperledger.identus.castor.core.service.{DIDService, MockDIDService}
import org.hyperledger.identus.oidc4vc.http.{ClaimDescriptor, CredentialDefinition, Localization}
import org.hyperledger.identus.oidc4vc.service.{OIDCCredentialIssuerService, OIDCCredentialIssuerServiceImpl}
import org.hyperledger.identus.oidc4vc.storage.InMemoryIssuanceSessionService
import org.hyperledger.identus.oid4vci.http.{ClaimDescriptor, CredentialDefinition, Localization}
import org.hyperledger.identus.oid4vci.service.{OIDCCredentialIssuerService, OIDCCredentialIssuerServiceImpl}
import org.hyperledger.identus.oid4vci.storage.InMemoryIssuanceSessionService
import org.hyperledger.identus.pollux.core.repository.{
CredentialRepository,
CredentialRepositoryInMemory,
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def prepare_issuer():

global CREDENTIAL_ISSUER
canonical_did = issuer_did["did"]
CREDENTIAL_ISSUER = f"{AGENT_URL}/oidc4vc/{canonical_did}"
CREDENTIAL_ISSUER = f"{AGENT_URL}/oid4vci/{canonical_did}"
print(f"CREDENTIAL_ISSUER: {CREDENTIAL_ISSUER}")


Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.hyperledger.identus.pollux.core.model.oidc4vc
package org.hyperledger.identus.pollux.core.model.oid4vci

import org.hyperledger.identus.pollux.core.model.CredentialFormat

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.hyperledger.identus.pollux.core.model.oidc4vc
package org.hyperledger.identus.pollux.core.model.oid4vci

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

import org.hyperledger.identus.pollux.core.model.oidc4vc.CredentialConfiguration
import org.hyperledger.identus.pollux.core.model.oidc4vc.CredentialIssuer
import org.hyperledger.identus.pollux.core.model.oid4vci.CredentialConfiguration
import org.hyperledger.identus.pollux.core.model.oid4vci.CredentialIssuer
import org.hyperledger.identus.shared.models.WalletAccessContext
import zio.*

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import org.hyperledger.identus.pollux.core.model.CredentialFormat
import org.hyperledger.identus.pollux.core.model.error.CredentialSchemaError.CredentialSchemaParsingError
import org.hyperledger.identus.pollux.core.model.error.CredentialSchemaError.SchemaError
import org.hyperledger.identus.pollux.core.model.error.CredentialSchemaError.URISyntaxError
import org.hyperledger.identus.pollux.core.model.oidc4vc.CredentialConfiguration
import org.hyperledger.identus.pollux.core.model.oidc4vc.CredentialIssuer
import org.hyperledger.identus.pollux.core.model.oid4vci.CredentialConfiguration
import org.hyperledger.identus.pollux.core.model.oid4vci.CredentialIssuer
import org.hyperledger.identus.pollux.core.model.schema.CredentialSchema
import org.hyperledger.identus.pollux.core.repository.OIDC4VCIssuerMetadataRepository
import org.hyperledger.identus.pollux.core.service.OIDC4VCIssuerMetadataServiceError.CredentialConfigurationNotFound
Expand Down Expand Up @@ -53,7 +53,7 @@ object OIDC4VCIssuerMetadataServiceError {
)
}

trait OIDC4VCIssuerMetadataService {
trait OID4VCIIssuerMetadataService {
def getCredentialIssuer(issuerId: UUID): IO[IssuerIdNotFound, CredentialIssuer]
def createCredentialIssuer(authorizationServer: URL): URIO[WalletAccessContext, CredentialIssuer]
def getCredentialIssuers: URIO[WalletAccessContext, Seq[CredentialIssuer]]
Expand Down Expand Up @@ -81,8 +81,8 @@ trait OIDC4VCIssuerMetadataService {
): ZIO[WalletAccessContext, CredentialConfigurationNotFound, Unit]
}

class OIDC4VCIssuerMetadataServiceImpl(repository: OIDC4VCIssuerMetadataRepository, uriDereferencer: URIDereferencer)
extends OIDC4VCIssuerMetadataService {
class OID4VCIIssuerMetadataServiceImpl(repository: OIDC4VCIssuerMetadataRepository, uriDereferencer: URIDereferencer)
extends OID4VCIIssuerMetadataService {

override def createCredentialIssuer(authorizationServer: URL): URIO[WalletAccessContext, CredentialIssuer] = {
val issuer = CredentialIssuer(authorizationServer)
Expand Down Expand Up @@ -175,8 +175,8 @@ class OIDC4VCIssuerMetadataServiceImpl(repository: OIDC4VCIssuerMetadataReposito
}
}

object OIDC4VCIssuerMetadataServiceImpl {
def layer: URLayer[OIDC4VCIssuerMetadataRepository & URIDereferencer, OIDC4VCIssuerMetadataService] = {
ZLayer.fromFunction(OIDC4VCIssuerMetadataServiceImpl(_, _))
object OID4VCIIssuerMetadataServiceImpl {
def layer: URLayer[OIDC4VCIssuerMetadataRepository & URIDereferencer, OID4VCIIssuerMetadataService] = {
ZLayer.fromFunction(OID4VCIIssuerMetadataServiceImpl(_, _))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import doobie.*
import doobie.implicits.*
import doobie.postgres.implicits.*
import doobie.util.transactor.Transactor
import org.hyperledger.identus.pollux.core.model.oidc4vc.CredentialConfiguration
import org.hyperledger.identus.pollux.core.model.oidc4vc.CredentialIssuer
import org.hyperledger.identus.pollux.core.model.oid4vci.CredentialConfiguration
import org.hyperledger.identus.pollux.core.model.oid4vci.CredentialIssuer
import org.hyperledger.identus.pollux.core.repository.OIDC4VCIssuerMetadataRepository
import org.hyperledger.identus.shared.db.ContextAwareTask
import org.hyperledger.identus.shared.db.Implicits.*
Expand Down

0 comments on commit 359b0ad

Please sign in to comment.