-
Notifications
You must be signed in to change notification settings - Fork 2
/
customer-server.api.yml
285 lines (282 loc) · 8.38 KB
/
customer-server.api.yml
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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
openapi: 3.0.0
info:
version: 1.0.0
title: Custom Server API
description: API between HSM Agent and custom client's server
servers:
- url: https://localhost:5000/v1
paths:
/messagesStatus:
post:
summary: Get updates on requested messages
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/MessagesStatusRequest"
responses:
200:
description: Messages Status
content:
application/json:
schema:
$ref: "#/components/schemas/MessagesStatusResponse"
/messagesToSign:
post:
summary: Sign Messages
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/MessagesRequest"
description: Messages to sign
responses:
200:
description: Messages Status
content:
application/json:
schema:
$ref: "#/components/schemas/MessagesStatusResponse"
default:
$ref: "#/components/schemas/Error"
components:
schemas:
MessagesStatusRequest:
type: object
required:
- requestsIds
properties:
requestsIds:
type: array
items:
description: The unique request ID used for tracking the request.
type: string
format: uuid
example: e7568058-c090-4042-8a6a-957f2292b72c
MessagesStatusResponse:
type: object
required:
- statuses
properties:
statuses:
type: array
items:
$ref: "#/components/schemas/MessageStatus"
MessagesRequest:
type: object
required:
- messages
properties:
messages:
type: array
items:
$ref: "#/components/schemas/MessageEnvelope"
MessageEnvelope:
description: Contains the message and transportMetadata necessary for internal Fireblocks operations.
type: object
required:
- message
- transportMetadata
properties:
message:
$ref: "#/components/schemas/Message"
transportMetadata:
$ref: "#/components/schemas/TransportMetadata"
TransportMetadata:
description: Metadata necessary for internal Fireblocks operations.
required:
- requestId
- type
properties:
requestId:
description: The unique request ID used for tracking the request.
type: string
format: uuid
type:
$ref: "#/components/schemas/RequestType"
Message:
required:
- payloadSignatureData
- payload
properties:
payloadSignatureData:
$ref: "#/components/schemas/PayloadSignatureData"
payload:
description: Stringified JSON that holds the message payload. Parsed object will be of type '#/components/schemas/MessagePayload'
type: string
example: '{ "type": "KEY_LINK_PROOF_OF_OWNERSHIP_REQUEST", "tenantId": "ea7d0d9a-6a10-4288-9b91-da8fb0b149f2" }'
PayloadSignatureData:
description: The signature data of the payload and the service that signed it.
type: object
required:
- signature
- service
properties:
signature:
type: string
example: 3de97a18822d06fd19bea82522917c634c134a13ace2b887cf12e37dfd343d30
service:
type: string
example: signing_service
MessagePayload:
required:
- tenantId
- type
- algorithm
- signingDeviceKeyId
- keyId
- messagesToSign
properties:
tenantId:
description: The identifier of customer's Fireblocks tenant/workspace
type: string
format: uuid
example: ea7d0d9a-6a10-4288-9b91-da8fb0b149f2
type:
$ref: "#/components/schemas/RequestType"
algorithm:
$ref: "#/components/schemas/Algorithm"
signingDeviceKeyId:
description: The identifier of the signing key on the customer's servers
type: string
example: 70721651-a7f3-42f6-a984-6e058269495f
keyId:
description: The identifier of the signing key on Fireblocks
type: string
format: uuid
example: 70721651-a7f3-42f6-a984-6e058269495f
messagesToSign:
description: An array including the messages to be signed
type: array
items:
$ref: "#/components/schemas/MessageToSign"
requestId:
description: The unique request ID used exclusively for Proof of Ownership requests.
type: string
format: uuid
example: b015f35e-5d44-4d68-a0df-a1c625255abc
txId:
description: The unique transaction ID used exclusively for transaction signing requests.
type: string
format: uuid
example: 8c2b2b3d-fb83-497e-8138-72446b9184b6
timestamp:
type: number
example: 1704122262
version:
type: string
example: 1.0.0
metadata:
description: The metadata provides comprehensive information about the transaction, policy outcomes, and other pertinent details.
type: object
TxMetadata:
description: The metadata provides comprehensive information about the transaction, policy outcomes, and other pertinent details.
required:
- txMetaData
- txMetaDataSignatures
properties:
txMetaData:
type: string
txMetaDataSignatures:
type: array
items:
$ref: "#/components/schemas/TxMetadataSignature"
TxMetadataSignature:
description: The signature of the transaction metadata.
required:
- id
- type
- signature
properties:
id:
type: string
example: policy_service
type:
type: string
example: SERVICE
signature:
type: string
example: 3de97a18822d06fd19bea82522917c634c134a13ace2b887cf12e37dfd343d30
MessageToSign:
description: A message that needs to be signed by the customer's key.
type: object
required:
- message
- index
properties:
message:
description: The message to be signed.
type: string
index:
description: The index of the message.
type: number
MessageStatus:
type: object
required:
- type
- status
- requestId
- response
properties:
type:
$ref: "#/components/schemas/ResponseType"
status:
type: string
enum: [PENDING_SIGN, SIGNED, FAILED]
example: SIGNED
requestId:
description: The unique request ID used for tracking the request.
type: string
format: uuid
example: b015f35e-5d44-4d68-a0df-a1c625255abc
response:
$ref: "#/components/schemas/MessageResponse"
MessageResponse:
type: object
properties:
signedMessages:
type: array
items:
$ref: "#/components/schemas/SignedMessage"
errorMessage:
type: string
example: Error signing the request.
SignedMessage:
type: object
required:
- message
- signature
- index
properties:
message:
type: string
index:
type: number
signature:
type: string
example: 3de97a18822d06fd19bea82522917c634c134a13ace2b887cf12e37dfd343d30
RequestType:
description: The type of the message.
type: string
enum: [KEY_LINK_PROOF_OF_OWNERSHIP_REQUEST, KEY_LINK_TX_SIGN_REQUEST]
example: KEY_LINK_PROOF_OF_OWNERSHIP_REQUEST
ResponseType:
description: Indicates the type of message for which the status is provided.
type: string
enum: [KEY_LINK_PROOF_OF_OWNERSHIP_RESPONSE, KEY_LINK_TX_SIGN_RESPONSE]
example: KEY_LINK_PROOF_OF_OWNERSHIP_RESPONSE
Algorithm:
description: The cryptographic algorithm used for signing.
type: string
enum: [ECDSA_SECP256K1, EDDSA_ED25519]
example: ECDSA_SECP256K1
Error:
type: object
required:
- code
- message
properties:
message:
type: string