/
swagger.json
773 lines (773 loc) · 26.7 KB
/
swagger.json
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
{
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"swagger": "2.0",
"info": {
"description": "Auth service is an OAuth authentication server that is used to authenticate users.",
"title": "Auth API"
},
"paths": {
"/access": {
"put": {
"summary": "Rewrite user-namespace and user-volume accesses in DB for each user.",
"operationId": "UpdateUserAccesses",
"parameters": [
{
"name": "body",
"in": "body",
"schema": {
"$ref": "#/definitions/UpdateAccessRequest"
}
}
],
"responses": {
"200": {
"description": "accesses updated"
},
"default": {
"description": "cherry error",
"schema": {
"$ref": "#/definitions/errOAIGen"
}
}
},
"x-method-visibility": "private"
}
},
"/byid/access/{token_id}": {
"get": {
"summary": "Get access token by ID.",
"operationId": "GetAccessTokenByID",
"parameters": [
{
"enum": [
"user",
"admin"
],
"type": "string",
"name": "X-User-Role",
"in": "header",
"required": true
},
{
"type": "string",
"format": "uuid",
"name": "token_id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "access token",
"schema": {
"$ref": "#/definitions/AccessTokenByIDResponse"
}
},
"default": {
"description": "cherry error",
"schema": {
"$ref": "#/definitions/errOAIGen"
}
}
}
}
},
"/token": {
"get": {
"summary": "Get user tokens.",
"operationId": "GetUserTokens",
"parameters": [
{
"type": "string",
"format": "uuid",
"name": "X-User-ID",
"in": "header",
"required": true
}
],
"responses": {
"200": {
"description": "user tokens",
"schema": {
"$ref": "#/definitions/GetUserTokensResponse"
}
},
"default": {
"description": "cherry error",
"schema": {
"$ref": "#/definitions/errOAIGen"
}
}
},
"x-authorization-required": true,
"x-method-visibility": "public"
},
"post": {
"summary": "Creates token for user.",
"operationId": "CreateToken",
"parameters": [
{
"type": "string",
"name": "X-User-Agent",
"in": "header",
"required": true
},
{
"type": "string",
"name": "X-User-Client",
"in": "header",
"required": true
},
{
"type": "string",
"format": "uuid",
"name": "X-User-ID",
"in": "header",
"required": true
},
{
"enum": [
"user",
"admin"
],
"type": "string",
"name": "X-User-Role",
"in": "header",
"required": true
},
{
"type": "string",
"format": "ip",
"name": "X-Client-IP",
"in": "header",
"required": true
},
{
"name": "resources_accesses",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/createTokenParamsBody"
}
}
],
"responses": {
"200": {
"description": "access and refresh tokens created",
"schema": {
"$ref": "#/definitions/CreateTokenResponse"
}
},
"default": {
"description": "cherry error",
"schema": {
"$ref": "#/definitions/errOAIGen"
}
}
},
"x-method-visibility": "private"
}
},
"/token/{access_token}": {
"get": {
"summary": "Checks token and returns resources accesses.",
"operationId": "CheckToken",
"parameters": [
{
"type": "string",
"name": "X-User-Agent",
"in": "header",
"required": true
},
{
"type": "string",
"name": "X-User-Client",
"in": "header",
"required": true
},
{
"type": "string",
"format": "ip",
"name": "X-Client-IP",
"in": "header",
"required": true
},
{
"type": "string",
"name": "access_token",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "token valid",
"schema": {
"$ref": "#/definitions/checkTokenOKBody"
}
},
"default": {
"description": "cherry error",
"schema": {
"$ref": "#/definitions/errOAIGen"
}
}
},
"x-method-visibility": "private"
}
},
"/token/{refresh_token}": {
"put": {
"summary": "Get new access/refresh token pair using refresh token.",
"operationId": "ExtendToken",
"parameters": [
{
"type": "string",
"name": "X-User-Client",
"in": "header",
"required": true
},
{
"type": "string",
"description": "valid refresh token",
"name": "refresh_token",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "access and refresh tokens extended",
"schema": {
"$ref": "#/definitions/ExtendTokenResponse"
}
},
"default": {
"description": "cherry error",
"schema": {
"$ref": "#/definitions/errOAIGen"
}
}
},
"x-authorization-required": false,
"x-method-visibility": "public"
}
},
"/token/{token_id}": {
"delete": {
"summary": "Delete token (record) by id.",
"operationId": "DeleteTokenByID",
"parameters": [
{
"type": "string",
"format": "uuid",
"name": "X-User-ID",
"in": "header",
"required": true
},
{
"type": "string",
"format": "uuid",
"name": "token_id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "token deleted"
},
"default": {
"description": "cherry error",
"schema": {
"$ref": "#/definitions/errOAIGen"
}
}
},
"x-authorization-required": true,
"x-method-visibility": "public"
}
},
"/user/{user_id}/tokens": {
"delete": {
"summary": "Delete user (refresh) tokens. Also makes access tokens invalid.",
"operationId": "DeleteUserTokens",
"parameters": [
{
"type": "string",
"format": "uuid",
"name": "user_id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "tokens deleted"
},
"default": {
"description": "cherry error",
"schema": {
"$ref": "#/definitions/errOAIGen"
}
}
},
"x-method-visibility": "private"
}
}
},
"definitions": {
"AccessObject": {
"description": "AccessObject represents user access to resource",
"type": "object",
"properties": {
"access": {
"type": "string",
"x-go-name": "Access"
},
"id": {
"type": "string",
"format": "uuid",
"x-go-name": "Id"
},
"label": {
"type": "string",
"x-go-name": "Label"
}
},
"x-go-package": "git.containerum.net/ch/auth/proto"
},
"AccessTokenByIDResponse": {
"type": "object",
"title": "AccessTokenByIDResponse contains access token get by ID.",
"properties": {
"access_token": {
"type": "string",
"x-go-name": "AccessToken"
}
},
"x-go-package": "git.containerum.net/ch/auth/proto"
},
"AuthClient": {
"type": "object",
"x-go-package": "git.containerum.net/ch/auth/proto"
},
"AuthServer": {
"type": "object",
"x-go-package": "git.containerum.net/ch/auth/proto"
},
"CreateTokenResponse": {
"type": "object",
"title": "CreateTokenResponse contains access and refresh token.",
"properties": {
"access_token": {
"type": "string",
"x-go-name": "AccessToken"
},
"refresh_token": {
"type": "string",
"x-go-name": "RefreshToken"
}
},
"x-go-package": "git.containerum.net/ch/auth/proto"
},
"Duration": {
"description": "# Examples\n\nExample 1: Compute Duration from two Timestamps in pseudo code.\n\nTimestamp start = ...;\nTimestamp end = ...;\nDuration duration = ...;\n\nduration.seconds = end.seconds - start.seconds;\nduration.nanos = end.nanos - start.nanos;\n\nif (duration.seconds \u003c 0 \u0026\u0026 duration.nanos \u003e 0) {\nduration.seconds += 1;\nduration.nanos -= 1000000000;\n} else if (durations.seconds \u003e 0 \u0026\u0026 duration.nanos \u003c 0) {\nduration.seconds -= 1;\nduration.nanos += 1000000000;\n}\n\nExample 2: Compute Timestamp from Timestamp + Duration in pseudo code.\n\nTimestamp start = ...;\nDuration duration = ...;\nTimestamp end = ...;\n\nend.seconds = start.seconds + duration.seconds;\nend.nanos = start.nanos + duration.nanos;\n\nif (end.nanos \u003c 0) {\nend.seconds -= 1;\nend.nanos += 1000000000;\n} else if (end.nanos \u003e= 1000000000) {\nend.seconds += 1;\nend.nanos -= 1000000000;\n}\n\nExample 3: Compute Duration from datetime.timedelta in Python.\n\ntd = datetime.timedelta(days=3, minutes=10)\nduration = Duration()\nduration.FromTimedelta(td)\n\n# JSON Mapping\n\nIn JSON format, the Duration type is encoded as a string rather than an\nobject, where the string ends in the suffix \"s\" (indicating seconds) and\nis preceded by the number of seconds, with nanoseconds expressed as\nfractional seconds. For example, 3 seconds with 0 nanoseconds should be\nencoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should\nbe expressed in JSON format as \"3.000000001s\", and 3 seconds and 1\nmicrosecond should be expressed in JSON format as \"3.000001s\".",
"type": "object",
"title": "A Duration represents a signed, fixed-length span of time represented\nas a count of seconds and fractions of seconds at nanosecond\nresolution. It is independent of any calendar and concepts like \"day\"\nor \"month\". It is related to Timestamp in that the difference between\ntwo Timestamp values is a Duration and it can be added or subtracted\nfrom a Timestamp. Range is approximately +-10,000 years.",
"properties": {
"nanos": {
"description": "Signed fractions of a second at nanosecond resolution of the span\nof time. Durations less than one second are represented with a 0\n`seconds` field and a positive or negative `nanos` field. For durations\nof one second or more, a non-zero value for the `nanos` field must be\nof the same sign as the `seconds` field. Must be from -999,999,999\nto +999,999,999 inclusive.",
"type": "integer",
"format": "int32",
"x-go-name": "Nanos"
},
"seconds": {
"description": "Signed seconds of the span of time. Must be from -315,576,000,000\nto +315,576,000,000 inclusive. Note: these bounds are computed from:\n60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years",
"type": "integer",
"format": "int64",
"x-go-name": "Seconds"
}
},
"x-go-package": "git.containerum.net/ch/auth/vendor/github.com/golang/protobuf/ptypes/duration"
},
"Err": {
"description": "Err -- standard serializable API error\nMessage -- constant error message:\n+ \"invalid username\"\n+ \"quota exceeded\"\n+ \"validation error\"\n...etc...\nID -- unique error identification code\nDetails -- optional context error messages kinda\n+ \"field 'Replicas' must be non-zero value\"\n+ \"not enough tights to feed gopher\"\n+ \"resource 'God' does't exist\"\nFields -- optional set of key-value pairs",
"type": "object",
"properties": {
"details": {
"type": "array",
"items": {
"type": "string"
},
"x-go-name": "Details"
},
"fields": {
"$ref": "#/definitions/Fields"
},
"id": {
"$ref": "#/definitions/ErrID"
},
"message": {
"type": "string",
"x-go-name": "Message"
},
"status_http": {
"type": "integer",
"format": "int64",
"x-go-name": "StatusHTTP"
}
},
"x-go-package": "git.containerum.net/ch/auth/vendor/github.com/containerum/cherry"
},
"ErrID": {
"description": "ErrID -- represents unique error ID",
"type": "object",
"properties": {
"kind": {
"$ref": "#/definitions/ErrKind"
},
"sid": {
"$ref": "#/definitions/ErrSID"
}
},
"x-go-package": "git.containerum.net/ch/auth/vendor/github.com/containerum/cherry"
},
"ErrKind": {
"description": "ErrKind -- represents kind of error",
"type": "integer",
"format": "uint64",
"x-go-package": "git.containerum.net/ch/auth/vendor/github.com/containerum/cherry"
},
"ErrSID": {
"description": "ErrSID -- represents service ID of error",
"type": "string",
"x-go-package": "git.containerum.net/ch/auth/vendor/github.com/containerum/cherry"
},
"ExtendTokenResponse": {
"description": "ExtendTokenResponse contains new access and refresh tokens",
"type": "object",
"properties": {
"access_token": {
"type": "string",
"x-go-name": "AccessToken"
},
"refresh_token": {
"type": "string",
"x-go-name": "RefreshToken"
}
},
"x-go-package": "git.containerum.net/ch/auth/proto"
},
"Fields": {
"description": "Fields -- represents additional key-value fields of error",
"type": "object",
"additionalProperties": {
"type": "string"
},
"x-go-package": "git.containerum.net/ch/auth/vendor/github.com/containerum/cherry"
},
"GetUserTokensResponse": {
"description": "GetUserTokensResponse contains user tokens",
"type": "object",
"properties": {
"tokens": {
"type": "array",
"items": {
"$ref": "#/definitions/StoredTokenForUser"
},
"x-go-name": "Tokens"
}
},
"x-go-package": "git.containerum.net/ch/auth/proto"
},
"ResourcesAccess": {
"description": "ResourceAccesses contains user accesses to resources",
"type": "object",
"properties": {
"namespace": {
"type": "array",
"items": {
"$ref": "#/definitions/AccessObject"
},
"x-go-name": "Namespace"
},
"volume": {
"type": "array",
"items": {
"$ref": "#/definitions/AccessObject"
},
"x-go-name": "Volume"
}
},
"x-go-package": "git.containerum.net/ch/auth/proto"
},
"StoredToken": {
"description": "StoredToken is a representaion of token database record",
"type": "object",
"properties": {
"created_at": {
"$ref": "#/definitions/Timestamp"
},
"fingerprint": {
"type": "string",
"x-go-name": "Fingerprint"
},
"life_time": {
"$ref": "#/definitions/Duration"
},
"part_token_id": {
"type": "string",
"format": "uuid",
"x-go-name": "PartTokenId"
},
"platform": {
"type": "string",
"x-go-name": "Platform"
},
"raw_refresh_token": {
"type": "string",
"x-go-name": "RawRefreshToken"
},
"rw_access": {
"type": "boolean",
"x-go-name": "RwAccess"
},
"token_id": {
"type": "string",
"format": "uuid",
"x-go-name": "TokenId"
},
"user_agent": {
"type": "string",
"x-go-name": "UserAgent"
},
"user_id": {
"type": "string",
"format": "uuid",
"x-go-name": "UserId"
},
"user_ip": {
"type": "string",
"format": "ip",
"x-go-name": "UserIp"
},
"user_namespace": {
"type": "string",
"x-go-name": "UserNamespace"
},
"user_role": {
"type": "string",
"x-go-name": "UserRole"
},
"user_volume": {
"type": "string",
"x-go-name": "UserVolume"
}
},
"x-go-package": "git.containerum.net/ch/auth/proto"
},
"StoredTokenForUser": {
"description": "StoredTokenForUser is an information about token sent to user",
"type": "object",
"properties": {
"created_at": {
"type": "string",
"x-go-name": "CreatedAt"
},
"ip": {
"description": "@inject_tag: binding:\"ip\"",
"type": "string",
"format": "ip",
"x-go-name": "Ip"
},
"token_id": {
"description": "@inject_tag: binding:\"uuid\"",
"type": "string",
"format": "uuid",
"x-go-name": "TokenId"
},
"user_agent": {
"type": "string",
"x-go-name": "UserAgent"
}
},
"x-go-package": "git.containerum.net/ch/auth/proto"
},
"Timestamp": {
"description": "# Examples\n\nExample 1: Compute Timestamp from POSIX `time()`.\n\nTimestamp timestamp;\ntimestamp.set_seconds(time(NULL));\ntimestamp.set_nanos(0);\n\nExample 2: Compute Timestamp from POSIX `gettimeofday()`.\n\nstruct timeval tv;\ngettimeofday(\u0026tv, NULL);\n\nTimestamp timestamp;\ntimestamp.set_seconds(tv.tv_sec);\ntimestamp.set_nanos(tv.tv_usec * 1000);\n\nExample 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.\n\nFILETIME ft;\nGetSystemTimeAsFileTime(\u0026ft);\nUINT64 ticks = (((UINT64)ft.dwHighDateTime) \u003c\u003c 32) | ft.dwLowDateTime;\n\nA Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z\nis 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.\nTimestamp timestamp;\ntimestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));\ntimestamp.set_nanos((INT32) ((ticks % 10000000) * 100));\n\nExample 4: Compute Timestamp from Java `System.currentTimeMillis()`.\n\nlong millis = System.currentTimeMillis();\n\nTimestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)\n.setNanos((int) ((millis % 1000) * 1000000)).build();\n\n\nExample 5: Compute Timestamp from current time in Python.\n\ntimestamp = Timestamp()\ntimestamp.GetCurrentTime()\n\n# JSON Mapping\n\nIn JSON format, the Timestamp type is encoded as a string in the\n[RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the\nformat is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\"\nwhere {year} is always expressed using four digits while {month}, {day},\n{hour}, {min}, and {sec} are zero-padded to two digits each. The fractional\nseconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),\nare optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone\nis required, though only UTC (as indicated by \"Z\") is presently supported.\n\nFor example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past\n01:30 UTC on January 15, 2017.\n\nIn JavaScript, one can convert a Date object to this format using the\nstandard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString]\nmethod. In Python, a standard `datetime.datetime` object can be converted\nto this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime)\nwith the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one\ncan use the Joda Time's [`ISODateTimeFormat.dateTime()`](\nhttp://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime())\nto obtain a formatter capable of generating timestamps in this format.",
"type": "object",
"title": "A Timestamp represents a point in time independent of any time zone\nor calendar, represented as seconds and fractions of seconds at\nnanosecond resolution in UTC Epoch time. It is encoded using the\nProleptic Gregorian Calendar which extends the Gregorian calendar\nbackwards to year one. It is encoded assuming all minutes are 60\nseconds long, i.e. leap seconds are \"smeared\" so that no leap second\ntable is needed for interpretation. Range is from\n0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z.\nBy restricting to that range, we ensure that we can convert to\nand from RFC 3339 date strings.\nSee [https://www.ietf.org/rfc/rfc3339.txt](https://www.ietf.org/rfc/rfc3339.txt).",
"properties": {
"nanos": {
"description": "Non-negative fractions of a second at nanosecond resolution. Negative\nsecond values with fractions must still have non-negative nanos values\nthat count forward in time. Must be from 0 to 999,999,999\ninclusive.",
"type": "integer",
"format": "int32",
"x-go-name": "Nanos"
},
"seconds": {
"description": "Represents seconds of UTC time since Unix epoch\n1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to\n9999-12-31T23:59:59Z inclusive.",
"type": "integer",
"format": "int64",
"x-go-name": "Seconds"
}
},
"x-go-package": "git.containerum.net/ch/auth/vendor/github.com/golang/protobuf/ptypes/timestamp"
},
"UpdateAccessRequest": {
"type": "object",
"title": "UpdateAccessRequest describes request for updating user resources accesses.",
"properties": {
"users": {
"type": "array",
"items": {
"$ref": "#/definitions/UpdateAccessRequestElement"
},
"x-go-name": "Users"
}
},
"x-go-package": "git.containerum.net/ch/auth/proto"
},
"UpdateAccessRequestElement": {
"type": "object",
"title": "UpdateAccessRequestElement describes element for updating user resources accesses.",
"properties": {
"access": {
"$ref": "#/definitions/ResourcesAccess"
},
"user_id": {
"description": "@inject_tag: binding:\"uuid\"",
"type": "string",
"x-go-name": "UserId"
}
},
"x-go-package": "git.containerum.net/ch/auth/proto"
},
"authClient": {
"type": "object",
"x-go-package": "git.containerum.net/ch/auth/proto"
},
"checkTokenOKBody": {
"type": "object",
"properties": {
"access": {
"$ref": "#/definitions/ResourcesAccess"
}
},
"x-go-gen-location": "operations"
},
"createTokenParamsBody": {
"type": "object",
"properties": {
"access": {
"$ref": "#/definitions/ResourcesAccess"
}
},
"x-go-gen-location": "operations"
},
"errOAIGen": {
"description": "Err -- standard serializable API error\nMessage -- constant error message:\n+ \"invalid username\"\n+ \"quota exceeded\"\n+ \"validation error\"\n...etc...\nID -- unique error identification code\nDetails -- optional context error messages kinda\n+ \"field 'Replicas' must be non-zero value\"\n+ \"not enough tights to feed gopher\"\n+ \"resource 'God' does't exist\"\nFields -- optional set of key-value pairs",
"type": "object",
"properties": {
"details": {
"type": "array",
"items": {
"type": "string"
},
"x-go-name": "Details"
},
"fields": {
"description": "Fields -- represents additional key-value fields of error",
"type": "object",
"additionalProperties": {
"type": "string"
},
"x-go-package": "github.com/containerum/cherry"
},
"id": {
"$ref": "#/definitions/errOaiGenId"
},
"message": {
"type": "string",
"x-go-name": "Message"
},
"status_http": {
"type": "integer",
"format": "int64",
"x-go-name": "StatusHTTP"
}
},
"x-go-package": "github.com/containerum/cherry"
},
"errOaiGenId": {
"description": "ErrID -- represents unique error ID",
"type": "object",
"properties": {
"kind": {
"description": "ErrKind -- represents kind of error",
"type": "integer",
"format": "uint64",
"x-go-package": "github.com/containerum/cherry"
},
"sid": {
"description": "ErrSID -- represents service ID of error",
"type": "string",
"x-go-package": "github.com/containerum/cherry"
}
},
"x-go-gen-location": "models",
"x-go-package": "github.com/containerum/cherry"
}
},
"parameters": {
"ClientIPHeader": {
"type": "string",
"format": "ip",
"name": "X-Client-IP",
"in": "header",
"required": true
},
"FingerprintHeader": {
"type": "string",
"name": "X-User-Client",
"in": "header",
"required": true
},
"UserAgentHeader": {
"type": "string",
"name": "X-User-Agent",
"in": "header",
"required": true
},
"UserIDHeader": {
"type": "string",
"format": "uuid",
"name": "X-User-ID",
"in": "header",
"required": true
},
"UserRoleHeader": {
"enum": [
"user",
"admin"
],
"type": "string",
"name": "X-User-Role",
"in": "header",
"required": true
}
},
"responses": {
"error": {
"description": "cherry error",
"schema": {
"$ref": "#/definitions/errOAIGen"
}
}
}
}