Skip to content

Commit

Permalink
feat: presentation definition schema link
Browse files Browse the repository at this point in the history
  • Loading branch information
wolf4ood committed Nov 19, 2024
1 parent 5634c13 commit 47db0d4
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
{
"properties": {
"presentationDefinition": {
"type": "object"
"type": "object",
"$ref": "https://identity.foundation/presentation-exchange/schemas/presentation-definition.json"
}
},
"required": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,15 @@ public abstract class AbstractSchemaTest {
protected static final String ONE_OF = "oneOf";
protected static final String TYPE = "type";
protected static final String ENUM = "enum";

protected static final String PRESENTATION_EXCHANGE_PREFIX = "https://identity.foundation/";
private static final String CLASSPATH_SCHEMA = "classpath:/";

protected JsonSchema schema;

protected void setUp(String schemaFile) {
var schemaFactory = JsonSchemaFactory.getInstance(V202012, builder ->
builder.schemaMappers(schemaMappers -> schemaMappers.mapPrefix(DCP_PREFIX, CLASSPATH_SCHEMA))
builder.schemaMappers(schemaMappers ->
schemaMappers.mapPrefix(DCP_PREFIX, CLASSPATH_SCHEMA)
.mapPrefix(PRESENTATION_EXCHANGE_PREFIX, CLASSPATH_SCHEMA))
);

schema = schemaFactory.getSchema(SchemaLocation.of(DCP_PREFIX + schemaFile));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,34 @@ public class PresentationQueryMessageSchemaTest extends AbstractSchemaTest {
{
"@context": ["https://w3id.org/dspace-dcp/v0.8"],
"@type": "PresentationQueryMessage",
"presentationDefinition": {}
"presentationDefinition": {
"id": "presentation1",
"input_descriptors": [
{
"id": "organization credential",
"format": {
"ldp_vc": {
"proof_type": [
"Ed25519Signature2018"
]
}
},
"constraints": {
"fields": [
{
"path": [
"$.type"
],
"filter": {
"type": "string",
"pattern": "OrganizationCredential"
}
}
]
}
}
]
}
}""";

private static final String INVALID_PRESENTATION_QUERY_MESSAGE_NO_SCOPE = """
Expand Down

0 comments on commit 47db0d4

Please sign in to comment.