-
Notifications
You must be signed in to change notification settings - Fork 0
/
openapi.yaml
152 lines (148 loc) · 5.2 KB
/
openapi.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
openapi: 3.0.3
info:
title: dhstore HTTP API
description: dhstore HTTP API
version: 0.0.1
servers:
- url: 'http://localhost:40080'
paths:
/multihash:
put:
description: Merges one or more double-hashed multihash and encrypted index value key pairs.
requestBody:
required: true
content:
'application/json':
example:
merges:
- key: "ViAJKqT0hRtxENbtjWwvnRogQknxUnhswNrose3ZjEP8Iw=="
- value: "ZmlzaA=="
schema:
type: object
properties:
merges:
type: array
items:
type: object
properties:
key:
type: string
description: base64 encoded multihash
value:
type: string
description: base64 encoded encrypted index value keys.
responses:
'202':
description: Request to merge values is accepted and will eventually be persisted.
'400':
description: The given request is not valid.
content:
text/plain: { }
'500':
description: Failure occurred while processing the request.
content:
text/plain: { }
/multihash/{multihash}:
get:
description: Find encrypted values that correspond to a multihash with could dbl-sha2-256
parameters:
- name: multihash
in: path
description: The base58 string representation of multihash. Must be a dbl-sha2-256 multihash.
required: true
responses:
'200':
description: Given multihash and a list of encrypted values associated to it.
content:
'application/json':
schema:
type: object
properties:
EncryptedMultihashResults:
type: array
items:
type: object
properties:
Multihash:
type: string
description: base58 string representation of queried multihash
EncryptedValueKeys:
type: array
items:
type: string
description: base64 encoded encrypted index value keys.
example: |
{"EncryptedMultihashResults": [{ "Multihash": "ViAJKqT0hRtxENbtjWwvnRogQknxUnhswNrose3ZjEP8Iw==", "EncryptedValueKeys": ["ZmlzaA==", "bG9ic3Rlcg==", "dW5kYWRhc2Vh"] }]}
'application/x-ndjson':
schema:
type: object
properties:
EncryptedValueKey:
type: string
description: base64 encoded encrypted index value keys.
example: |
{"EncryptedValueKey":"ZmlzaA=="}
{"EncryptedValueKey":"bG9ic3Rlcg=="}
{"EncryptedValueKey":"dW5kYWRhc2Vh"}
'400':
description: The given request is not valid.
content:
text/plain: { }
'404':
description: No encrypted index value keys found for the given multihash.
'500':
description: Failure occurred while processing the request.
content:
text/plain: { }
/metadata/{key}:
parameters:
- name: key
in: path
description: The base58 string representation of key associated to the encrypted IPNI Metadata.
required: true
get:
description: Find encrypted IPNI Metadata corresponding to the given key.
responses:
'200':
description: The encrypted IPNI Metadata.
content:
'application/json':
schema:
type: object
properties:
EncryptedMetadata:
type: string
description: base64 encoded encrypted IPNI Metadata.
'400':
description: The given request is not valid.
content:
text/plain: { }
'404':
description: No encrypted IPNI Metadata is associated to the given key.
'500':
description: Failure occurred while processing the request.
content:
text/plain: { }
put:
description: Stores encrypted IPNI Metadata associated to the given key.
requestBody:
required: true
content:
'application/json':
schema:
type: object
properties:
EncryptedMetadata:
type: string
description: The encrypted IPNI Metadata as base64 encoded string.
responses:
'202':
description: Request is accepted and will eventually be persisted.
'400':
description: The given request is not valid.
content:
text/plain: { }
'500':
description: Failure occurred while processing the request.
content:
text/plain: { }