Skip to content

Commit

Permalink
Add missing schemas
Browse files Browse the repository at this point in the history
  • Loading branch information
reinkrul committed Oct 25, 2023
1 parent bce77f1 commit f33d387
Show file tree
Hide file tree
Showing 9 changed files with 779 additions and 30 deletions.
3 changes: 3 additions & 0 deletions vcr/pe/schema/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Schemas files were taken from:
- https://github.com/decentralized-identity/presentation-exchange/tree/main/schemas
- https://github.com/decentralized-identity/claim-format-registry/tree/main/schemas
2 changes: 1 addition & 1 deletion vcr/pe/schema/gen/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func main() {
os.Exit(1)
}

f, err := os.OpenFile("../generated.go", os.O_CREATE|os.O_WRONLY|os.O_TRUNC, 0644)
f, err := os.OpenFile("generated.go", os.O_CREATE|os.O_WRONLY|os.O_TRUNC, 0644)

if err != nil {
fmt.Fprintln(os.Stderr, "Error opening output file: ", err)
Expand Down
220 changes: 220 additions & 0 deletions vcr/pe/schema/v2/input-descriptor.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,220 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Input Descriptor",
"definitions": {
"status_directive": {
"type": "object",
"additionalProperties": false,
"properties": {
"directive": {
"type": "string",
"enum": [
"required",
"allowed",
"disallowed"
]
},
"type": {
"type": "array",
"minItems": 1,
"items": {
"type": "string"
}
}
}
},
"field": {
"type": "object",
"oneOf": [
{
"properties": {
"id": {
"type": "string"
},
"optional": {
"type": "boolean"
},
"path": {
"type": "array",
"items": {
"type": "string"
}
},
"purpose": {
"type": "string"
},
"intent_to_retain": {
"type": "boolean"
},
"name": {
"type": "string"
},
"filter": {
"$ref": "http://json-schema.org/draft-07/schema#"
}
},
"required": [
"path"
],
"additionalProperties": false
},
{
"properties": {
"id": {
"type": "string"
},
"optional": {
"type": "boolean"
},
"path": {
"type": "array",
"items": {
"type": "string"
}
},
"purpose": {
"type": "string"
},
"intent_to_retain": {
"type": "boolean"
},
"filter": {
"$ref": "http://json-schema.org/draft-07/schema#"
},
"name": {
"type": "string"
},
"predicate": {
"type": "string",
"enum": [
"required",
"preferred"
]
}
},
"required": [
"path",
"filter",
"predicate"
],
"additionalProperties": false
}
]
}
},
"type": "object",
"additionalProperties": false,
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"purpose": {
"type": "string"
},
"group": {
"type": "array",
"items": {
"type": "string"
}
},
"constraints": {
"type": "object",
"additionalProperties": false,
"properties": {
"limit_disclosure": {
"type": "string",
"enum": [
"required",
"preferred"
]
},
"statuses": {
"type": "object",
"additionalProperties": false,
"properties": {
"active": {
"$ref": "#/definitions/status_directive"
},
"suspended": {
"$ref": "#/definitions/status_directive"
},
"revoked": {
"$ref": "#/definitions/status_directive"
}
}
},
"fields": {
"type": "array",
"items": {
"$ref": "#/definitions/field"
}
},
"subject_is_issuer": {
"type": "string",
"enum": [
"required",
"preferred"
]
},
"is_holder": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"field_id": {
"type": "array",
"items": {
"type": "string"
}
},
"directive": {
"type": "string",
"enum": [
"required",
"preferred"
]
}
},
"required": [
"field_id",
"directive"
]
}
},
"same_subject": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"field_id": {
"type": "array",
"items": {
"type": "string"
}
},
"directive": {
"type": "string",
"enum": [
"required",
"preferred"
]
}
},
"required": [
"field_id",
"directive"
]
}
}
}
}
},
"required": [
"id"
]
}
Loading

0 comments on commit f33d387

Please sign in to comment.