From eb9c1f2f0e067eea1530053ed8479197a683fbf2 Mon Sep 17 00:00:00 2001 From: Martin Schmidt Date: Fri, 12 Apr 2024 12:36:09 +0200 Subject: [PATCH 1/2] Add preliminary API for OriginStamp service --- open-api.yaml | 136 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 136 insertions(+) create mode 100644 open-api.yaml diff --git a/open-api.yaml b/open-api.yaml new file mode 100644 index 0000000..c830970 --- /dev/null +++ b/open-api.yaml @@ -0,0 +1,136 @@ +openapi: 3.0.0 +info: + description: This is a preliminary API for the OriginStamp service + version: "0.0.1" + title: OriginStamp + license: + name: Apache 2.0 + url: 'http://www.apache.org/licenses/LICENSE-2.0.html' +tags: + - name: recipients + description: bla bla bla chistoffer bla bla bla + +paths: + /v1/recipients: + post: + summary: Creates a new recipient + description: Create a new recipient to allow Stamp to issue certificates to the recipients wallet. + operationId: CreateRecipient + tags: + - recipients + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/recipientPost' + responses: + '201': + description: Recipient created + content: + application/json: + schema: + $ref: '#/components/schemas/recipientCreated' + '400': + description: Invalid create request + + /v1/certificates: + post: + summary: Queues a certificate to be issued to a recipient + description: Queues a certificate to be issued to the registry and recipients wallet. + operationId: IssueCertificate + tags: + - issue + requestBody: + content: + application/json: + schema: + type: object + properties: + recipient: + type: string + format: uuid + example: f5d8ee39-0f64-4a8f-9d4e-e25b8f3a5b3f + certificate: + $ref: '#/components/schemas/certificate' + responses: + '202': + description: Accepted for issuance. + '400': + description: Invalid issuance request. + +components: + schemas: + certificate: + type: object + properties: + type: + type: string + enum: [production, consumption] + quantity: + description: "The number of watt hours on the certificate" + type: integer + format: int64 + example: 1200 + start: + description: "The start of the time range in Unix time in seconds." + type: integer + format: int64 + example: 1641376800 + end: + description: "The end of the time range in Unix time in seconds." + type: integer + format: int64 + example: 1641380400 + gridArea: + type: string + description: "The grid area of where the certificate exists within" + example: "DK1" + clearTextAttributes: + description: "Attributes to be added to the certificate that are clear-text and everyone can see." + type: object + additionalProperties: + type: string + example: + fuelCode: "F1023433" + techCode: "T1023431" + hashedAttributes: + description: "Attributes that are only viewable by an owner given access to the attribute." + type: object + additionalProperties: + type: string + example: + assetId: "123456789" + + recipientPost: + type: object + required: + - walletEndpointReference + properties: + walletEndpointReference: + $ref: '#/components/schemas/walletEndpointReference' + + recipientCreated: + type: object + properties: + id: + type: string + format: uuid + example: f5d8ee39-0f64-4a8f-9d4e-e25b8f3a5b3f + + walletEndpointReference: + type: object + required: + - endpoint + - publicKey + - version + properties: + version: + type: integer + example: 1 + endpoint: + type: string + format: url + example: https://example.com/wallet + publicKey: + type: string + example: c2FydGhzdGhyc3J1amhzcnR2anNyeXRqc2pydHk= \ No newline at end of file From 43666cc4b84ad3d9208cf6e187084550193f703b Mon Sep 17 00:00:00 2001 From: Martin Schmidt Date: Fri, 12 Apr 2024 12:36:44 +0200 Subject: [PATCH 2/2] Update open-api.yaml --- open-api.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/open-api.yaml b/open-api.yaml index c830970..b98e19e 100644 --- a/open-api.yaml +++ b/open-api.yaml @@ -133,4 +133,4 @@ components: example: https://example.com/wallet publicKey: type: string - example: c2FydGhzdGhyc3J1amhzcnR2anNyeXRqc2pydHk= \ No newline at end of file + example: c2FydGhzdGhyc3J1amhzcnR2anNyeXRqc2pydHk=