-
Notifications
You must be signed in to change notification settings - Fork 6
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
add json schemas for vc and did data models #127
Changes from 3 commits
2504a4b
a5265ee
96ffc16
0d4697b
1a8d3dd
2a60a4d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Web5 Spec | ||
|
||
This directory servers as a sub-resource for the [main spec](../README.md) to further define our usage of selected standards. | ||
|
||
* [Decentralized Identifiers v1.0](did.md) | ||
* [Verifiable Credentials v1.1](vc.md) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-2020-12/schema#", | ||
"type": "object", | ||
"properties": { | ||
"created": { | ||
"type": "string", | ||
"format": "date-time" | ||
}, | ||
"updated": { | ||
"type": "string", | ||
"format": "date-time" | ||
}, | ||
"deactivated": { | ||
"type": "boolean" | ||
}, | ||
"nextUpdate": { | ||
"type": "string", | ||
"format": "date-time" | ||
}, | ||
"versionId": { | ||
"type": "string" | ||
}, | ||
"nextversionId": { | ||
"type": "string" | ||
}, | ||
"equivalentId": { | ||
"type": "array", | ||
"items": { | ||
"type": "string", | ||
} | ||
}, | ||
"canonicalId": { | ||
"type": "string" | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-2020-12/schema#", | ||
"definitions": { | ||
"errorType": { | ||
"type": "string", | ||
"enum": ["invalidDid", "notFound", "representationNotSupported", "methodNotSupported", "invalidDidDocument", "invalidDidDocumentLength", "internalError"] | ||
} | ||
}, | ||
"type": "object", | ||
"properties": { | ||
"error": { | ||
"$ref": "#/definitions/errorType" | ||
} | ||
} | ||
} |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is this There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-2020-12/schema#", | ||
"definitions": { | ||
"verificationMethod": { | ||
"type": "object", | ||
"properties": { | ||
"id": { | ||
"type": "string" | ||
}, | ||
"type": { | ||
"type": "string" | ||
}, | ||
"controller": { | ||
"type": "string" | ||
}, | ||
"publicKeyJwk": { | ||
"type": "object" | ||
} | ||
}, | ||
"required": ["id", "type", "controller", "publicKeyJwk"] | ||
}, | ||
"service": { | ||
"type": "object", | ||
"properties": { | ||
"id": { | ||
"type": "string" | ||
}, | ||
"type": { | ||
"type": "string" | ||
}, | ||
"serviceEndpoint": { | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
} | ||
}, | ||
"sig": { | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
} | ||
}, | ||
"enc": { | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
} | ||
} | ||
}, | ||
"required": ["id", "type", "serviceEndpoint"] | ||
} | ||
}, | ||
"type": "object", | ||
"properties": { | ||
"id": { | ||
"type": "string" | ||
}, | ||
"@context": { | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
} | ||
}, | ||
"controller": { | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
} | ||
}, | ||
"alsoKnownAs": { | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
} | ||
}, | ||
"verificationMethod": { | ||
"type": "array", | ||
"items": { | ||
"$ref": "#/definitions/verificationMethod" | ||
}, | ||
"minItems": 1 | ||
}, | ||
"authentication": { | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
} | ||
}, | ||
"assertionMethod": { | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
} | ||
}, | ||
"keyAgreement": { | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
} | ||
}, | ||
"capabilityInvocation": { | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
} | ||
}, | ||
"capabilityDelegation": { | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
} | ||
}, | ||
"service": { | ||
"type": "array", | ||
"items": { | ||
"$ref": "#/definitions/service" | ||
} | ||
} | ||
}, | ||
"required": ["id", "verificationMethod"] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-2020-12/schema#", | ||
"type": "object", | ||
"definitions": { | ||
"credentialStatus": { | ||
"type": "object", | ||
"properties": { | ||
"id": { "type": "string" }, | ||
"type": { "type": "string" }, | ||
"statusPurpose": { "type": "string" }, | ||
"statusListIndex": { "type": "string" }, | ||
"statusListCredential": { "type": "string" } | ||
}, | ||
"required": ["id", "type", "statusPurpose", "statusListIndex", "statusListCredential"] | ||
}, | ||
"credentialSchema": { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is the formatting off here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we dont have credentialSchema in js currently, but its not required so a todo for now There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. no problem - this should lead the impls |
||
"type": "object", | ||
"properties": { | ||
"id": { "type": "string" }, | ||
"type": { "type": "string" } | ||
}, | ||
"required": ["id", "type"] | ||
} | ||
}, | ||
"properties": { | ||
"@context": { | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
}, | ||
"minItems": 1 | ||
}, | ||
"id": { | ||
"type": "string" | ||
}, | ||
"type": { | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
}, | ||
"minItems": 1 | ||
}, | ||
"issuer": { | ||
"oneOf": [ | ||
{ "type": "string" }, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this will be our default when creating, but we will accept creds that are currently if we get a jwt, we use what is in the iss for buildling the vc and adding the issuer so if we get iss: abc vcDataModel.issuer: { id: abc, name: myname} we will blast it and make vcDataModel.issuer: abc There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. correct |
||
{ | ||
"type": "object", | ||
"properties": { | ||
"id": { "type": "string" }, | ||
"name": { "type": "string" } | ||
}, | ||
"required": ["id"] | ||
} | ||
] | ||
}, | ||
"issuanceDate": { | ||
"type": "string", | ||
"format": "date-time" | ||
}, | ||
"expirationDate": { | ||
"type": "string", | ||
"format": "date-time" | ||
}, | ||
"credentialSubject": { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the doc here specifies it must be present https://github.com/TBD54566975/web5-spec/blob/main/spec/vc.md#verifiable-credential-data-model There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we could certainly accept creds without em but we shouldn't produce creds without ids |
||
"type": "object", | ||
"properties": { | ||
"id": { "type": "string" } | ||
}, | ||
"required": ["id"] | ||
}, | ||
"credentialStatus": { "$ref": "#/definitions/credentialStatus" }, | ||
"credentialSchema": { "$ref": "#/definitions/credentialSchema" }, | ||
"evidence": { | ||
"type": "array", | ||
"items": { "type": "object" } | ||
} | ||
}, | ||
"required": ["@context", "id", "type", "issuer", "issuanceDate", "credentialSubject"] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-2020-12/schema#", | ||
"type": "object", | ||
"properties": { | ||
"@context": { | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
}, | ||
"minItems": 1 | ||
}, | ||
"id": { | ||
"type": "string" | ||
}, | ||
"type": { | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
}, | ||
"minItems": 1 | ||
}, | ||
"holder": { | ||
"type": "string", | ||
"format": "uri" | ||
}, | ||
"issuanceDate": { | ||
"type": "string", | ||
"format": "date-time" | ||
}, | ||
"expirationDate": { | ||
"type": "string", | ||
"format": "date-time" | ||
}, | ||
"verifiableCredential": { | ||
"type": "array", | ||
"items": { | ||
"$ref": "vc-11.json" | ||
}, | ||
"minItems": 1 | ||
} | ||
}, | ||
"required": ["@context", "id", "type", "holder", "issuanceDate", "verifiableCredential"] | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
idk if we conform to this now
https://github.com/TBD54566975/web5-spec/blob/main/test-vectors/did_dht/resolve.json
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah DHT is not supporting this since we don't have a dht resolver yet
decentralized-identity/did-dht#18