Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support parameter #967

Conversation

CryptoKnightIOG
Copy link
Contributor

Signed-off-by: Bassam Riman <bassam.riman@iohk.io>
Copy link
Contributor

Integration Test Results

13 files  ±0  13 suites  ±0   2s ⏱️ ±0s
29 tests ±0  29 ✅ ±0  0 💤 ±0  0 ❌ ±0 
32 runs  ±0  32 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit 913fc5e. ± Comparison against base commit 759cbe8.

@CryptoKnightIOG CryptoKnightIOG changed the title ATL-6913: support parameter feat: support parameter Apr 13, 2024
Copy link
Contributor

Unit Test Results

 90 files  ±0   90 suites  ±0   21m 25s ⏱️ +53s
776 tests ±0  768 ✅ ±0  8 💤 ±0  0 ❌ ±0 
783 runs  ±0  775 ✅ ±0  8 💤 ±0  0 ❌ ±0 

Results for commit 913fc5e. ± Comparison against base commit 759cbe8.

Copy link
Contributor

@bvoiturier bvoiturier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job @CryptoKnightIOG. I left a couple of comments... 😉

}
}

case class AudienceParameter(aud: String) extends VcVerificationParameter
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really want to keep both the enum part and the related xxxParameter(xxx) part? It seems like there is always a 1:1 mapping between them. Keeping both allows the user to mix unrelated types together (e.g. SubjectCheck with AudienceParameter). Why don't we just have AudienceCheck(aud: String) instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right, will fix it in follow up

final case class VcVerificationRequest(
credential: String,
verifications: List[VcVerification]
verification: VcVerification,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not revert to what you did before, that is, passing a list of verifications to the service verify method? This allows one to make a single service call to check, e.g. 10 properties of a VC, instead of making 10 separate calls. I find it more efficient and elegant...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not passing a list of VcVerificationRequest in a single call. It simplifies the logic.

case SemanticCheckOfClaims
}

object VcVerification {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's up to you @CryptoKnightIOG, but if you want to reduce the conversion logic, you can also expose the VcVerification from the service layer right away. It seems they have the exact same structure, right? We do that a lot in other parts of the codebase...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will fix in follow up

@CryptoKnightIOG CryptoKnightIOG merged commit 4be27ab into ATL-6785-6789-Semantic-Subject-Verification Apr 16, 2024
8 of 10 checks passed
@CryptoKnightIOG CryptoKnightIOG deleted the ATL-6913-support-parameter branch April 16, 2024 02:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants