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

Add support for credentialId #361

Merged
Show file tree
Hide file tree
Changes from all 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 components/Credential.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ components:
type: string
"id":
type: string
description: The ID of the credential.
description: The ID of the credential. This property MAY be empty. The issuer SHOULD NOT auto-generate the id property if not provided, as a Verifiable Credential does not require the id property to be valid, and there are use cases for which the id property cannot be set.
"type":
type: array
description: The JSON-LD type of the credential.
Expand Down
3 changes: 3 additions & 0 deletions components/IssueCredentialOptions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ components:
type:
type: string
description: The type of credential status to issue the credential with
credentialId:
type: string
description: A URI that can be used to identify the credential, that can be used in APIs to refer to the issued verifiable credential. If credentialId is not provided by the issuer coordinator, the issuer service will auto-populate its value from credential.id. If neither credentialId nor credential.id is provided, it will not be possible to refer to this credential once issued nor to deal with errors of duplication. credentialId SHOULD NOT be set by the issuer coordinator if the credential.id property is set, nor should credentialId be used as a replacement for credential.id; rather, credentialId is a means of identifying a credential without the id property being set. The issuer service SHOULD NOT auto-generate a credentialId if one is not supplied by the issuer coordinator, because doing so could create a partitioning error if the result is never received by the client.
example:
{
"created": "2020-04-02T18:48:36Z",
Expand Down
27 changes: 27 additions & 0 deletions components/IssueCredentialSuccess.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
openapi: 3.0.0
info:
version: "0.0.3-unstable"
title: VC API
description: This is an Experimental Open API Specification for the [VC Data Model](https://www.w3.org/TR/vc-data-model/).
license:
name: W3C Software and Document License
url: http://www.w3.org/Consortium/Legal/copyright-software.
contact:
name: GitHub Source Code
url: https://github.com/w3c-ccg/vc-api
paths:
components:
schemas:
IssueCredentialSuccess:
type: object
description: The format returned from a successful issue request.
properties:
verifiableCredential:
type: object
description: A JSON-LD Verifiable Credential with a proof.
allOf:
- $ref: "./Credential.yml#/components/schemas/Credential"
- type: object
properties:
proof:
$ref: "./DataIntegrityProof.yml#/components/schemas/DataIntegrityProof"
4 changes: 2 additions & 2 deletions holder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ paths:
- networkAuth: []
- oAuth2: []
- zCap: []
summary: Gets a credential or verifiable credential by ID
summary: Gets a credential or verifiable credential by ID. To get a credential that does not have credential.id set but has an associated credentialId value, pass credentialId instead.
operationId: getCredential
parameters:
- $ref: "./components/parameters/path/ObjectId.yml"
Expand Down Expand Up @@ -55,7 +55,7 @@ paths:
- networkAuth: []
- oAuth2: []
- zCap: []
summary: Deletes a credential or verifiable credential by ID
summary: Deletes a credential or verifiable credential by ID. To delete a credential that does not have credential.id set but has an associated credentialId value, pass credentialId instead.
operationId: deleteCredential
parameters:
- $ref: "./components/parameters/path/ObjectId.yml"
Expand Down
4 changes: 2 additions & 2 deletions issuer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ components:
IssueCredentialResponse:
type: object
properties:
verifiableCredential:
$ref: "./components/VerifiableCredential.yml#/components/schemas/VerifiableCredential"
IssueCredentialSuccess:
$ref: "./components/IssueCredentialSuccess.yml#/components/schemas/IssueCredentialSuccess"
UpdateCredentialStatus:
type: object
description: Request for updating the status of an issued credential.
Expand Down