-
Notifications
You must be signed in to change notification settings - Fork 16
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 VDR v2 spec, generated code and empty wrapper #2630
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package: v2 | ||
generate: | ||
echo-server: true | ||
client: true | ||
models: true | ||
strict-server: true | ||
output-options: | ||
skip-prune: true | ||
exclude-schemas: | ||
- DIDDocument | ||
- DIDDocumentMetadata | ||
- Service | ||
- VerificationMethod |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,280 @@ | ||
openapi: "3.0.0" | ||
info: | ||
title: Nuts Verifiable Data Registry API spec | ||
description: API specification for the Verifiable Data Registry | ||
version: 2.0.0 | ||
license: | ||
name: GPLv3 | ||
servers: | ||
- url: http://localhost:1323 | ||
paths: | ||
/internal/vdr/v2/did: | ||
post: | ||
summary: Creates a new Web DID | ||
description: | | ||
A new web DID and DID Document are created. | ||
A single key pair is generated and added to the DID document. The key pair is used for all verificationMethods. | ||
No services are added. If no ID is given, a random UUID is generated. | ||
|
||
error returns: | ||
* 400 - Returned in case of malformed DID in the request body | ||
* 500 - An error occurred while processing the request | ||
operationId: "createDID" | ||
tags: | ||
- DID | ||
requestBody: | ||
description: Options for the DID creation. | ||
required: false | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '#/components/schemas/CreateDIDOptions' | ||
responses: | ||
"200": | ||
description: "New DID has been created successfully. Returns the DID document." | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '#/components/schemas/DIDDocument' | ||
default: | ||
$ref: '../common/error_response.yaml' | ||
/internal/vdr/v2/did/{did}: | ||
parameters: | ||
- name: did | ||
in: path | ||
description: URL encoded DID. | ||
required: true | ||
example: did:web:example.com:iam:013c6fda-73e8-45ee-9220-48652dba854b | ||
schema: | ||
type: string | ||
get: | ||
summary: "Resolves a DID document" | ||
description: | | ||
Resolves a DID document. | ||
|
||
error returns: | ||
* 400 - Returned in case of malformed DID | ||
* 404 - Corresponding DID document could not be found | ||
* 500 - An error occurred while processing the request | ||
operationId: "resolveDID" | ||
tags: | ||
- DID | ||
responses: | ||
"200": | ||
description: DID document has been found and returned. | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '#/components/schemas/DIDResolutionResult' | ||
default: | ||
$ref: '../common/error_response.yaml' | ||
delete: | ||
summary: Deletes a locally managed Document. | ||
description: | | ||
|
||
error returns: | ||
* 400 - the DID param was malformed | ||
* 404 - Corresponding DID document could not be found | ||
* 500 - An error occurred while processing the request | ||
operationId: "deleteDID" | ||
tags: | ||
- DID | ||
responses: | ||
"204": | ||
description: DID document has been deactivated. | ||
default: | ||
$ref: '../common/error_response.yaml' | ||
/internal/vdr/v2/did/{did}/service: | ||
parameters: | ||
- name: did | ||
in: path | ||
description: URL encoded DID. | ||
required: true | ||
example: did:web:example.com:iam:013c6fda-73e8-45ee-9220-48652dba854b | ||
schema: | ||
type: string | ||
post: | ||
summary: Adds a service to the DID document. | ||
description: | | ||
It adds the given service to the DID Document. The ID will be generated when not given. | ||
|
||
error returns: | ||
* 400 - Returned in case of malformed DID or service | ||
* 404 - Corresponding DID document could not be found | ||
* 500 - An error occurred while processing the request | ||
parameters: | ||
- name: service | ||
in: body | ||
description: Service to be added to the DID document. | ||
required: true | ||
schema: | ||
$ref: '#/components/schemas/Service' | ||
operationId: addService | ||
tags: | ||
- DID | ||
responses: | ||
"200": | ||
description: "New service has been added successfully. Returns the service." | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '#/components/schemas/VerificationMethod' | ||
default: | ||
$ref: '../common/error_response.yaml' | ||
/internal/vdr/v2/did/{did}/service/{id}: | ||
parameters: | ||
- name: did | ||
in: path | ||
description: URL encoded DID. | ||
required: true | ||
example: did:web:example.com:iam:013c6fda-73e8-45ee-9220-48652dba854b | ||
schema: | ||
type: string | ||
- name: id | ||
in: path | ||
description: URL encoded id identifying the service. | ||
required: true | ||
example: "did:web:example.com:iam:013c6fda-73e8-45ee-9220-48652dba854b#3106f751-59e3-440f-b57b-39a96a2da6c6" | ||
schema: | ||
type: string | ||
delete: | ||
summary: Delete a specific service | ||
description: | | ||
Removes the service from the DID Document. | ||
No cascading will happen for references to the service. | ||
|
||
error returns: | ||
* 404 - Corresponding DID document or verification method could not be found | ||
* 500 - An error occurred while processing the request | ||
tags: | ||
- DID | ||
operationId: deleteService | ||
responses: | ||
"204": | ||
description: The service was successfully deleted | ||
default: | ||
$ref: '../common/error_response.yaml' | ||
put: | ||
summary: Updates a service in the DID document. | ||
description: | | ||
It updates the given service in the DID Document. | ||
|
||
error returns: | ||
* 400 - Returned in case of malformed DID or service | ||
* 404 - Corresponding DID document could not be found | ||
* 500 - An error occurred while processing the request | ||
tags: | ||
- DID | ||
operationId: updateService | ||
parameters: | ||
- name: service | ||
in: body | ||
description: Service to be added to the DID document. | ||
required: true | ||
schema: | ||
$ref: '#/components/schemas/Service' | ||
responses: | ||
"200": | ||
description: "Service has been updated successfully. Returns the service." | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '#/components/schemas/Service' | ||
default: | ||
$ref: '../common/error_response.yaml' | ||
/internal/vdr/v2/did/{did}/verificationmethod: | ||
parameters: | ||
- name: did | ||
in: path | ||
description: URL encoded DID. | ||
required: true | ||
example: did:web:example.com:iam:013c6fda-73e8-45ee-9220-48652dba854b | ||
schema: | ||
type: string | ||
post: | ||
summary: Creates and adds a new verificationMethod to the DID document. | ||
description: | | ||
It creates a new private public keypair. The public key is wrapped in verificationMethod. This method is added to the DID Document. | ||
The key pair is used for all verificationMethods. | ||
|
||
error returns: | ||
* 404 - Corresponding DID document could not be found | ||
* 500 - An error occurred while processing the request | ||
operationId: addVerificationMethod | ||
tags: | ||
- DID | ||
responses: | ||
"200": | ||
description: "New verification method has been created and added successfully. Returns the verification method." | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '#/components/schemas/VerificationMethod' | ||
default: | ||
$ref: '../common/error_response.yaml' | ||
/internal/vdr/v2/did/{did}/verificationmethod/{id}: | ||
parameters: | ||
- name: did | ||
in: path | ||
description: URL encoded DID. | ||
required: true | ||
example: did:web:example.com:iam:013c6fda-73e8-45ee-9220-48652dba854b | ||
schema: | ||
type: string | ||
- name: id | ||
in: path | ||
description: URL encoded ID identifying the verification method. | ||
required: true | ||
example: "did:web:example.com:iam:013c6fda-73e8-45ee-9220-48652dba854b#3106f751-59e3-440f-b57b-39a96a2da6c6" | ||
schema: | ||
type: string | ||
delete: | ||
summary: Delete a specific verification method | ||
description: | | ||
Removes the verification method from the DID Document. | ||
|
||
error returns: | ||
* 404 - Corresponding DID document or verification method could not be found | ||
* 500 - An error occurred while processing the request | ||
tags: | ||
- DID | ||
operationId: deleteVerificationMethod | ||
responses: | ||
"204": | ||
description: Verification Method was successfully deleted | ||
default: | ||
$ref: '../common/error_response.yaml' | ||
components: | ||
schemas: | ||
CreateDIDOptions: | ||
type: object | ||
properties: | ||
id: | ||
type: string | ||
description: The ID of the DID document. If not given, a random UUID is generated. | ||
example: "did:web:example.com:iam:013c6fda-73e8-45ee-9220-48652dba854b" | ||
DIDDocument: | ||
$ref: '../common/ssi_types.yaml#/components/schemas/DIDDocument' | ||
DIDDocumentMetadata: | ||
$ref: '../common/ssi_types.yaml#/components/schemas/DIDDocumentMetadata' | ||
VerificationMethod: | ||
$ref: '../common/ssi_types.yaml#/components/schemas/VerificationMethod' | ||
Service: | ||
$ref: '../common/ssi_types.yaml#/components/schemas/Service' | ||
DIDResolutionResult: | ||
required: | ||
- document | ||
- documentMetadata | ||
properties: | ||
document: | ||
$ref: '#/components/schemas/DIDDocument' | ||
documentMetadata: | ||
$ref: '#/components/schemas/DIDDocumentMetadata' | ||
securitySchemes: | ||
jwtBearerAuth: | ||
type: http | ||
scheme: bearer | ||
|
||
security: | ||
- {} | ||
- jwtBearerAuth: [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
this only resolves did:web DIDs owned by the local node? I think we already have
/iam/{did}
which essentially does the same?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.
We have
iam/{id}/did.json
which is the public URL where the web DID Document lives.We do not have a resolve API there. Since v1 might be removed v2 still needs a resolve.