-
Notifications
You must be signed in to change notification settings - Fork 47
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
Initial GET and DELETE Operations #271
Changes from all commits
c68cb2b
2a53cae
01db86f
594fc5c
50b20ea
4298e47
cfe28f3
4adeeb1
19c3bff
d0e5a31
1041f1e
ca74e07
9df6b57
baf487c
e6990c8
f871d1f
6dc46c9
bc57899
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,15 @@ | ||
in: path | ||
name: object-id | ||
required: true | ||
schema: | ||
anyOf: | ||
- type: string | ||
pattern: "[0-9a-f]{8}\b-[0-9a-f]{4}\b-[0-9a-f]{4}\b-[0-9a-f]{4}\b-[0-9a-f]{12}" | ||
- type: string | ||
pattern: "z[1-9A-HJ-NP-Za-km-z]{21,22}" | ||
- type: string | ||
pattern: "u[a-zA-Z0-9_-]{22,23}" | ||
example: | ||
- f37e5114-8b4a-11ec-b32e-fbd62b9502c1 | ||
- z4Z1T4HdLdfXCFAhdhzdCqm | ||
- u7m8_ybOArX-EWeADqWCsIw |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -10,10 +10,98 @@ info: | |||||
name: GitHub Source Code | ||||||
url: https://github.com/w3c-ccg/vc-api | ||||||
paths: | ||||||
/credentials/{id}: | ||||||
get: | ||||||
tags: | ||||||
- Credentials | ||||||
summary: Gets a credential or verifiable credential by ID | ||||||
operationId: getCredential | ||||||
parameters: | ||||||
- $ref: "./components/parameters/path/ObjectId.yml" | ||||||
responses: | ||||||
"200": | ||||||
description: Credential retrieved | ||||||
content: | ||||||
application/json: | ||||||
schema: | ||||||
oneOf: | ||||||
- $ref: "./components/Credential.yml#/components/schemas/Credential" | ||||||
- $ref: "./components/VerifiableCredential.yml#/components/schemas/VerifiableCredential" | ||||||
"400": | ||||||
description: Bad Request | ||||||
"401": | ||||||
description: Not Authorized | ||||||
"410": | ||||||
description: Gone! There is no data here | ||||||
"418": | ||||||
description: I'm a teapot - MUST not be returned outside of pre-arranged scenarios between both parties | ||||||
Comment on lines
+36
to
+37
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. Har har :) -- presuming we're going to eventually remove this... because if we don't, we'll have to test for it. |
||||||
"500": | ||||||
description: Internal Error | ||||||
"501": | ||||||
description: Not Implemented | ||||||
delete: | ||||||
tags: | ||||||
- Credentials | ||||||
summary: Deletes a credential or verifiable credential by ID | ||||||
operationId: deleteCredential | ||||||
parameters: | ||||||
- $ref: "./components/parameters/path/ObjectId.yml" | ||||||
responses: | ||||||
"202": | ||||||
description: Credential deleted - this is a 202 by default as soft deletes and processing time are assumed | ||||||
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 should probably say "Credential marked for deletion". Looks like the proposal here is that this call is sometimes implemented as eventually consistent. This also need to state what the side effects are... like, if associated with a status list, what happens to the status bits? 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. |
||||||
"400": | ||||||
description: Bad Request | ||||||
"401": | ||||||
description: Not Authorized | ||||||
"410": | ||||||
description: Gone! There is no data here | ||||||
"500": | ||||||
description: Internal Error | ||||||
"501": | ||||||
description: Not Implemented | ||||||
/credentials: | ||||||
get: | ||||||
tags: | ||||||
- Credentials | ||||||
summary: Gets list of credentials or verifiable credentials | ||||||
operationId: getCredentials | ||||||
parameters: | ||||||
- in: query | ||||||
name: type | ||||||
schema: | ||||||
type: array | ||||||
items: | ||||||
type: string | ||||||
oneOf: | ||||||
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. These options seem a bit arbitrary... fine for now, but we need to define exactly what should be happening when each option is provided... for example, is this really checking the |
||||||
- "credentials" | ||||||
- "verifiablecredentials" | ||||||
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.
Suggested change
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. Why kebab-case instead of camelCase? We're using camelCase everywhere else, no? 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. its a query string param, and its pluralized... so i figured it would be better to not have it look like 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. Thanks for the explanation, I didn't see that it was a query param, I agree with your view wrt. casing and query params. |
||||||
- "all" | ||||||
responses: | ||||||
"200": | ||||||
description: Credentials retrieved | ||||||
content: | ||||||
application/json: | ||||||
schema: | ||||||
type: array | ||||||
description: The Credentials | ||||||
items: | ||||||
anyOf: | ||||||
- $ref: "./components/VerifiableCredential.yml#/components/schemas/VerifiableCredential" | ||||||
- $ref: "./components/Credential.yml#/components/schemas/Credential" | ||||||
"400": | ||||||
description: Bad Request | ||||||
"401": | ||||||
description: Not Authorized | ||||||
"410": | ||||||
description: Gone! There is no data here | ||||||
"500": | ||||||
description: Internal Error | ||||||
"501": | ||||||
description: Not Implemented | ||||||
/credentials/derive: | ||||||
post: | ||||||
tags: | ||||||
- credential | ||||||
- Credentials | ||||||
summary: Derives a credential and returns it in the response body. | ||||||
operationId: deriveCredential | ||||||
description: Derives a credential and returns it in the response body. | ||||||
|
@@ -36,11 +124,99 @@ paths: | |||||
description: Internal Error | ||||||
"501": | ||||||
description: Not Implemented | ||||||
|
||||||
/presentations/{id}: | ||||||
get: | ||||||
tags: | ||||||
- Presentations | ||||||
summary: Gets a presentation or verifiable presentation by ID | ||||||
operationId: getPresentation | ||||||
parameters: | ||||||
- $ref: "./components/parameters/path/ObjectId.yml" | ||||||
responses: | ||||||
"200": | ||||||
description: Credential retrieved | ||||||
content: | ||||||
application/json: | ||||||
schema: | ||||||
oneOf: | ||||||
- $ref: "./components/Presentation.yml#/components/schemas/Presentation" | ||||||
- $ref: "./components/VerifiablePresentation.yml#/components/schemas/VerifiablePresentation" | ||||||
"400": | ||||||
description: Bad Request | ||||||
"401": | ||||||
description: Not Authorized | ||||||
"410": | ||||||
description: Gone! There is no data here | ||||||
"500": | ||||||
description: Internal Error | ||||||
"501": | ||||||
description: Not Implemented | ||||||
delete: | ||||||
tags: | ||||||
- Presentations | ||||||
summary: Deletes a presentation or verifiable presentation by ID | ||||||
operationId: deletePresentation | ||||||
parameters: | ||||||
- $ref: "./components/parameters/path/ObjectId.yml" | ||||||
responses: | ||||||
"202": | ||||||
description: Presentation deleted - this is a 202 by default as soft deletes and processing time are assumed | ||||||
"400": | ||||||
description: Bad Request | ||||||
"401": | ||||||
description: Not Authorized | ||||||
"410": | ||||||
description: Gone! There is no data here | ||||||
"500": | ||||||
description: Internal Error | ||||||
"501": | ||||||
description: Not Implemented | ||||||
/Presentation: | ||||||
get: | ||||||
tags: | ||||||
- Presentations | ||||||
summary: Gets list of presentations or verifiable presentations | ||||||
operationId: getPresentations | ||||||
parameters: | ||||||
- in: query | ||||||
name: type | ||||||
schema: | ||||||
type: array | ||||||
items: | ||||||
type: string | ||||||
oneOf: | ||||||
- "presentations" | ||||||
- "verifiablepresentations" | ||||||
- "all" | ||||||
responses: | ||||||
"200": | ||||||
description: Presentations retrieved | ||||||
content: | ||||||
application/json: | ||||||
schema: | ||||||
type: array | ||||||
description: The Presentations | ||||||
items: | ||||||
anyOf: | ||||||
- $ref: "./components/Presentation.yml#/components/schemas/Presentation" | ||||||
- $ref: "./components/VerifiablePresentation.yml#/components/schemas/VerifiablePresentation" | ||||||
"400": | ||||||
description: Bad Request | ||||||
"401": | ||||||
description: Not Authorized | ||||||
"410": | ||||||
description: Gone! There is no data here | ||||||
"500": | ||||||
description: Internal Error | ||||||
"501": | ||||||
description: Not Implemented | ||||||
|
||||||
/presentations/prove: | ||||||
post: | ||||||
summary: Proves a presentation and returns it in the response body. | ||||||
tags: | ||||||
- presentation | ||||||
- Presentations | ||||||
operationId: provePresentation | ||||||
description: Proves a presentation and returns it in the response body. | ||||||
requestBody: | ||||||
|
@@ -60,11 +236,12 @@ paths: | |||||
description: invalid input! | ||||||
"500": | ||||||
description: error! | ||||||
|
||||||
/exchanges/{exchange-id}: | ||||||
post: | ||||||
summary: Initiates an exchange of information. | ||||||
tags: | ||||||
- exchange | ||||||
- Exchanges | ||||||
operationId: initiateExchange | ||||||
description: | ||||||
A client can use this endpoint to initiate an exchange of a particular | ||||||
|
@@ -110,7 +287,7 @@ paths: | |||||
put: | ||||||
summary: Receives information related to an existing exchange. | ||||||
tags: | ||||||
- exchange | ||||||
- Exchanges | ||||||
operationId: receiveExchangeData | ||||||
description: | ||||||
A client can use this endpoint to continue the exchange of information | ||||||
|
@@ -143,6 +320,7 @@ paths: | |||||
description: Internal server error. | ||||||
"501": | ||||||
description: Service not implemented. | ||||||
|
||||||
components: | ||||||
schemas: | ||||||
DeriveCredentialRequest: | ||||||
|
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.
are we going to define authorization? and test it?
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.
The test suites will need to have some authz mechanism in them because the production software that all implementers are implementing are all (AFAIK) requiring authz. If we have interop on the test suites, the spec will have to reflect reality and document how authz is being performed in an interoperable fashion.