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

Pex select creds #159

Merged
merged 23 commits into from
Dec 20, 2023
Merged
Show file tree
Hide file tree
Changes from 21 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,4 @@ jobs:
-F "run_env[url]=https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" \
https://analytics-api.buildkite.com/v1/uploads
done
done
done
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,17 @@ public object PresentationExchange {
/**
* Selects credentials that satisfy a given presentation definition.
*
* @param credentials The list of Verifiable Credentials to select from.
* @param vcJwts Iterable of VCs in JWT format to select from.
* @param presentationDefinition The Presentation Definition to match against.
* @return A list of Verifiable Credentials that satisfy the Presentation Definition.
* @throws UnsupportedOperationException If the method is untested and not recommended for use.
*/
@Throws(UnsupportedOperationException::class)
public fun selectCredentials(
credentials: List<VerifiableCredential>,
vcJwts: Iterable<String>,
presentationDefinition: PresentationDefinitionV2
): List<VerifiableCredential> {
throw UnsupportedOperationException("pex is untested")
// Uncomment the following line to filter credentials based on the Presentation Definition
// return credentials.filter { satisfiesPresentationDefinition(it, presentationDefinition) }
): List<String> {
nitro-neal marked this conversation as resolved.
Show resolved Hide resolved
val inputDescriptorToVcMap = mapInputDescriptorsToVCs(vcJwts, presentationDefinition)
return inputDescriptorToVcMap.flatMap { it.value }.toSet().toList()
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,17 @@ package web5.sdk.credentials
import assertk.assertFailure
import assertk.assertions.messageContains
import com.fasterxml.jackson.annotation.JsonInclude
import com.fasterxml.jackson.core.type.TypeReference
import com.fasterxml.jackson.databind.ObjectMapper
import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper
import com.fasterxml.jackson.module.kotlin.registerKotlinModule
import org.junit.jupiter.api.Nested
import org.junit.jupiter.api.assertDoesNotThrow
import org.junit.jupiter.api.assertThrows
import web5.sdk.credentials.model.PresentationDefinitionV2
import web5.sdk.crypto.InMemoryKeyManager
import web5.sdk.dids.methods.key.DidKey
import web5.sdk.testing.TestVectors
import java.io.File
import kotlin.test.Test
import kotlin.test.assertEquals
Expand Down Expand Up @@ -427,4 +430,152 @@ class PresentationExchangeTest {
assertEquals("$.verifiableCredential[0]", presentationSubmission.descriptorMap[0].path)
}
}

@Nested
inner class SelectCredentials {
Copy link
Contributor

Choose a reason for hiding this comment

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

Are these tests unrelated to the vector tests?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yup these are just normal unit tests, testing some of the same things

@Test
fun `selects 1 correct credential`() {
val pd = jsonMapper.readValue(
readPd("src/test/resources/pd_filter_array_single_path.json"),
PresentationDefinitionV2::class.java
)

val vc = VerifiableCredential.create(
type = "StreetCred",
issuer = issuerDid.uri,
subject = holderDid.uri,
data = StreetCredibility(localRespect = "high", legit = true)
)
val vcJwt = vc.sign(issuerDid)

val selectedCreds = PresentationExchange.selectCredentials(listOf(vcJwt), pd)

assertEquals( 1, selectedCreds.size)
assertEquals( vcJwt, selectedCreds[0])
}

@Test
fun `selects 2 correct credential`() {
val pd = jsonMapper.readValue(
readPd("src/test/resources/pd_filter_array_single_path.json"),
PresentationDefinitionV2::class.java
)

val vc1 = VerifiableCredential.create(
type = "StreetCred",
issuer = issuerDid.uri,
subject = holderDid.uri,
data = StreetCredibility(localRespect = "high", legit = true)
)
val vcJwt1 = vc1.sign(issuerDid)

val vc2 = VerifiableCredential.create(
type = "StreetCred",
issuer = issuerDid.uri,
subject = holderDid.uri,
data = StreetCredibility(localRespect = "high", legit = true)
)
val vcJwt2 = vc2.sign(issuerDid)

val selectedCreds = PresentationExchange.selectCredentials(listOf(vcJwt1, vcJwt2), pd)

assertEquals( 2, selectedCreds.size)
assertEquals( listOf(vcJwt1, vcJwt2), selectedCreds)
}

@Test
fun `selects 2 correct credential out of 3`() {
val pd = jsonMapper.readValue(
readPd("src/test/resources/pd_filter_array_single_path.json"),
PresentationDefinitionV2::class.java
)

val vc1 = VerifiableCredential.create(
type = "StreetCred",
issuer = issuerDid.uri,
subject = holderDid.uri,
data = StreetCredibility(localRespect = "high", legit = true)
)
val vcJwt1 = vc1.sign(issuerDid)

val vc2 = VerifiableCredential.create(
type = "StreetCred",
issuer = issuerDid.uri,
subject = holderDid.uri,
data = StreetCredibility(localRespect = "high", legit = true)
)

val vcJwt2 = vc2.sign(issuerDid)

val vc3 = VerifiableCredential.create(
type = "DateOfBirth",
issuer = issuerDid.uri,
subject = holderDid.uri,
data = DateOfBirth(dateOfBirth = "1-1-1111")
)

val vcJwt3 = vc3.sign(issuerDid)

val selectedCreds = PresentationExchange.selectCredentials(listOf(vcJwt1, vcJwt2, vcJwt3), pd)

assertEquals( 2, selectedCreds.size)
assertEquals( listOf(vcJwt1, vcJwt2), selectedCreds)
}

@Test
fun `selects 2 correct credential with two input descriptors`() {
val pd = jsonMapper.readValue(
readPd("src/test/resources/pd_filter_array_multiple_input_descriptors.json"),
PresentationDefinitionV2::class.java
)

val vc1 = VerifiableCredential.create(
type = "DateOfBirthSSN",
issuer = issuerDid.uri,
subject = holderDid.uri,
data = DateOfBirthSSN(dateOfBirth = "1999-01-01", ssn = "456-123-123")
)
val vcJwt1 = vc1.sign(issuerDid)

val vc2 = VerifiableCredential.create(
type = "DateOfBirthSSN",
issuer = issuerDid.uri,
subject = holderDid.uri,
data = DateOfBirth(dateOfBirth = "1999-01-01")
)
val vcJwt2 = vc2.sign(issuerDid)

val selectedCreds = PresentationExchange.selectCredentials(listOf(vcJwt1, vcJwt2), pd)

assertEquals( 2, selectedCreds.size)
assertEquals( listOf(vcJwt1, vcJwt2), selectedCreds)
}
}
}


class Web5TestVectorsPresentationExchangeTest {
Copy link
Contributor

Choose a reason for hiding this comment

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

wdyt about extracting all the vector tests into a separate file so you can tell based on the file name whether it's a vector test?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The thought did cross my mind.
You mean having a new test file called TestVectorTests.kt
and then having credentials test and pex and everything in the credentials package in there?

I could go either way, I do like having the test vector in the same file as the normal unit tests. Less overhead for the devs I think.

Also there would be a lot of imports in the TestVectorTests.kt file, would have to import all stuff from all packages basically

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah did mean something like that, but agree it does feel more natural to have the tests oriented around feature.

data class SelectCredTestInput(
val presentationDefinition: PresentationDefinitionV2,
val credentialJwts: List<String>
)

data class SelectCredTestOutput(
val selectedCredentials: List<String>
)

private val mapper = jacksonObjectMapper()
@Test
fun select_credentials() {
val typeRef = object : TypeReference<TestVectors<SelectCredTestInput, SelectCredTestOutput>>() {}
val testVectors = mapper.readValue(File("../test-vectors/presentation_exchange/select_credentials.json"), typeRef)
Copy link
Contributor

Choose a reason for hiding this comment

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

Should there be tests for the error cases ? Some examples I'm thinking about:

  1. UnsupportedOperationException is thrown
  2. When inputDescriptorToVcMap.size != presentationDefinition.inputDescriptors.size
  3. When JsonPathParseException is thrown.

Copy link
Contributor

Choose a reason for hiding this comment

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

+1 I think some of the tests above (multiple input descriptors, filtering array vs filtering on value) could be included in the vectors as well

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh yes many more test vectors coming soon (tm),
I was doing this one simple success as a steel thread for the overall web5-kt + web5-js check marks in web5-sdk-development


testVectors.vectors.forEach { vector ->
val selectedCreds = PresentationExchange.selectCredentials(
vector.input.credentialJwts,
vector.input.presentationDefinition
)
assertEquals(vector.output!!.selectedCredentials, selectedCreds)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ class Web5TestVectorsCredentialsTest {

@Test
fun create_success() {
val typeRef = object : TypeReference<TestVectors<CreateTestInput>>() {}
val typeRef = object : TypeReference<TestVectors<CreateTestInput, String>>() {}
val testVectors = mapper.readValue(File("../test-vectors/credentials/create_success.json"), typeRef)

testVectors.vectors.forEach { vector ->
Expand All @@ -259,19 +259,23 @@ class Web5TestVectorsCredentialsTest {

@Test
fun verify_success() {
val typeRef = object : TypeReference<TestVectors<VerifyTestInput>>() {}
val typeRef = object : TypeReference<TestVectors<VerifyTestInput, Nothing>>() {}
val testVectors = mapper.readValue(File("../test-vectors/credentials/verify_success.json"), typeRef)

testVectors.vectors.forEach { vector ->

val inputMap = vector.input as Map<String, String>
val vcJwt = inputMap["vcJwt"] as String

assertDoesNotThrow {
VerifiableCredential.verify(vector.input.vcJwt)
VerifiableCredential.verify(vcJwt)
}
}
}

@Test
fun verify_failure() {
val typeRef = object : TypeReference<TestVectors<VerifyTestInput>>() {}
val typeRef = object : TypeReference<TestVectors<VerifyTestInput, Nothing>>() {}
val testVectors = mapper.readValue(File("../test-vectors/credentials/verify_failure.json"), typeRef)

testVectors.vectors.forEach { vector ->
Expand All @@ -283,7 +287,7 @@ class Web5TestVectorsCredentialsTest {

@Test
fun create_failure() {
val typeRef = object : TypeReference<TestVectors<CreateTestInput>>() {}
val typeRef = object : TypeReference<TestVectors<CreateTestInput, Nothing>>() {}
val testVectors = mapper.readValue(File("../test-vectors/credentials/create_failure.json"), typeRef)

testVectors.vectors.forEach { vector ->
Expand Down
59 changes: 59 additions & 0 deletions test-vectors/presentation_exchange/select_credentials.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
"description":"Select Credentials",
"vectors":[
{
"description":"select credentials for presentation",
"input":{
"presentationDefinition":{
"id":"test-pd-id",
"name":"simple PD",
"purpose":"pd for testing",
"input_descriptors":[
{
"id":"whatever",
"purpose":"id for testing",
"constraints":{
"fields":[
{
"path":[
"$.vc.credentialSubject.btcAddress",
"$.credentialSubject.btcAddress",
"$.btcAddress"
]
}
]
}
},
{
"id":"whatever2",
"purpose":"id for testing2",
"constraints":{
"fields":[
{
"path":[
"$.vc.credentialSubject.dogeAddress",
"$.credentialSubject.dogeAddress",
"$.dogeAddress"
]
}
]
}
}
]
},
"credentialJwts":[
"eyJ0eXAiOiJKV1QiLCJhbGciOiJFZERTQSIsImtpZCI6ImRpZDprZXk6ejZNa2ZIQk5tYzRjQ2hOdER2YXIxOFRaaWdmWHQ3UDY1RkJHd3FRVHR4UW9RUG5HI3o2TWtmSEJObWM0Y0NoTnREdmFyMThUWmlnZlh0N1A2NUZCR3dxUVR0eFFvUVBuRyJ9.eyJpc3MiOiJkaWQ6a2V5Ono2TWtmSEJObWM0Y0NoTnREdmFyMThUWmlnZlh0N1A2NUZCR3dxUVR0eFFvUVBuRyIsInN1YiI6ImRpZDprZXk6ejZNa2ZIQk5tYzRjQ2hOdER2YXIxOFRaaWdmWHQ3UDY1RkJHd3FRVHR4UW9RUG5HIiwidmMiOnsiQGNvbnRleHQiOlsiaHR0cHM6Ly93d3cudzMub3JnLzIwMTgvY3JlZGVudGlhbHMvdjEiXSwidHlwZSI6WyJWZXJpZmlhYmxlQ3JlZGVudGlhbCIsIlN0cmVldENyZWQiXSwiaWQiOiJ1cm46dXVpZDoxM2Q1YTg3YS1kY2Y1LTRmYjktOWUyOS0wZTYyZTI0YzQ0ODYiLCJpc3N1ZXIiOiJkaWQ6a2V5Ono2TWtmSEJObWM0Y0NoTnREdmFyMThUWmlnZlh0N1A2NUZCR3dxUVR0eFFvUVBuRyIsImlzc3VhbmNlRGF0ZSI6IjIwMjMtMTItMDdUMTc6MTk6MTNaIiwiY3JlZGVudGlhbFN1YmplY3QiOnsiaWQiOiJkaWQ6a2V5Ono2TWtmSEJObWM0Y0NoTnREdmFyMThUWmlnZlh0N1A2NUZCR3dxUVR0eFFv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6ImRpZDprZXk6ejZNa2ZIQk5tYzRjQ2hOdER2YXIxOFRaaWdmWHQ3UDY1RkJHd3FRVHR4UW9RUG5HI3o2TWtmSEJObWM0Y0NoTnREdmFyMThUWmlnZlh0N1A2NUZCR3dxUVR0eFFvUVBuRyJ9.eyJpc3MiOiJkaWQ6a2V5Ono2TWtmSEJObWM0Y0NoTnREdmFyMThUWmlnZlh0N1A2NUZCR3dxUVR0eFFvUVBuRyIsInN1YiI6ImRpZDprZXk6ejZNa2ZIQk5tYzRjQ2hOdER2YXIxOFRaaWdmWHQ3UDY1RkJHd3FRVHR4UW9RUG5HIiwidmMiOnsiQGNvbnRleHQiOlsiaHR0cHM6Ly93d3cudzMub3JnLzIwMTgvY3JlZGVudGlhbHMvdjEiXSwidHlwZSI6WyJWZXJpZmlhYmxlQ3JlZGVudGlhbCIsIkJpdGNvaW5DcmVkZW50aWFsIl0sImlkIjoidXJuOnV1aWQ6NGE0OGIyNzUtNTBmZC00MTQ0LWJmMTctY2E5ODMxYzlkYTYyIiwiaXNzdWVyIjoiZGlkOmtleTp6Nk1rZkhCTm1jNGNDaE50RHZhcjE4VFppZ2ZYdDdQNjVGQkd3cVFUdHhRb1FQbkciLCJpc3N1YW5jZURhdGUiOiIyMDIzLTEyLTA3VDE3OjE5OjEzWiIsImNyZWRlbnRpYWxTdWJqZWN0Ijp7ImlkIjoiZGlkOmtleTp6Nk1rZkhCTm1jNGNDaE50RHZhcjE4VFppZ2ZYdDdQNjVGQkd3cVFUdHhRb1FQbkciLCJidGNBZGRyZXNzIjoiYnRjQWRkcmVzczEyMyJ9fX0.75Xyx-SWSeo8rfvHK-mxl3ixa3QZxj7waPuJZ58s52yTffs6AjpO3uSNAO3WOV-rtS-puIRm7vClZCsUA3JRAQ"
]
}
}
]
}
10 changes: 5 additions & 5 deletions testing/src/main/kotlin/web5/sdk/testing/TestVectors.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@
*
* See https://github.com/TBD54566975/sdk-development/blob/main/web5-test-vectors/README.md for more details.
*/
public class TestVectors<T>(
public class TestVectors<I,O>(

Check warning on line 8 in testing/src/main/kotlin/web5/sdk/testing/TestVectors.kt

View check run for this annotation

Codecov / codecov/patch

testing/src/main/kotlin/web5/sdk/testing/TestVectors.kt#L8

Added line #L8 was not covered by tests
public val description: String,
public val vectors: List<TestVector<T>>
public val vectors: List<TestVector<I,O>>

Check warning on line 10 in testing/src/main/kotlin/web5/sdk/testing/TestVectors.kt

View check run for this annotation

Codecov / codecov/patch

testing/src/main/kotlin/web5/sdk/testing/TestVectors.kt#L10

Added line #L10 was not covered by tests
)

/**
* Represents a single test vector as specified in https://github.com/TBD54566975/sdk-development/blob/main/web5-test-vectors/vectors.schema.json#L11
*
* See https://github.com/TBD54566975/sdk-development/blob/main/web5-test-vectors/README.md for more details.
*/
public class TestVector<T>(
public class TestVector<I,O>(

Check warning on line 18 in testing/src/main/kotlin/web5/sdk/testing/TestVectors.kt

View check run for this annotation

Codecov / codecov/patch

testing/src/main/kotlin/web5/sdk/testing/TestVectors.kt#L18

Added line #L18 was not covered by tests
public val description: String,
public val input: T,
public val output: String?,
public val input: I,
public val output: O?,

Check warning on line 21 in testing/src/main/kotlin/web5/sdk/testing/TestVectors.kt

View check run for this annotation

Codecov / codecov/patch

testing/src/main/kotlin/web5/sdk/testing/TestVectors.kt#L20-L21

Added lines #L20 - L21 were not covered by tests
public val errors: Boolean?,
)
Loading