-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: VC Verification Audiance check (#969)
Signed-off-by: Bassam Riman <[email protected]>
- Loading branch information
1 parent
4d128a7
commit 504340d
Showing
7 changed files
with
100 additions
and
97 deletions.
There are no files selected for viewing
50 changes: 21 additions & 29 deletions
50
...b/core/src/main/scala/io/iohk/atala/pollux/core/service/verification/VcVerification.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,29 @@ | ||
package io.iohk.atala.pollux.core.service.verification | ||
|
||
import io.iohk.atala.pollux.core.service.verification.VcVerificationFailureType.ERROR | ||
import sttp.tapir.Schema | ||
import zio.json.{DeriveJsonDecoder, DeriveJsonEncoder, JsonDecoder, JsonEncoder} | ||
sealed trait VcVerification | ||
|
||
enum VcVerificationFailureType { | ||
case WARN extends VcVerificationFailureType | ||
case ERROR extends VcVerificationFailureType | ||
} | ||
object VcVerification { | ||
case object SignatureVerification extends VcVerification | ||
|
||
enum VcVerification( | ||
val failureType: VcVerificationFailureType | ||
) { | ||
case SignatureVerification extends VcVerification(ERROR) | ||
case IssuerIdentification extends VcVerification(ERROR) | ||
case ExpirationCheck extends VcVerification(ERROR) | ||
case NotBeforeCheck extends VcVerification(ERROR) | ||
case AudienceCheck extends VcVerification(ERROR) | ||
case SubjectVerification extends VcVerification(ERROR) | ||
case IntegrityOfClaims extends VcVerification(ERROR) | ||
case ComplianceWithStandards extends VcVerification(ERROR) | ||
case RevocationCheck extends VcVerification(ERROR) | ||
case AlgorithmVerification extends VcVerification(ERROR) | ||
case SchemaCheck extends VcVerification(ERROR) | ||
case SemanticCheckOfClaims extends VcVerification(ERROR) | ||
} | ||
case object IssuerIdentification extends VcVerification | ||
|
||
object VcVerification { | ||
given encoder: JsonEncoder[VcVerification] = | ||
DeriveJsonEncoder.gen[VcVerification] | ||
case object ExpirationCheck extends VcVerification | ||
|
||
case object NotBeforeCheck extends VcVerification | ||
|
||
case class AudienceCheck(aud: String) extends VcVerification | ||
|
||
case object SubjectVerification extends VcVerification | ||
|
||
case object IntegrityOfClaims extends VcVerification | ||
|
||
case object ComplianceWithStandards extends VcVerification | ||
|
||
case object RevocationCheck extends VcVerification | ||
|
||
case object AlgorithmVerification extends VcVerification | ||
|
||
given decoder: JsonDecoder[VcVerification] = | ||
DeriveJsonDecoder.gen[VcVerification] | ||
case object SchemaCheck extends VcVerification | ||
|
||
given schema: Schema[VcVerification] = Schema.derivedEnumeration.defaultStringBased | ||
case object SemanticCheckOfClaims extends VcVerification | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters