/
openapi.go
1077 lines (1075 loc) · 32 KB
/
openapi.go
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
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Copyright 2020 Finobo
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package handlers
//nolint: gofmt
//nolint: lll
//nolint: funlen
func spec() string {
return `
{
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"schemes": [
"https"
],
"swagger": "2.0",
"info": {
"description": "All the information needed to talk to the API.\n\nTo raise see anything wrong? Raise an [issue](https://github.com/mailchain/mailchain/issues)",
"title": "Mailchain API",
"version": "~mailchain-version~"
},
"basePath": "/api",
"paths": {
"/addresses": {
"get": {
"description": "Get all address that this user has access to. The addresses can be used to send or receive messages.",
"tags": [
"Addresses"
],
"summary": "Get addresses.",
"operationId": "GetAddresses",
"parameters": [
{
"enum": [
"mainnet",
"goerli",
"ropsten",
"rinkeby",
"local"
],
"type": "string",
"example": "goerli",
"x-go-name": "Network",
"description": "Network to use when finding addresses.",
"name": "network",
"in": "query",
"required": true
},
{
"enum": [
"ethereum",
" substrate"
],
"type": "string",
"example": "ethereum",
"x-go-name": "Protocol",
"description": "Protocol to use when finding addresses.",
"name": "protocol",
"in": "query",
"required": true
}
],
"responses": {
"200": {
"$ref": "#/responses/GetAddressesResponse"
},
"404": {
"$ref": "#/responses/NotFoundError"
},
"422": {
"$ref": "#/responses/ValidationError"
}
}
}
},
"/envelope": {
"get": {
"description": "Get envelope\nThis method returns the available envelope types",
"tags": [
"Envelope"
],
"summary": "Get Mailchain envelope",
"operationId": "GetEnvelope",
"responses": {
"200": {
"$ref": "#/responses/GetEnvelopeResponse"
}
}
}
},
"/messages": {
"get": {
"description": "Check the protocol, network, address combination for Mailchain messages.",
"tags": [
"Messages"
],
"summary": "Get Mailchain messages.",
"operationId": "GetMessages",
"parameters": [
{
"pattern": "0x[a-fA-F0-9]{40}",
"type": "string",
"example": "0xde0b295669a9fd93d5f28d9ec85e40f4cb697bae",
"x-go-name": "Address",
"description": "Address to use when looking for messages.",
"name": "address",
"in": "query",
"required": true
},
{
"enum": [
"mainnet",
"goerli",
"ropsten",
"rinkeby",
"local"
],
"type": "string",
"example": "goerli",
"x-go-name": "Network",
"description": "Network to use when looking for messages.",
"name": "network",
"in": "query",
"required": true
},
{
"enum": [
"ethereum"
],
"type": "string",
"example": "ethereum",
"x-go-name": "Protocol",
"description": "Protocol to use when looking for messages.",
"name": "protocol",
"in": "query",
"required": true
}
],
"responses": {
"200": {
"$ref": "#/responses/GetMessagesResponse"
},
"422": {
"$ref": "#/responses/ValidationError"
}
}
},
"post": {
"description": "Securely send message on the protocol and network specified in the query string to the address.\nOnly the private key holder for the recipient address can decrypt any encrypted contents.\n\nCreate mailchain message\nEncrypt content with public key\nStore message\nEncrypt location\nStore encrypted location on the blockchain.",
"tags": [
"Send"
],
"summary": "Send message.",
"operationId": "SendMessage",
"parameters": [
{
"enum": [
"mainnet",
"goerli",
"ropsten",
"rinkeby",
"local"
],
"type": "string",
"example": "goerli",
"x-go-name": "Network",
"description": "Network to use when sending a message.",
"name": "network",
"in": "query",
"required": true
},
{
"enum": [
"ethereum"
],
"type": "string",
"example": "ethereum",
"x-go-name": "Protocol",
"description": "Protocol to use when sending a message.",
"name": "protocol",
"in": "query",
"required": true
},
{
"description": "Message to send",
"name": "Body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/SendMessageRequestBody"
}
}
],
"responses": {
"200": {
"$ref": "#/responses/StatusOK"
},
"404": {
"$ref": "#/responses/NotFoundError"
},
"422": {
"$ref": "#/responses/ValidationError"
}
}
}
},
"/messages/{message_id}/read": {
"get": {
"description": "Messages can be either read or unread.",
"tags": [
"Messages"
],
"summary": "Message read status.",
"operationId": "GetRead",
"responses": {
"200": {
"$ref": "#/responses/GetReadResponse"
},
"404": {
"$ref": "#/responses/NotFoundError"
},
"422": {
"$ref": "#/responses/ValidationError"
}
}
},
"put": {
"description": "Mark message as read.",
"tags": [
"Messages"
],
"summary": "PutRead.",
"operationId": "PutRead",
"parameters": [
{
"type": "string",
"x-go-name": "MessageID",
"description": "Unique id of the message",
"name": "message_id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"$ref": "#/responses/StatusOK"
},
"404": {
"$ref": "#/responses/NotFoundError"
},
"422": {
"$ref": "#/responses/ValidationError"
}
}
},
"delete": {
"description": "Mark message as unread",
"tags": [
"Messages"
],
"operationId": "DeleteRead",
"parameters": [
{
"type": "string",
"x-go-name": "MessageID",
"description": "Unique id of the message",
"name": "message_id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"$ref": "#/responses/StatusOK"
},
"404": {
"$ref": "#/responses/NotFoundError"
},
"422": {
"$ref": "#/responses/ValidationError"
}
}
}
},
"/nameservice/address/{address}/resolve?network={network}\u0026protocol={protocol}": {
"get": {
"description": "Get name for supplied address. The name is typically a human-readable value that can be used in place of the address.\nResolve will query the protocol's name service to find the human-readable name for the supplied address.",
"tags": [
"NameService"
],
"summary": "Resolve Address Against Name Service",
"operationId": "GetResolveAddress",
"parameters": [
{
"type": "string",
"example": "0x4ad2b251246aafc2f3bdf3b690de3bf906622c51",
"x-go-name": "Address",
"description": "name to query to get address for",
"name": "address",
"in": "path",
"required": true
},
{
"enum": [
"mainnet",
"goerli",
"ropsten",
"rinkeby",
"local"
],
"type": "string",
"example": "goerli",
"x-go-name": "Network",
"description": "Network for the name to resolve",
"name": "network",
"in": "path",
"required": true
},
{
"enum": [
"ethereum"
],
"type": "string",
"example": "ethereum",
"x-go-name": "Protocol",
"description": "Protocol for the name to resolve",
"name": "protocol",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"$ref": "#/responses/GetResolveAddressResponse"
},
"404": {
"$ref": "#/responses/NotFoundError"
},
"422": {
"$ref": "#/responses/ValidationError"
}
}
}
},
"/nameservice/name/{domain-name}/resolve?network={network}\u0026protocol={protocol}": {
"get": {
"description": "Get address for supplied name. The name is typically a human-readable value that can be used in place of the address.\nResolve will query the protocol's name service to find the address for supplied human-readable name.",
"tags": [
"NameService"
],
"summary": "Resolve Name Against Name Service",
"operationId": "GetResolveName",
"parameters": [
{
"type": "string",
"example": "mailchain.eth",
"x-go-name": "Name",
"description": "name to query to get address for",
"name": "domain-name",
"in": "path",
"required": true
},
{
"enum": [
"mainnet",
"goerli",
"ropsten",
"rinkeby",
"local"
],
"type": "string",
"example": "goerli",
"x-go-name": "Network",
"description": "Network for the name to resolve",
"name": "network",
"in": "path",
"required": true
},
{
"enum": [
"ethereum"
],
"type": "string",
"example": "ethereum",
"x-go-name": "Protocol",
"description": "Protocol for the name to resolve",
"name": "protocol",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"$ref": "#/responses/GetResolveNameResponse"
},
"404": {
"$ref": "#/responses/NotFoundError"
},
"422": {
"$ref": "#/responses/ValidationError"
}
}
}
},
"/protocols": {
"get": {
"description": "Get all networks for each protocol that is enabled.",
"tags": [
"Protocols"
],
"summary": "Get protocols and the networks.",
"operationId": "GetProtocols",
"responses": {
"200": {
"$ref": "#/responses/GetProtocolsResponse"
},
"404": {
"$ref": "#/responses/NotFoundError"
},
"422": {
"$ref": "#/responses/ValidationError"
}
}
}
},
"/public-key": {
"get": {
"description": "This method will get the public key to use when encrypting messages and envelopes.\nProtocols and networks have different methods for retrieving or calculating a public key from an address.",
"tags": [
"PublicKey"
],
"summary": "Public key from address.",
"operationId": "GetPublicKey",
"parameters": [
{
"pattern": "0x[a-fA-F0-9]{40}",
"type": "string",
"example": "0xde0b295669a9fd93d5f28d9ec85e40f4cb697bae",
"x-go-name": "Address",
"description": "Address to to use when performing public key lookup.",
"name": "address",
"in": "query",
"required": true
},
{
"enum": [
"mainnet",
"goerli",
"ropsten",
"rinkeby",
"local"
],
"type": "string",
"example": "goerli",
"x-go-name": "Network",
"description": "Network to use when performing public key lookup.",
"name": "network",
"in": "query",
"required": true
},
{
"enum": [
"ethereum"
],
"type": "string",
"example": "ethereum",
"x-go-name": "Protocol",
"description": "Protocol to use when performing public key lookup.",
"name": "protocol",
"in": "query",
"required": true
}
],
"responses": {
"200": {
"$ref": "#/responses/GetPublicKeyResponse"
},
"404": {
"$ref": "#/responses/NotFoundError"
},
"422": {
"$ref": "#/responses/ValidationError"
}
}
}
},
"/version": {
"get": {
"description": "Get version of the running mailchain client application and API.\nThis method be used to determine what version of the API and client is being used and what functionality.",
"tags": [
"Version"
],
"summary": "Get version",
"operationId": "GetVersion",
"responses": {
"200": {
"description": "GetVersionResponseBody",
"schema": {
"$ref": "#/definitions/GetVersionResponseBody"
}
}
}
}
}
},
"definitions": {
"GetAddressesItem": {
"type": "object",
"required": [
"value",
"encoding"
],
"properties": {
"encoding": {
"description": "Encoding method used for encoding the ¬address¬",
"type": "string",
"x-go-name": "Encoding",
"example": "hex/0x-prefix"
},
"value": {
"description": "Address value",
"type": "string",
"x-go-name": "Value",
"example": "0x5602ea95540bee46d03ba335eed6f49d117eab95c8ab8b71bae2cdd1e564a761"
}
},
"x-go-package": "github.com/mailchain/mailchain/cmd/mailchain/internal/http/handlers"
},
"GetEnvelopeResponseBodyElement": {
"description": "GetEnvelopeResponseBodyElement response",
"type": "object",
"required": [
"type",
"description"
],
"properties": {
"description": {
"description": "The envelope description",
"type": "string",
"x-go-name": "Description",
"example": "Private Message Stored with MLI"
},
"type": {
"description": "The envelope type",
"type": "string",
"x-go-name": "Type",
"example": "0x01"
}
},
"x-go-package": "github.com/mailchain/mailchain/cmd/mailchain/internal/http/handlers"
},
"GetMessagesResponseHeaders": {
"type": "object",
"properties": {
"content-type": {
"description": "The content type and the encoding of the message body",
"type": "string",
"x-go-name": "ContentType",
"readOnly": true,
"example": "text/plain; charset=\\\"UTF-8\\\","
},
"date": {
"description": "When the message was created, this can be different to the transaction data of the message.",
"type": "string",
"format": "date-time",
"x-go-name": "Date",
"readOnly": true,
"example": "12 Mar 19 20:23 UTC"
},
"from": {
"description": "The sender of the message",
"type": "string",
"x-go-name": "From",
"readOnly": true,
"example": "Charlotte \u003c5602ea95540bee46d03ba335eed6f49d117eab95c8ab8b71bae2cdd1e564a761@ropsten.ethereum\u003e"
},
"message-id": {
"description": "Unique identifier of the message",
"type": "string",
"x-go-name": "MessageID",
"readOnly": true,
"example": "47eca011e32b52c71005ad8a8f75e1b44c92c99fd12e43bccfe571e3c2d13d2e9a826a550f5ff63b247af471@mailchain"
},
"reply-to": {
"description": "Reply to if the reply address is different to the from address.",
"type": "string",
"x-go-name": "ReplyTo",
"readOnly": true
},
"to": {
"description": "The recipient of the message",
"type": "string",
"x-go-name": "To",
"readOnly": true
}
},
"x-go-name": "getHeaders",
"x-go-package": "github.com/mailchain/mailchain/cmd/mailchain/internal/http/handlers"
},
"GetMessagesResponseMessage": {
"type": "object",
"properties": {
"block-id": {
"description": "Transaction's block number",
"type": "string",
"x-go-name": "BlockID",
"readOnly": true
},
"block-id-encoding": {
"description": "Transaction's block number encoding type used by the specific protocol",
"type": "string",
"x-go-name": "BlockIDEncoding",
"readOnly": true
},
"body": {
"description": "Body of the mail message",
"type": "string",
"x-go-name": "Body",
"readOnly": true,
"example": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur maximus metus ante, sit amet ullamcorper dui hendrerit ac."
},
"headers": {
"$ref": "#/definitions/GetMessagesResponseHeaders"
},
"read": {
"description": "Read status of the message",
"type": "boolean",
"x-go-name": "Read",
"readOnly": true,
"example": true
},
"status": {
"type": "string",
"x-go-name": "Status",
"readOnly": true
},
"status-code": {
"type": "string",
"x-go-name": "StatusCode",
"readOnly": true
},
"subject": {
"description": "Subject of the mail message",
"type": "string",
"x-go-name": "Subject",
"readOnly": true,
"example": "Hello world"
},
"transaction-hash": {
"description": "Transaction's hash",
"type": "string",
"x-go-name": "TransactionHash",
"readOnly": true
},
"transaction-hash-encoding": {
"description": "Transaction's hash encoding type used by the specific protocol",
"type": "string",
"x-go-name": "TransactionHashEncoding",
"readOnly": true
}
},
"x-go-name": "getMessage",
"x-go-package": "github.com/mailchain/mailchain/cmd/mailchain/internal/http/handlers"
},
"GetProtocolsProtocol": {
"type": "object",
"properties": {
"name": {
"description": "in: body",
"type": "string",
"x-go-name": "Name"
},
"networks": {
"description": "in: body",
"type": "array",
"items": {
"$ref": "#/definitions/Network"
},
"x-go-name": "Networks"
}
},
"x-go-package": "github.com/mailchain/mailchain/cmd/mailchain/internal/http/handlers"
},
"GetPublicKeyResponseBody": {
"description": "GetPublicKeyResponseBody body response",
"type": "object",
"required": [
"public-key",
"public-key-encoding",
"public-key-kind",
"supported-encryption-types"
],
"properties": {
"public-key": {
"description": "The public key encoded as per ¬public-key-encoding¬",
"type": "string",
"x-go-name": "PublicKey",
"example": "0x79964e63752465973b6b3c610d8ac773fc7ce04f5d1ba599ba8768fb44cef525176f81d3c7603d5a2e466bc96da7b2443bef01b78059a98f45d5c440ca379463"
},
"public-key-encoding": {
"description": "Encoding method used for encoding the ¬public-key¬",
"type": "string",
"x-go-name": "PublicKeyEncoding",
"example": "hex/0x-prefix"
},
"public-key-kind": {
"description": "Encoding method used for encoding the ¬public-key¬",
"type": "string",
"x-go-name": "PublicKeyKind",
"example": "[\"secp256k1\", \"sr25519\", \"ed25519\"]"
},
"supported-encryption-types": {
"description": "Supported encryption methods for public keys.",
"type": "array",
"items": {
"type": "string"
},
"x-go-name": "SupportedEncryptionTypes",
"example": [
"aes256cbc",
"nacl-ecdh",
"noop"
]
}
},
"x-go-package": "github.com/mailchain/mailchain/cmd/mailchain/internal/http/handlers"
},
"GetReadResponseBody": {
"type": "object",
"required": [
"read"
],
"properties": {
"read": {
"description": "Read",
"type": "boolean",
"x-go-name": "Read",
"example": true
}
},
"x-go-name": "getBody",
"x-go-package": "github.com/mailchain/mailchain/cmd/mailchain/internal/http/handlers"
},
"GetResolveAddressResponseBody": {
"description": "GetResolveAddressResponseBody body response",
"type": "object",
"required": [
"name"
],
"properties": {
"name": {
"description": "The resolved name",
"type": "string",
"x-go-name": "Name",
"example": "mailchain.eth"
},
"status": {
"description": "The RFC1035 status code describing the outcome of the lookup\n\n+ 0 - No Error\n+ 1 - Format Error\n+ 2 - Server Failure\n+ 3 - Non-Existent Domain\n+ 4 - Not Implemented\n+ 5 - Query Refused",
"type": "integer",
"format": "int64",
"x-go-name": "Status",
"example": 3
}
},
"x-go-package": "github.com/mailchain/mailchain/cmd/mailchain/internal/http/handlers"
},
"GetResolveNameResponseBody": {
"description": "GetResolveNameResponseBody body response",
"type": "object",
"required": [
"address"
],
"properties": {
"address": {
"description": "The resolved address",
"type": "string",
"x-go-name": "Address",
"example": "0x4ad2b251246aafc2f3bdf3b690de3bf906622c51"
},
"status": {
"description": "The rFC1035 status code describing the outcome of the lookup\n\n+ 0 - No Error\n+ 1 - Format Error\n+ 2 - Server Failure\n+ 3 - Non-Existent Domain\n+ 4 - Not Implemented\n+ 5 - Query Refused",
"type": "integer",
"format": "int64",
"x-go-name": "Status",
"example": 3
}
},
"x-go-package": "github.com/mailchain/mailchain/cmd/mailchain/internal/http/handlers"
},
"GetVersionResponseBody": {
"description": "GetVersionResponseBody response",
"type": "object",
"required": [
"version",
"commit",
"time"
],
"properties": {
"commit": {
"description": "The resolved version commit",
"type": "string",
"x-go-name": "VersionCommit"
},
"time": {
"description": "The resolved version release date",
"type": "string",
"x-go-name": "VersionDate",
"example": "2019-09-04T21:59:26Z"
},
"version": {
"description": "The resolved version tag",
"type": "string",
"x-go-name": "VersionTag",
"example": "1.0.0"
}
},
"x-go-package": "github.com/mailchain/mailchain/cmd/mailchain/internal/http/handlers"
},
"Network": {
"type": "object",
"properties": {
"id": {
"type": "string",
"x-go-name": "ID"
},
"name": {
"type": "string",
"x-go-name": "Name"
},
"nameservice-address-enabled": {
"type": "boolean",
"x-go-name": "NameServiceAddressEnabled"
},
"nameservice-domain-enabled": {
"type": "boolean",
"x-go-name": "NameServiceDomainEnabled"
}
},
"x-go-package": "github.com/mailchain/mailchain/cmd/mailchain/internal/http/handlers"
},
"PostMessagesResponseHeaders": {
"description": "PostHeaders body",
"type": "object",
"required": [
"from",
"to"
],
"properties": {
"from": {
"description": "The sender of the message",
"type": "string",
"x-go-name": "From",
"example": "Charlotte \u003c5602ea95540bee46d03ba335eed6f49d117eab95c8ab8b71bae2cdd1e564a761@ropsten.ethereum\u003e"
},
"reply-to": {
"description": "Reply to if the reply address is different to the from address.",
"type": "string",
"x-go-name": "ReplyTo"
},
"to": {
"description": "The recipient of the message",
"type": "string",
"x-go-name": "To"
}
},
"x-go-name": "PostHeaders",
"x-go-package": "github.com/mailchain/mailchain/cmd/mailchain/internal/http/handlers"
},
"PostMessagesResponseMessage": {
"description": "PostMessage body",
"type": "object",
"required": [
"headers",
"body",
"subject",
"public-key",
"public-key-encoding"
],
"properties": {
"body": {
"description": "Body of the mail message",
"type": "string",
"x-go-name": "Body",
"example": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur maximus metus ante,"
},
"headers": {
"$ref": "#/definitions/PostMessagesResponseHeaders"
},
"public-key": {
"description": "Public key of the recipient to encrypt with",
"type": "string",
"x-go-name": "PublicKey"
},
"public-key-encoding": {
"description": "Public key Encoding",
"type": "string",
"x-go-name": "PublicKeyEncoding"
},
"public-key-kind": {
"description": "Public key kind\nrequire: true",
"type": "string",
"x-go-name": "PublicKeyKind"
},
"subject": {
"description": "Subject of the mail message",
"type": "string",
"x-go-name": "Subject",
"example": "Hello world"
}
},
"x-go-name": "PostMessage",
"x-go-package": "github.com/mailchain/mailchain/cmd/mailchain/internal/http/handlers"
},
"SendMessageRequestBody": {
"description": "PostRequestBody body",
"type": "object",
"required": [
"message",
"envelope",
"encryption-method-name"
],
"properties": {
"content-type": {
"description": "Message content-type provided by the client\nrequired: false (default text/plain; charset=\\\"UTF-8\\\")",
"type": "string",
"enum": [
"'text/plain; charset=\\\"UTF-8\\\"'",
" 'text/html; charset=\\\"UTF-8\\\"'"
],
"x-go-name": "ContentType"
},
"encryption-method-name": {
"description": "Encryption method name",
"type": "string",
"enum": [
"aes256cbc",
" nacl",
" noop"
],
"x-go-name": "EncryptionName"
},
"envelope": {
"description": "Envelope that should be used",
"type": "string",
"enum": [
"0x01",
" 0x50"
],
"x-go-name": "Envelope"
},
"message": {
"$ref": "#/definitions/PostMessagesResponseMessage"
}
},
"x-go-name": "PostRequestBody",
"x-go-package": "github.com/mailchain/mailchain/cmd/mailchain/internal/http/handlers"
}
},
"responses": {
"GetAddressesResponse": {
"description": "GetAddressesResponse Holds the response messages",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/GetAddressesItem"
}
}
},
"GetEnvelopeResponse": {
"description": "GetEnvelopeResponse envelope response",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/GetEnvelopeResponseBodyElement"
}
}
},
"GetMessagesResponse": {
"description": "GetResponse Holds the response messages",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/GetMessagesResponseMessage"
}