@hubex/mcp 0.9.20260922 → 0.9.20260925

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,83 +1,158 @@
1
1
  {
2
2
  "openapi": "3.0.1",
3
3
  "info": {
4
- "title": "Authenticatin and authorization API for HubEx",
5
- "description": "Performs all of the operations, necessary to authenticate and authorize a user as a valid tenant member. Offers an API for registering, verifying e-mail, changing password, etc.",
4
+ "title": "API авторизации HubEx",
5
+ "description": "Выполняет авторизацию учётной записи в тенанте, выпуск и обновление JWT, управление refresh- и service-токенами.",
6
6
  "contact": {
7
7
  "name": "SmartService Backend Team",
8
8
  "email": "fmbackend@melston.ru"
9
9
  },
10
10
  "version": "v1.0.0.0"
11
11
  },
12
+ "servers": [
13
+ {
14
+ "url": "/AUTHZ"
15
+ }
16
+ ],
12
17
  "paths": {
13
18
  "/AccessTokens": {
14
19
  "post": {
15
20
  "tags": [
16
21
  "AccessTokens"
17
22
  ],
18
- "summary": "Обновляет токен доступа к ресурсам",
19
- "description": "<br />* Выполнение данного метода резрешино от **анонимного пользователя**.",
23
+ "summary": "Обновляет access-токен по refresh-токену, одноразовому токену или сервисному токену.",
24
+ "description": "Поддерживает три способа аутентификации (достаточно одного):\r\n- `refreshJwt` — JWT refresh-токен;\r\n- `oneTimeLoginToken` + `tenantID` — одноразовый токен входа;\r\n- `serviceToken` — сервисный токен.\r\n \r\nПри заголовке `X-Use-Cookie: true` refresh-токен читается из cookie `RefreshTokenCookie`; в теле достаточно пустого JSON-объекта `{}` (поле `refreshJwt` необязательно). Отсутствие тела запроса не поддерживается.\r\n \r\nОпциональный заголовок `X-Application-ID` проверяет доступ к указанному приложению.\r\n \r\n## Пример запроса (refresh-токен):\r\n```json\r\n{\r\n \"refreshJwt\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...\",\r\n \"accessJwt\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...\"\r\n}\r\n```\r\n \r\n## Пример запроса (X-Use-Cookie):\r\n```json\r\n{}\r\n```\r\n \r\n## Пример успешного ответа (200):\r\n```json\r\n{\r\n \"access_token\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...\",\r\n \"expires_in\": 3600,\r\n \"jwtValidTill\": \"2024-06-15T10:00:00Z\",\r\n \"profile\": { \"userID\": 42, \"firstName\": \"Иван\", \"lastName\": \"Иванов\" },\r\n \"permissions\": {},\r\n \"tenant\": { \"id\": 10, \"name\": \"Demo\", \"fullName\": \"Demo Tenant LLC\", \"uriName\": \"demo\" },\r\n \"tenantMember\": { \"id\": 1001, \"userID\": 42, \"accountID\": 100 }\r\n}\r\n```\r\n \r\n## Негативные сценарии:\r\n- 401 Unauthorized — не удалось определить члена тенанта по переданным данным.\r\n- 400 Bad Request — отсутствует тело при работе без cookie, некорректный или просроченный токен.\r\n- 403 Forbidden — нет доступа к указанному приложению (заголовок `X-Application-ID`).",
25
+ "parameters": [
26
+ {
27
+ "name": "X-Application-ID",
28
+ "in": "header",
29
+ "description": "Идентификатор приложения. EngineerMobile - 1, CustomerMobile - 2, MainWeb - 3, AdminWeb - 4, Api - 5, PlateWeb - 6",
30
+ "schema": {
31
+ "enum": [
32
+ 1,
33
+ 2,
34
+ 3,
35
+ 4,
36
+ 5,
37
+ 6
38
+ ],
39
+ "type": "integer",
40
+ "format": "int32",
41
+ "default": 3,
42
+ "x-enumNames": [
43
+ "EngineerMobile",
44
+ "CustomerMobile",
45
+ "MainWeb",
46
+ "AdminWeb",
47
+ "Api",
48
+ "PlateWeb"
49
+ ]
50
+ }
51
+ }
52
+ ],
20
53
  "requestBody": {
54
+ "description": "Данные для обновления access-токена.",
21
55
  "content": {
22
56
  "application/json-patch+json": {
23
57
  "schema": {
24
- "$ref": "#/components/schemas/HubEx.Service.AUTHZ.Api.Data.AccessToken.RefreshData"
58
+ "$ref": "#/components/schemas/RefreshData"
25
59
  }
26
60
  },
27
61
  "application/json": {
28
62
  "schema": {
29
- "$ref": "#/components/schemas/HubEx.Service.AUTHZ.Api.Data.AccessToken.RefreshData"
63
+ "$ref": "#/components/schemas/RefreshData"
30
64
  }
31
65
  },
32
66
  "text/json": {
33
67
  "schema": {
34
- "$ref": "#/components/schemas/HubEx.Service.AUTHZ.Api.Data.AccessToken.RefreshData"
68
+ "$ref": "#/components/schemas/RefreshData"
35
69
  }
36
70
  },
37
71
  "application/*+json": {
38
72
  "schema": {
39
- "$ref": "#/components/schemas/HubEx.Service.AUTHZ.Api.Data.AccessToken.RefreshData"
73
+ "$ref": "#/components/schemas/RefreshData"
40
74
  }
41
75
  }
42
76
  }
43
77
  },
44
78
  "responses": {
45
79
  "200": {
46
- "description": "OK",
80
+ "description": "Access-токен успешно обновлён.",
47
81
  "content": {
48
82
  "text/plain": {
49
83
  "schema": {
50
- "$ref": "#/components/schemas/HubEx.Service.AUTHZ.Api.Results.Base.JwtResultBase"
84
+ "$ref": "#/components/schemas/TenantMemberAuthorizationResult"
51
85
  }
52
86
  },
53
87
  "application/json": {
54
88
  "schema": {
55
- "$ref": "#/components/schemas/HubEx.Service.AUTHZ.Api.Results.Base.JwtResultBase"
89
+ "$ref": "#/components/schemas/TenantMemberAuthorizationResult"
56
90
  }
57
91
  },
58
92
  "text/json": {
59
93
  "schema": {
60
- "$ref": "#/components/schemas/HubEx.Service.AUTHZ.Api.Results.Base.JwtResultBase"
94
+ "$ref": "#/components/schemas/TenantMemberAuthorizationResult"
61
95
  }
62
96
  }
63
97
  }
64
98
  },
65
- "201": {
66
- "description": "Created",
99
+ "400": {
100
+ "description": "Некорректные данные или токен.",
101
+ "content": {
102
+ "text/plain": {
103
+ "schema": {
104
+ "type": "array",
105
+ "items": {
106
+ "$ref": "#/components/schemas/ErrorModel"
107
+ }
108
+ }
109
+ },
110
+ "application/json": {
111
+ "schema": {
112
+ "type": "array",
113
+ "items": {
114
+ "$ref": "#/components/schemas/ErrorModel"
115
+ }
116
+ }
117
+ },
118
+ "text/json": {
119
+ "schema": {
120
+ "type": "array",
121
+ "items": {
122
+ "$ref": "#/components/schemas/ErrorModel"
123
+ }
124
+ }
125
+ }
126
+ }
127
+ },
128
+ "401": {
129
+ "description": "Член тенанта не найден."
130
+ },
131
+ "403": {
132
+ "description": "Нет доступа к приложению.",
67
133
  "content": {
68
134
  "text/plain": {
69
135
  "schema": {
70
- "$ref": "#/components/schemas/HubEx.Service.AUTHZ.Api.Results.Base.JwtResultBase"
136
+ "type": "array",
137
+ "items": {
138
+ "$ref": "#/components/schemas/ErrorModel"
139
+ }
71
140
  }
72
141
  },
73
142
  "application/json": {
74
143
  "schema": {
75
- "$ref": "#/components/schemas/HubEx.Service.AUTHZ.Api.Results.Base.JwtResultBase"
144
+ "type": "array",
145
+ "items": {
146
+ "$ref": "#/components/schemas/ErrorModel"
147
+ }
76
148
  }
77
149
  },
78
150
  "text/json": {
79
151
  "schema": {
80
- "$ref": "#/components/schemas/HubEx.Service.AUTHZ.Api.Results.Base.JwtResultBase"
152
+ "type": "array",
153
+ "items": {
154
+ "$ref": "#/components/schemas/ErrorModel"
155
+ }
81
156
  }
82
157
  }
83
158
  }
@@ -90,71 +165,123 @@
90
165
  "tags": [
91
166
  "Accounts"
92
167
  ],
93
- "summary": "Авторизация учетной записи в тенанте",
94
- "description": "<br />* Для выполнения данного метода пользователь должен быть **Authenticated**.",
168
+ "summary": "Авторизует учётную запись в указанном тенанте.",
169
+ "description": "Тело запроса целиком можно опустить — тогда `tenantID` и `tenantMemberID` берутся из JWT текущего пользователя.\r\nЕсли тело передано, оба поля (`tenantID`, `tenantMemberID`) обязательны и должны быть больше 0.\r\n \r\n## Пример запроса:\r\n```json\r\n{\r\n \"tenantID\": 10,\r\n \"tenantMemberID\": 1001\r\n}\r\n```\r\n \r\n## Пример успешного ответа (200):\r\n```json\r\n{\r\n \"access_token\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...\",\r\n \"expires_in\": 3600,\r\n \"jwtValidTill\": \"2024-06-15T10:00:00Z\",\r\n \"profile\": {\r\n \"userID\": 42,\r\n \"firstName\": \"Иван\",\r\n \"lastName\": \"Иванов\"\r\n },\r\n \"permissions\": { \"TaskView\": \"Allow\" },\r\n \"tenantLicenses\": [],\r\n \"featureFlags\": [],\r\n \"roleTaskAttribute\": []\r\n}\r\n```\r\n \r\n## Негативные сценарии:\r\n- 401 Unauthorized — отсутствует или некорректен Bearer-токен.\r\n- 403 Forbidden — JWT не содержит признака аутентифицированной учётной записи (`Authenticated`).\r\n- 400 Bad Request — передано неполное или некорректное тело (например `{}` или только одно из полей).",
95
170
  "parameters": [
96
171
  {
97
- "name": "Authorization",
172
+ "name": "X-Application-ID",
98
173
  "in": "header",
99
- "description": "Bearer",
100
- "required": true,
174
+ "description": "Идентификатор приложения. EngineerMobile - 1, CustomerMobile - 2, MainWeb - 3, AdminWeb - 4, Api - 5, PlateWeb - 6",
101
175
  "schema": {
102
- "type": "string"
176
+ "enum": [
177
+ 1,
178
+ 2,
179
+ 3,
180
+ 4,
181
+ 5,
182
+ 6
183
+ ],
184
+ "type": "integer",
185
+ "format": "int32",
186
+ "default": 3,
187
+ "x-enumNames": [
188
+ "EngineerMobile",
189
+ "CustomerMobile",
190
+ "MainWeb",
191
+ "AdminWeb",
192
+ "Api",
193
+ "PlateWeb"
194
+ ]
103
195
  }
104
196
  }
105
197
  ],
106
198
  "requestBody": {
199
+ "description": "Данные для авторизации в тенанте. Не передавайте тело, чтобы использовать значения из JWT.",
107
200
  "content": {
108
201
  "application/json-patch+json": {
109
202
  "schema": {
110
- "$ref": "#/components/schemas/HubEx.Service.AUTHZ.Api.Data.Account.AuthorizeData"
203
+ "$ref": "#/components/schemas/AuthorizeData"
111
204
  }
112
205
  },
113
206
  "application/json": {
114
207
  "schema": {
115
- "$ref": "#/components/schemas/HubEx.Service.AUTHZ.Api.Data.Account.AuthorizeData"
208
+ "$ref": "#/components/schemas/AuthorizeData"
116
209
  }
117
210
  },
118
211
  "text/json": {
119
212
  "schema": {
120
- "$ref": "#/components/schemas/HubEx.Service.AUTHZ.Api.Data.Account.AuthorizeData"
213
+ "$ref": "#/components/schemas/AuthorizeData"
121
214
  }
122
215
  },
123
216
  "application/*+json": {
124
217
  "schema": {
125
- "$ref": "#/components/schemas/HubEx.Service.AUTHZ.Api.Data.Account.AuthorizeData"
218
+ "$ref": "#/components/schemas/AuthorizeData"
126
219
  }
127
220
  }
128
221
  }
129
222
  },
130
223
  "responses": {
131
224
  "200": {
132
- "description": "OK",
225
+ "description": "Авторизация в тенанте выполнена успешно.",
133
226
  "content": {
134
227
  "text/plain": {
135
228
  "schema": {
136
- "$ref": "#/components/schemas/HubEx.Service.AUTHZ.Api.Results.Accounts.TenantMemberAuthorizationResult"
229
+ "$ref": "#/components/schemas/TenantMemberAuthorizationResult"
137
230
  }
138
231
  },
139
232
  "application/json": {
140
233
  "schema": {
141
- "$ref": "#/components/schemas/HubEx.Service.AUTHZ.Api.Results.Accounts.TenantMemberAuthorizationResult"
234
+ "$ref": "#/components/schemas/TenantMemberAuthorizationResult"
142
235
  }
143
236
  },
144
237
  "text/json": {
145
238
  "schema": {
146
- "$ref": "#/components/schemas/HubEx.Service.AUTHZ.Api.Results.Accounts.TenantMemberAuthorizationResult"
239
+ "$ref": "#/components/schemas/TenantMemberAuthorizationResult"
240
+ }
241
+ }
242
+ }
243
+ },
244
+ "400": {
245
+ "description": "Некорректные данные запроса.",
246
+ "content": {
247
+ "text/plain": {
248
+ "schema": {
249
+ "type": "array",
250
+ "items": {
251
+ "$ref": "#/components/schemas/ErrorModel"
252
+ }
253
+ }
254
+ },
255
+ "application/json": {
256
+ "schema": {
257
+ "type": "array",
258
+ "items": {
259
+ "$ref": "#/components/schemas/ErrorModel"
260
+ }
261
+ }
262
+ },
263
+ "text/json": {
264
+ "schema": {
265
+ "type": "array",
266
+ "items": {
267
+ "$ref": "#/components/schemas/ErrorModel"
268
+ }
147
269
  }
148
270
  }
149
271
  }
150
272
  },
151
273
  "401": {
152
- "description": "Unauthorized"
274
+ "description": "Токен отсутствует или некорректен."
153
275
  },
154
276
  "403": {
155
- "description": "Forbidden"
277
+ "description": "JWT не содержит признака аутентифицированной учётной записи (`Authenticated`)."
156
278
  }
157
- }
279
+ },
280
+ "security": [
281
+ {
282
+ "Bearer": [ ]
283
+ }
284
+ ]
158
285
  }
159
286
  },
160
287
  "/RefreshTokens": {
@@ -162,137 +289,243 @@
162
289
  "tags": [
163
290
  "RefreshTokens"
164
291
  ],
165
- "summary": "Генерирует обновляющий токен и возвращает его",
166
- "description": "<br />* Для выполнения данного метода пользователь должен быть **TenantMember**.",
292
+ "summary": "Генерирует refresh-токен для текущего члена тенанта.",
293
+ "description": "При заголовке `X-Use-Cookie: true` refresh-токен записывается в HttpOnly-cookie, тело ответа пустое.\r\n \r\n## Пример запроса:\r\n```json\r\n{\r\n \"validity\": \"30.00:00:00\"\r\n}\r\n```\r\n \r\n## Пример успешного ответа (200/201):\r\n```json\r\n{\r\n \"access_token\": \"\",\r\n \"refresh_token\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...\",\r\n \"expires_in\": 2592000,\r\n \"jwtValidTill\": \"2024-07-15T10:00:00Z\"\r\n}\r\n```\r\n \r\n## Пример успешного ответа при X-Use-Cookie (200/201):\r\nТело ответа пустое, refresh-токен в cookie `RefreshTokenCookie`.\r\n \r\n## Негативные сценарии:\r\n- 401 Unauthorized — отсутствует или некорректен Bearer-токен.\r\n- 403 Forbidden — JWT не содержит авторизации в тенанте (`TenantMember`).\r\n- 400 Bad Request — некорректные параметры или ошибка настройки CORS при использовании cookie.",
167
294
  "parameters": [
168
295
  {
169
- "name": "Authorization",
296
+ "name": "X-Application-ID",
170
297
  "in": "header",
171
- "description": "Bearer",
172
- "required": true,
298
+ "description": "Идентификатор приложения. EngineerMobile - 1, CustomerMobile - 2, MainWeb - 3, AdminWeb - 4, Api - 5, PlateWeb - 6",
173
299
  "schema": {
174
- "type": "string"
300
+ "enum": [
301
+ 1,
302
+ 2,
303
+ 3,
304
+ 4,
305
+ 5,
306
+ 6
307
+ ],
308
+ "type": "integer",
309
+ "format": "int32",
310
+ "default": 3,
311
+ "x-enumNames": [
312
+ "EngineerMobile",
313
+ "CustomerMobile",
314
+ "MainWeb",
315
+ "AdminWeb",
316
+ "Api",
317
+ "PlateWeb"
318
+ ]
175
319
  }
176
320
  }
177
321
  ],
178
322
  "requestBody": {
323
+ "description": "Параметры генерации (опционально).",
179
324
  "content": {
180
325
  "application/json-patch+json": {
181
326
  "schema": {
182
- "$ref": "#/components/schemas/HubEx.Service.AUTHZ.Api.Data.RefreshTokens.GenerateData"
327
+ "$ref": "#/components/schemas/GenerateData"
183
328
  }
184
329
  },
185
330
  "application/json": {
186
331
  "schema": {
187
- "$ref": "#/components/schemas/HubEx.Service.AUTHZ.Api.Data.RefreshTokens.GenerateData"
332
+ "$ref": "#/components/schemas/GenerateData"
188
333
  }
189
334
  },
190
335
  "text/json": {
191
336
  "schema": {
192
- "$ref": "#/components/schemas/HubEx.Service.AUTHZ.Api.Data.RefreshTokens.GenerateData"
337
+ "$ref": "#/components/schemas/GenerateData"
193
338
  }
194
339
  },
195
340
  "application/*+json": {
196
341
  "schema": {
197
- "$ref": "#/components/schemas/HubEx.Service.AUTHZ.Api.Data.RefreshTokens.GenerateData"
342
+ "$ref": "#/components/schemas/GenerateData"
198
343
  }
199
344
  }
200
345
  }
201
346
  },
202
347
  "responses": {
203
348
  "200": {
204
- "description": "OK",
349
+ "description": "Refresh-токен успешно получен (существующий).",
205
350
  "content": {
206
351
  "text/plain": {
207
352
  "schema": {
208
- "$ref": "#/components/schemas/HubEx.Service.AUTHZ.Api.Results.Base.JwtResultBase"
353
+ "$ref": "#/components/schemas/JwtResultBase"
209
354
  }
210
355
  },
211
356
  "application/json": {
212
357
  "schema": {
213
- "$ref": "#/components/schemas/HubEx.Service.AUTHZ.Api.Results.Base.JwtResultBase"
358
+ "$ref": "#/components/schemas/JwtResultBase"
214
359
  }
215
360
  },
216
361
  "text/json": {
217
362
  "schema": {
218
- "$ref": "#/components/schemas/HubEx.Service.AUTHZ.Api.Results.Base.JwtResultBase"
363
+ "$ref": "#/components/schemas/JwtResultBase"
219
364
  }
220
365
  }
221
366
  }
222
367
  },
223
368
  "201": {
224
- "description": "Created",
369
+ "description": "Refresh-токен успешно создан.",
370
+ "content": {
371
+ "text/plain": {
372
+ "schema": {
373
+ "$ref": "#/components/schemas/JwtResultBase"
374
+ }
375
+ },
376
+ "application/json": {
377
+ "schema": {
378
+ "$ref": "#/components/schemas/JwtResultBase"
379
+ }
380
+ },
381
+ "text/json": {
382
+ "schema": {
383
+ "$ref": "#/components/schemas/JwtResultBase"
384
+ }
385
+ }
386
+ }
387
+ },
388
+ "400": {
389
+ "description": "Некорректные данные запроса.",
225
390
  "content": {
226
391
  "text/plain": {
227
392
  "schema": {
228
- "$ref": "#/components/schemas/HubEx.Service.AUTHZ.Api.Results.Base.JwtResultBase"
393
+ "type": "array",
394
+ "items": {
395
+ "$ref": "#/components/schemas/ErrorModel"
396
+ }
229
397
  }
230
398
  },
231
399
  "application/json": {
232
400
  "schema": {
233
- "$ref": "#/components/schemas/HubEx.Service.AUTHZ.Api.Results.Base.JwtResultBase"
401
+ "type": "array",
402
+ "items": {
403
+ "$ref": "#/components/schemas/ErrorModel"
404
+ }
234
405
  }
235
406
  },
236
407
  "text/json": {
237
408
  "schema": {
238
- "$ref": "#/components/schemas/HubEx.Service.AUTHZ.Api.Results.Base.JwtResultBase"
409
+ "type": "array",
410
+ "items": {
411
+ "$ref": "#/components/schemas/ErrorModel"
412
+ }
239
413
  }
240
414
  }
241
415
  }
242
416
  },
243
417
  "401": {
244
- "description": "Unauthorized"
418
+ "description": "Токен отсутствует или некорректен."
245
419
  },
246
420
  "403": {
247
- "description": "Forbidden"
421
+ "description": "JWT не содержит авторизации в тенанте (`TenantMember`)."
248
422
  }
249
- }
423
+ },
424
+ "security": [
425
+ {
426
+ "Bearer": [ ]
427
+ }
428
+ ]
250
429
  },
251
430
  "get": {
252
431
  "tags": [
253
432
  "RefreshTokens"
254
433
  ],
255
434
  "summary": "Возвращает refresh-токен с параметрами по умолчанию.",
256
- "description": "<br />* Для выполнения данного метода пользователь должен быть **TenantMember**.",
435
+ "description": "При заголовке `X-Use-Cookie: true` refresh-токен записывается в HttpOnly-cookie, тело ответа пустое.\r\n \r\n## Пример успешного ответа (200):\r\n```json\r\n{\r\n \"access_token\": \"\",\r\n \"refresh_token\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...\",\r\n \"expires_in\": 2592000,\r\n \"jwtValidTill\": \"2024-07-15T10:00:00Z\"\r\n}\r\n```\r\n \r\n## Пример успешного ответа (204):\r\nRefresh-токен не найден.\r\n \r\n## Пример успешного ответа при X-Use-Cookie (200):\r\nТело ответа пустое, refresh-токен в cookie `RefreshTokenCookie`.\r\n \r\n## Негативные сценарии:\r\n- 401 Unauthorized — отсутствует или некорректен Bearer-токен.\r\n- 403 Forbidden — JWT не содержит авторизации в тенанте (`TenantMember`).\r\n- 400 Bad Request — ошибка настройки CORS при использовании cookie.",
257
436
  "parameters": [
258
437
  {
259
- "name": "Authorization",
438
+ "name": "X-Application-ID",
260
439
  "in": "header",
261
- "description": "Bearer",
262
- "required": true,
440
+ "description": "Идентификатор приложения. EngineerMobile - 1, CustomerMobile - 2, MainWeb - 3, AdminWeb - 4, Api - 5, PlateWeb - 6",
263
441
  "schema": {
264
- "type": "string"
442
+ "enum": [
443
+ 1,
444
+ 2,
445
+ 3,
446
+ 4,
447
+ 5,
448
+ 6
449
+ ],
450
+ "type": "integer",
451
+ "format": "int32",
452
+ "default": 3,
453
+ "x-enumNames": [
454
+ "EngineerMobile",
455
+ "CustomerMobile",
456
+ "MainWeb",
457
+ "AdminWeb",
458
+ "Api",
459
+ "PlateWeb"
460
+ ]
265
461
  }
266
462
  }
267
463
  ],
268
464
  "responses": {
269
465
  "200": {
270
- "description": "OK",
466
+ "description": "Refresh-токен успешно получен.",
271
467
  "content": {
272
468
  "text/plain": {
273
469
  "schema": {
274
- "$ref": "#/components/schemas/HubEx.Service.AUTHZ.Api.Results.Base.JwtResultBase"
470
+ "$ref": "#/components/schemas/JwtResultBase"
275
471
  }
276
472
  },
277
473
  "application/json": {
278
474
  "schema": {
279
- "$ref": "#/components/schemas/HubEx.Service.AUTHZ.Api.Results.Base.JwtResultBase"
475
+ "$ref": "#/components/schemas/JwtResultBase"
280
476
  }
281
477
  },
282
478
  "text/json": {
283
479
  "schema": {
284
- "$ref": "#/components/schemas/HubEx.Service.AUTHZ.Api.Results.Base.JwtResultBase"
480
+ "$ref": "#/components/schemas/JwtResultBase"
481
+ }
482
+ }
483
+ }
484
+ },
485
+ "204": {
486
+ "description": "Refresh-токен не найден."
487
+ },
488
+ "400": {
489
+ "description": "Некорректные параметры запроса.",
490
+ "content": {
491
+ "text/plain": {
492
+ "schema": {
493
+ "type": "array",
494
+ "items": {
495
+ "$ref": "#/components/schemas/ErrorModel"
496
+ }
497
+ }
498
+ },
499
+ "application/json": {
500
+ "schema": {
501
+ "type": "array",
502
+ "items": {
503
+ "$ref": "#/components/schemas/ErrorModel"
504
+ }
505
+ }
506
+ },
507
+ "text/json": {
508
+ "schema": {
509
+ "type": "array",
510
+ "items": {
511
+ "$ref": "#/components/schemas/ErrorModel"
512
+ }
285
513
  }
286
514
  }
287
515
  }
288
516
  },
289
517
  "401": {
290
- "description": "Unauthorized"
518
+ "description": "Токен отсутствует или некорректен."
291
519
  },
292
520
  "403": {
293
- "description": "Forbidden"
521
+ "description": "JWT не содержит авторизации в тенанте (`TenantMember`)."
294
522
  }
295
- }
523
+ },
524
+ "security": [
525
+ {
526
+ "Bearer": [ ]
527
+ }
528
+ ]
296
529
  }
297
530
  },
298
531
  "/ServiceTokens": {
@@ -300,20 +533,38 @@
300
533
  "tags": [
301
534
  "ServiceTokens"
302
535
  ],
303
- "summary": "Генерирует новый токен доступа и возвращает его",
304
- "description": "<br />* Для выполнения данного метода требуется любое из перечисленных полномочий: **ServiceTokenAdd**",
536
+ "summary": "Генерирует сервисные токены для указанных членов тенанта.",
537
+ "description": "## Пример запроса:\r\n```json\r\n[1001, 1002]\r\n```\r\n \r\n## Пример успешного ответа (201):\r\n```json\r\n[\r\n {\r\n \"token\": \"svc_abc123def456\",\r\n \"created\": \"2024-06-15T09:00:00Z\",\r\n \"validTill\": \"2025-06-15T09:00:00Z\"\r\n }\r\n]\r\n```\r\n \r\n## Пример успешного ответа (204):\r\nТело ответа пустое — новые токены не были созданы.\r\n \r\n## Негативные сценарии:\r\n- 401 Unauthorized — отсутствует или некорректен Bearer-токен.\r\n- 403 Forbidden — недостаточно прав (`ServiceTokenAdd`).",
305
538
  "parameters": [
306
539
  {
307
- "name": "Authorization",
540
+ "name": "X-Application-ID",
308
541
  "in": "header",
309
- "description": "Bearer",
310
- "required": true,
542
+ "description": "Идентификатор приложения. EngineerMobile - 1, CustomerMobile - 2, MainWeb - 3, AdminWeb - 4, Api - 5, PlateWeb - 6",
311
543
  "schema": {
312
- "type": "string"
544
+ "enum": [
545
+ 1,
546
+ 2,
547
+ 3,
548
+ 4,
549
+ 5,
550
+ 6
551
+ ],
552
+ "type": "integer",
553
+ "format": "int32",
554
+ "default": 3,
555
+ "x-enumNames": [
556
+ "EngineerMobile",
557
+ "CustomerMobile",
558
+ "MainWeb",
559
+ "AdminWeb",
560
+ "Api",
561
+ "PlateWeb"
562
+ ]
313
563
  }
314
564
  }
315
565
  ],
316
566
  "requestBody": {
567
+ "description": "Список идентификаторов членов тенанта.",
317
568
  "content": {
318
569
  "application/json-patch+json": {
319
570
  "schema": {
@@ -355,51 +606,112 @@
355
606
  },
356
607
  "responses": {
357
608
  "201": {
358
- "description": "Created",
609
+ "description": "Токены успешно созданы.",
359
610
  "content": {
360
611
  "text/plain": {
361
612
  "schema": {
362
- "$ref": "#/components/schemas/HubEx.Service.AUTHZ.Api.Results.ServiceTokens.PostResult"
613
+ "type": "array",
614
+ "items": {
615
+ "$ref": "#/components/schemas/PostResult"
616
+ }
363
617
  }
364
618
  },
365
619
  "application/json": {
366
620
  "schema": {
367
- "$ref": "#/components/schemas/HubEx.Service.AUTHZ.Api.Results.ServiceTokens.PostResult"
621
+ "type": "array",
622
+ "items": {
623
+ "$ref": "#/components/schemas/PostResult"
624
+ }
368
625
  }
369
626
  },
370
627
  "text/json": {
371
628
  "schema": {
372
- "$ref": "#/components/schemas/HubEx.Service.AUTHZ.Api.Results.ServiceTokens.PostResult"
629
+ "type": "array",
630
+ "items": {
631
+ "$ref": "#/components/schemas/PostResult"
632
+ }
373
633
  }
374
634
  }
375
635
  }
376
636
  },
637
+ "204": {
638
+ "description": "Новые токены не созданы."
639
+ },
377
640
  "401": {
378
- "description": "Unauthorized"
641
+ "description": "Токен отсутствует или некорректен."
379
642
  },
380
643
  "403": {
381
- "description": "Forbidden"
644
+ "description": "Недостаточно прав `ServiceTokenAdd`.",
645
+ "content": {
646
+ "text/plain": {
647
+ "schema": {
648
+ "type": "array",
649
+ "items": {
650
+ "$ref": "#/components/schemas/ErrorModel"
651
+ }
652
+ }
653
+ },
654
+ "application/json": {
655
+ "schema": {
656
+ "type": "array",
657
+ "items": {
658
+ "$ref": "#/components/schemas/ErrorModel"
659
+ }
660
+ }
661
+ },
662
+ "text/json": {
663
+ "schema": {
664
+ "type": "array",
665
+ "items": {
666
+ "$ref": "#/components/schemas/ErrorModel"
667
+ }
668
+ }
669
+ }
670
+ }
382
671
  }
383
- }
672
+ },
673
+ "security": [
674
+ {
675
+ "Bearer": [ ]
676
+ }
677
+ ]
384
678
  },
385
679
  "delete": {
386
680
  "tags": [
387
681
  "ServiceTokens"
388
682
  ],
389
- "summary": "Удаляет токен доступа",
390
- "description": "<br />* Для выполнения данного метода требуется любое из перечисленных полномочий: **ServiceTokenRemove**",
683
+ "summary": "Удаляет сервисные токены указанных членов тенанта.",
684
+ "description": "## Пример запроса:\r\n```json\r\n[1001, 1002]\r\n```\r\n \r\n## Пример успешного ответа (202):\r\nТело ответа пустое.\r\n \r\n## Негативные сценарии:\r\n- 401 Unauthorized — отсутствует или некорректен Bearer-токен.\r\n- 403 Forbidden — недостаточно прав (`ServiceTokenRemove`).",
391
685
  "parameters": [
392
686
  {
393
- "name": "Authorization",
687
+ "name": "X-Application-ID",
394
688
  "in": "header",
395
- "description": "Bearer",
396
- "required": true,
689
+ "description": "Идентификатор приложения. EngineerMobile - 1, CustomerMobile - 2, MainWeb - 3, AdminWeb - 4, Api - 5, PlateWeb - 6",
397
690
  "schema": {
398
- "type": "string"
691
+ "enum": [
692
+ 1,
693
+ 2,
694
+ 3,
695
+ 4,
696
+ 5,
697
+ 6
698
+ ],
699
+ "type": "integer",
700
+ "format": "int32",
701
+ "default": 3,
702
+ "x-enumNames": [
703
+ "EngineerMobile",
704
+ "CustomerMobile",
705
+ "MainWeb",
706
+ "AdminWeb",
707
+ "Api",
708
+ "PlateWeb"
709
+ ]
399
710
  }
400
711
  }
401
712
  ],
402
713
  "requestBody": {
714
+ "description": "Список идентификаторов членов тенанта.",
403
715
  "content": {
404
716
  "application/json-patch+json": {
405
717
  "schema": {
@@ -441,15 +753,46 @@
441
753
  },
442
754
  "responses": {
443
755
  "202": {
444
- "description": "Accepted"
756
+ "description": "Токены успешно удалены."
445
757
  },
446
758
  "401": {
447
- "description": "Unauthorized"
759
+ "description": "Токен отсутствует или некорректен."
448
760
  },
449
761
  "403": {
450
- "description": "Forbidden"
762
+ "description": "Недостаточно прав `ServiceTokenRemove`.",
763
+ "content": {
764
+ "text/plain": {
765
+ "schema": {
766
+ "type": "array",
767
+ "items": {
768
+ "$ref": "#/components/schemas/ErrorModel"
769
+ }
770
+ }
771
+ },
772
+ "application/json": {
773
+ "schema": {
774
+ "type": "array",
775
+ "items": {
776
+ "$ref": "#/components/schemas/ErrorModel"
777
+ }
778
+ }
779
+ },
780
+ "text/json": {
781
+ "schema": {
782
+ "type": "array",
783
+ "items": {
784
+ "$ref": "#/components/schemas/ErrorModel"
785
+ }
786
+ }
787
+ }
788
+ }
451
789
  }
452
- }
790
+ },
791
+ "security": [
792
+ {
793
+ "Bearer": [ ]
794
+ }
795
+ ]
453
796
  }
454
797
  },
455
798
  "/Tokens/renew": {
@@ -457,185 +800,371 @@
457
800
  "tags": [
458
801
  "Tokens"
459
802
  ],
460
- "summary": "Обновление JWT",
461
- "description": "<br />* Для выполнения данного метода пользователь должен быть **TenantMember**.",
803
+ "summary": "Продлевает срок действия текущего JWT access-токена.",
804
+ "description": "Токен извлекается из сохранённого Bearer-токена текущего запроса.\r\n \r\n## Пример успешного ответа (200):\r\n```json\r\n{\r\n \"access_token\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...\",\r\n \"expires_in\": 3600,\r\n \"jwtValidTill\": \"2024-06-15T10:00:00Z\"\r\n}\r\n```\r\n \r\n## Негативные сценарии:\r\n- 401 Unauthorized — отсутствует или некорректен Bearer-токен.\r\n- 403 Forbidden — JWT не содержит авторизации в тенанте (`TenantMember`).\r\n- 400 Bad Request — access-токен не найден в контексте аутентификации.",
462
805
  "parameters": [
463
806
  {
464
- "name": "Authorization",
807
+ "name": "X-Application-ID",
465
808
  "in": "header",
466
- "description": "Bearer",
467
- "required": true,
809
+ "description": "Идентификатор приложения. EngineerMobile - 1, CustomerMobile - 2, MainWeb - 3, AdminWeb - 4, Api - 5, PlateWeb - 6",
468
810
  "schema": {
469
- "type": "string"
811
+ "enum": [
812
+ 1,
813
+ 2,
814
+ 3,
815
+ 4,
816
+ 5,
817
+ 6
818
+ ],
819
+ "type": "integer",
820
+ "format": "int32",
821
+ "default": 3,
822
+ "x-enumNames": [
823
+ "EngineerMobile",
824
+ "CustomerMobile",
825
+ "MainWeb",
826
+ "AdminWeb",
827
+ "Api",
828
+ "PlateWeb"
829
+ ]
470
830
  }
471
831
  }
472
832
  ],
473
833
  "responses": {
474
834
  "200": {
475
- "description": "OK",
835
+ "description": "Токен успешно обновлён.",
476
836
  "content": {
477
837
  "text/plain": {
478
838
  "schema": {
479
- "$ref": "#/components/schemas/HubEx.Service.AUTHZ.Api.Results.Base.JwtResultBase"
839
+ "$ref": "#/components/schemas/JwtResultBase"
480
840
  }
481
841
  },
482
842
  "application/json": {
483
843
  "schema": {
484
- "$ref": "#/components/schemas/HubEx.Service.AUTHZ.Api.Results.Base.JwtResultBase"
844
+ "$ref": "#/components/schemas/JwtResultBase"
485
845
  }
486
846
  },
487
847
  "text/json": {
488
848
  "schema": {
489
- "$ref": "#/components/schemas/HubEx.Service.AUTHZ.Api.Results.Base.JwtResultBase"
849
+ "$ref": "#/components/schemas/JwtResultBase"
850
+ }
851
+ }
852
+ }
853
+ },
854
+ "400": {
855
+ "description": "Access-токен отсутствует.",
856
+ "content": {
857
+ "text/plain": {
858
+ "schema": {
859
+ "type": "array",
860
+ "items": {
861
+ "$ref": "#/components/schemas/ErrorModel"
862
+ }
863
+ }
864
+ },
865
+ "application/json": {
866
+ "schema": {
867
+ "type": "array",
868
+ "items": {
869
+ "$ref": "#/components/schemas/ErrorModel"
870
+ }
871
+ }
872
+ },
873
+ "text/json": {
874
+ "schema": {
875
+ "type": "array",
876
+ "items": {
877
+ "$ref": "#/components/schemas/ErrorModel"
878
+ }
490
879
  }
491
880
  }
492
881
  }
493
882
  },
494
883
  "401": {
495
- "description": "Unauthorized"
884
+ "description": "Токен отсутствует или некорректен."
496
885
  },
497
886
  "403": {
498
- "description": "Forbidden"
887
+ "description": "JWT не содержит авторизации в тенанте (`TenantMember`)."
499
888
  }
500
- }
889
+ },
890
+ "security": [
891
+ {
892
+ "Bearer": [ ]
893
+ }
894
+ ]
501
895
  }
502
896
  }
503
897
  },
504
898
  "components": {
505
899
  "schemas": {
506
- "HubEx.Service.AUTHZ.Api.Data.AccessToken.RefreshData": {
900
+ "AuthorizeData": {
901
+ "required": [
902
+ "tenantID",
903
+ "tenantMemberID"
904
+ ],
507
905
  "type": "object",
508
906
  "properties": {
509
- "jwt": {
510
- "type": "string",
511
- "description": "JWT refresh-токен",
512
- "nullable": true,
513
- "deprecated": true
907
+ "tenantID": {
908
+ "type": "integer",
909
+ "description": "ИД тенанта, в который будет авторизован пользователь.",
910
+ "format": "int32",
911
+ "example": 10
514
912
  },
515
- "refreshJwt": {
913
+ "tenantMemberID": {
914
+ "type": "integer",
915
+ "description": "ИД члена тенанта, в который этот член будет авторизован.",
916
+ "format": "int32",
917
+ "example": 1001
918
+ }
919
+ },
920
+ "additionalProperties": false,
921
+ "description": "Данные для авторизации в тенанте. Если тело запроса передаётся, оба поля обязательны."
922
+ },
923
+ "ErrorModel": {
924
+ "type": "object",
925
+ "properties": {
926
+ "traceIdentifier": {
516
927
  "type": "string",
517
- "description": "JWT refresh-токен",
518
928
  "nullable": true
519
929
  },
520
- "accessJwt": {
930
+ "code": {
521
931
  "type": "string",
522
- "description": "JWT access-токен (опциональный, необходим для определения включены ли в access-токен какие-либо расщирения, если включены новый токен будет сгенерирован с учетогм их)",
523
932
  "nullable": true
524
933
  },
525
- "oneTimeLoginToken": {
934
+ "message": {
526
935
  "type": "string",
527
- "description": "Токен для одноразовой авторизации в тенанте",
528
936
  "nullable": true
529
937
  },
530
- "tenantID": {
938
+ "arguments": {
939
+ "type": "object",
940
+ "additionalProperties": {
941
+ "type": "string",
942
+ "nullable": true
943
+ },
944
+ "nullable": true
945
+ }
946
+ },
947
+ "additionalProperties": false
948
+ },
949
+ "GenerateData": {
950
+ "type": "object",
951
+ "properties": {
952
+ "validity": {
953
+ "type": "string",
954
+ "description": "Срок действия токена",
955
+ "format": "date-span",
956
+ "nullable": true,
957
+ "example": "30.00:00:00"
958
+ }
959
+ },
960
+ "additionalProperties": false,
961
+ "description": "Параметры генерации токена"
962
+ },
963
+ "IdCodeNameResultOfShort": {
964
+ "type": "object",
965
+ "properties": {
966
+ "id": {
531
967
  "type": "integer",
532
- "description": "Идентификатор тенанта, в который будет произведен вход по HubEx.Service.AUTHZ.Api.Data.AccessToken.RefreshData.OneTimeLoginToken",
533
- "format": "int32",
968
+ "format": "int32"
969
+ },
970
+ "code": {
971
+ "type": "string",
534
972
  "nullable": true
535
973
  },
536
- "serviceToken": {
974
+ "name": {
537
975
  "type": "string",
538
- "description": "Сервисный токен для упрощенной авторизации",
539
976
  "nullable": true
540
977
  }
541
978
  },
542
- "additionalProperties": false,
543
- "description": "Класс, принимающий JWT для обновления JWT доступа к ресурсам."
979
+ "additionalProperties": false
544
980
  },
545
- "HubEx.Service.AUTHZ.Api.Data.Account.AuthorizeData": {
546
- "required": [
547
- "tenantID",
548
- "tenantMemberID"
549
- ],
981
+ "IdNameResultOfByte": {
550
982
  "type": "object",
551
983
  "properties": {
552
- "tenantID": {
984
+ "id": {
553
985
  "type": "integer",
554
- "description": "ИД тенанта, в который будет авторизован пользователь.",
555
986
  "format": "int32"
556
987
  },
557
- "tenantMemberID": {
988
+ "name": {
989
+ "type": "string",
990
+ "nullable": true
991
+ }
992
+ },
993
+ "additionalProperties": false
994
+ },
995
+ "JwtResultBase": {
996
+ "type": "object",
997
+ "properties": {
998
+ "access_token": {
999
+ "type": "string",
1000
+ "description": "JWT-токен для доступа к ресурсам",
1001
+ "nullable": true,
1002
+ "readOnly": true,
1003
+ "example": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
1004
+ },
1005
+ "refresh_token": {
1006
+ "type": "string",
1007
+ "description": "JWT-токен для обновления JWT-токена для доступа к ресурсам",
1008
+ "nullable": true,
1009
+ "readOnly": true,
1010
+ "example": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
1011
+ },
1012
+ "expires_in": {
558
1013
  "type": "integer",
559
- "description": "ИД члена тенанта, в который этот член будет авторизован.",
560
- "format": "int32"
1014
+ "description": "Количество секунд, через которой токен будет просрочен",
1015
+ "format": "int32",
1016
+ "nullable": true,
1017
+ "readOnly": true,
1018
+ "example": 3600
1019
+ },
1020
+ "jwtValidTill": {
1021
+ "type": "string",
1022
+ "description": "Метка времени в UTC, до которой действует JWT",
1023
+ "format": "date-time",
1024
+ "nullable": true,
1025
+ "example": "2024-06-15T10:00:00Z"
561
1026
  }
562
1027
  },
563
1028
  "additionalProperties": false,
564
- "description": "Данные для авторизации"
1029
+ "description": "Данные JWT"
565
1030
  },
566
- "HubEx.Service.AUTHZ.Api.Data.RefreshTokens.GenerateData": {
1031
+ "PostResult": {
567
1032
  "type": "object",
568
1033
  "properties": {
569
- "validity": {
1034
+ "token": {
1035
+ "type": "string",
1036
+ "description": "Токен",
1037
+ "nullable": true,
1038
+ "example": "svc_abc123def456"
1039
+ },
1040
+ "created": {
1041
+ "type": "string",
1042
+ "description": "Метка времени создания токена",
1043
+ "format": "date-time",
1044
+ "example": "2024-06-15T09:00:00Z"
1045
+ },
1046
+ "validTill": {
570
1047
  "type": "string",
571
1048
  "description": "Срок действия токена",
572
- "format": "date-span",
573
- "nullable": true
1049
+ "format": "date-time",
1050
+ "example": "2025-06-15T09:00:00Z"
574
1051
  }
575
1052
  },
576
1053
  "additionalProperties": false,
577
- "description": "Параметры генерации токена"
1054
+ "description": "Результат генерации сервисного токена"
1055
+ },
1056
+ "RefreshData": {
1057
+ "type": "object",
1058
+ "properties": {
1059
+ "jwt": {
1060
+ "type": "string",
1061
+ "description": "JWT refresh-токен",
1062
+ "nullable": true,
1063
+ "deprecated": true
1064
+ },
1065
+ "refreshJwt": {
1066
+ "type": "string",
1067
+ "description": "JWT refresh-токен",
1068
+ "nullable": true,
1069
+ "example": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
1070
+ },
1071
+ "accessJwt": {
1072
+ "type": "string",
1073
+ "description": "JWT access-токен (опциональный, необходим для определения включены ли в access-токен какие-либо расщирения, если включены новый токен будет сгенерирован с учетогм их)",
1074
+ "nullable": true,
1075
+ "example": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
1076
+ },
1077
+ "oneTimeLoginToken": {
1078
+ "type": "string",
1079
+ "description": "Токен для одноразовой авторизации в тенанте",
1080
+ "nullable": true,
1081
+ "example": "one-time-token-value"
1082
+ },
1083
+ "tenantID": {
1084
+ "type": "integer",
1085
+ "description": "Идентификатор тенанта, в который будет произведен вход по HubEx.Service.AUTHZ.Api.Data.AccessToken.RefreshData.OneTimeLoginToken",
1086
+ "format": "int32",
1087
+ "nullable": true,
1088
+ "example": 10
1089
+ },
1090
+ "serviceToken": {
1091
+ "type": "string",
1092
+ "description": "Сервисный токен для упрощенной авторизации",
1093
+ "nullable": true,
1094
+ "example": "svc_abc123def456"
1095
+ }
1096
+ },
1097
+ "additionalProperties": false,
1098
+ "description": "Класс, принимающий JWT для обновления JWT доступа к ресурсам."
578
1099
  },
579
- "HubEx.Service.AUTHZ.Api.Results.Accounts.TenantLicenseCurrentResult": {
1100
+ "TenantLicenseCurrentResult": {
580
1101
  "type": "object",
581
1102
  "properties": {
582
1103
  "license": {
583
- "$ref": "#/components/schemas/SmartService.Common.Results.IdCodeNameResult`1[[System.Int16, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]"
1104
+ "$ref": "#/components/schemas/IdCodeNameResultOfShort"
584
1105
  },
585
1106
  "dateTill": {
586
1107
  "type": "string",
587
1108
  "description": "Дата окончания лицензии",
588
- "format": "date-time"
1109
+ "format": "date-time",
1110
+ "example": "2025-12-31T23:59:59Z"
589
1111
  },
590
1112
  "isTrialPeriod": {
591
1113
  "type": "boolean",
592
- "description": "Флаг пробного периода"
1114
+ "description": "Флаг пробного периода",
1115
+ "example": false
593
1116
  },
594
1117
  "dateFrom": {
595
1118
  "type": "string",
596
1119
  "description": "Дата начала лицензии",
597
- "format": "date-time"
1120
+ "format": "date-time",
1121
+ "example": "2024-01-01T00:00:00Z"
598
1122
  },
599
1123
  "trialPeriodDays": {
600
1124
  "type": "integer",
601
1125
  "description": "Длина пробного периода в днях",
602
1126
  "format": "int32",
603
- "nullable": true
1127
+ "nullable": true,
1128
+ "example": 14
604
1129
  }
605
1130
  },
606
1131
  "additionalProperties": false,
607
1132
  "description": "Данные текущей лицензии тенанта"
608
1133
  },
609
- "HubEx.Service.AUTHZ.Api.Results.Accounts.TenantMemberAuthorizationResult": {
1134
+ "TenantMemberAuthorizationResult": {
610
1135
  "type": "object",
611
1136
  "properties": {
612
1137
  "access_token": {
613
1138
  "type": "string",
614
1139
  "description": "JWT-токен для доступа к ресурсам",
615
1140
  "nullable": true,
616
- "readOnly": true
1141
+ "readOnly": true,
1142
+ "example": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
617
1143
  },
618
1144
  "refresh_token": {
619
1145
  "type": "string",
620
1146
  "description": "JWT-токен для обновления JWT-токена для доступа к ресурсам",
621
1147
  "nullable": true,
622
- "readOnly": true
1148
+ "readOnly": true,
1149
+ "example": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
623
1150
  },
624
1151
  "expires_in": {
625
1152
  "type": "integer",
626
1153
  "description": "Количество секунд, через которой токен будет просрочен",
627
1154
  "format": "int32",
628
1155
  "nullable": true,
629
- "readOnly": true
1156
+ "readOnly": true,
1157
+ "example": 3600
630
1158
  },
631
1159
  "jwtValidTill": {
632
1160
  "type": "string",
633
1161
  "description": "Метка времени в UTC, до которой действует JWT",
634
1162
  "format": "date-time",
635
- "nullable": true
1163
+ "nullable": true,
1164
+ "example": "2024-06-15T10:00:00Z"
636
1165
  },
637
1166
  "profile": {
638
- "$ref": "#/components/schemas/HubEx.Service.AUTHZ.Api.Results.Accounts.UserProfileResult"
1167
+ "$ref": "#/components/schemas/UserProfileResult"
639
1168
  },
640
1169
  "permissions": {
641
1170
  "type": "object",
@@ -647,18 +1176,18 @@
647
1176
  "nullable": true
648
1177
  },
649
1178
  "refreshToken": {
650
- "$ref": "#/components/schemas/HubEx.Service.AUTHZ.Api.Results.Base.JwtResultBase"
1179
+ "$ref": "#/components/schemas/JwtResultBase"
651
1180
  },
652
1181
  "tenant": {
653
- "$ref": "#/components/schemas/HubEx.Service.AUTHZ.Api.Results.Accounts.TenantResult"
1182
+ "$ref": "#/components/schemas/TenantResult"
654
1183
  },
655
1184
  "tenantMember": {
656
- "$ref": "#/components/schemas/HubEx.Service.AUTHZ.Api.Results.Accounts.TenantMemberResult"
1185
+ "$ref": "#/components/schemas/TenantMemberResult"
657
1186
  },
658
1187
  "tenantLicenses": {
659
1188
  "type": "array",
660
1189
  "items": {
661
- "$ref": "#/components/schemas/HubEx.Service.AUTHZ.Api.Results.Accounts.TenantLicenseCurrentResult"
1190
+ "$ref": "#/components/schemas/TenantLicenseCurrentResult"
662
1191
  },
663
1192
  "description": "Данные лицензий тенанта",
664
1193
  "nullable": true
@@ -684,74 +1213,88 @@
684
1213
  "additionalProperties": false,
685
1214
  "description": "Авторизация члена тенанта"
686
1215
  },
687
- "HubEx.Service.AUTHZ.Api.Results.Accounts.TenantMemberResult": {
1216
+ "TenantMemberResult": {
688
1217
  "type": "object",
689
1218
  "properties": {
690
1219
  "id": {
691
1220
  "type": "integer",
692
- "format": "int32"
1221
+ "description": "Идентификатор члена тенанта",
1222
+ "format": "int32",
1223
+ "example": 1001
693
1224
  },
694
1225
  "description": {
695
1226
  "type": "string",
696
1227
  "description": "Описание",
697
- "nullable": true
1228
+ "nullable": true,
1229
+ "example": "Инженер участка"
698
1230
  },
699
1231
  "userID": {
700
1232
  "type": "integer",
701
1233
  "description": "Идентификатор пользователя",
702
- "format": "int32"
1234
+ "format": "int32",
1235
+ "example": 42
703
1236
  },
704
1237
  "accountID": {
705
1238
  "type": "integer",
706
1239
  "description": "Идентификатор учетной записи",
707
- "format": "int32"
1240
+ "format": "int32",
1241
+ "example": 100
708
1242
  }
709
1243
  },
710
1244
  "additionalProperties": false,
711
1245
  "description": "Данные члена тенанта"
712
1246
  },
713
- "HubEx.Service.AUTHZ.Api.Results.Accounts.TenantResult": {
1247
+ "TenantResult": {
714
1248
  "type": "object",
715
1249
  "properties": {
716
1250
  "id": {
717
1251
  "type": "integer",
718
- "format": "int32"
1252
+ "description": "Идентификатор тенанта",
1253
+ "format": "int32",
1254
+ "example": 10
719
1255
  },
720
1256
  "name": {
721
1257
  "type": "string",
722
- "nullable": true
1258
+ "description": "Краткое название тенанта",
1259
+ "nullable": true,
1260
+ "example": "Demo"
723
1261
  },
724
1262
  "fullName": {
725
1263
  "type": "string",
726
1264
  "description": "Полное название тенанта",
727
- "nullable": true
1265
+ "nullable": true,
1266
+ "example": "Demo Tenant LLC"
728
1267
  },
729
1268
  "uriName": {
730
1269
  "type": "string",
731
1270
  "description": "Uri-постфикс",
732
- "nullable": true
1271
+ "nullable": true,
1272
+ "example": "demo"
733
1273
  }
734
1274
  },
735
1275
  "additionalProperties": false,
736
1276
  "description": "Данные тенанта"
737
1277
  },
738
- "HubEx.Service.AUTHZ.Api.Results.Accounts.UserProfileResult": {
1278
+ "UserProfileResult": {
739
1279
  "type": "object",
740
1280
  "properties": {
741
1281
  "userID": {
742
1282
  "type": "integer",
743
1283
  "description": "Идентификатор пользователя",
744
- "format": "int32"
1284
+ "format": "int32",
1285
+ "example": 42
745
1286
  },
746
1287
  "firstName": {
747
1288
  "type": "string",
748
1289
  "description": "Имя",
749
- "nullable": true
1290
+ "nullable": true,
1291
+ "example": "Иван"
750
1292
  },
751
1293
  "lastName": {
752
1294
  "type": "string",
753
1295
  "description": "Фамилия",
754
- "nullable": true
1296
+ "nullable": true,
1297
+ "example": "Иванов"
755
1298
  },
756
1299
  "middleName": {
757
1300
  "type": "string",
@@ -761,7 +1304,8 @@
761
1304
  "email": {
762
1305
  "type": "string",
763
1306
  "description": "Адрес эл.почты",
764
- "nullable": true
1307
+ "nullable": true,
1308
+ "example": "ivan.ivanov@example.com"
765
1309
  },
766
1310
  "mobilePhone": {
767
1311
  "type": "string",
@@ -784,7 +1328,7 @@
784
1328
  "nullable": true
785
1329
  },
786
1330
  "geoTrackingMode": {
787
- "$ref": "#/components/schemas/SmartService.Common.Results.IdNameResult`1[[System.Byte, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]"
1331
+ "$ref": "#/components/schemas/IdNameResultOfByte"
788
1332
  },
789
1333
  "accountDomainLogin": {
790
1334
  "type": "string",
@@ -804,93 +1348,57 @@
804
1348
  },
805
1349
  "additionalProperties": false,
806
1350
  "description": "Профиль пользователя"
807
- },
808
- "HubEx.Service.AUTHZ.Api.Results.Base.JwtResultBase": {
809
- "type": "object",
810
- "properties": {
811
- "access_token": {
812
- "type": "string",
813
- "description": "JWT-токен для доступа к ресурсам",
814
- "nullable": true,
815
- "readOnly": true
816
- },
817
- "refresh_token": {
818
- "type": "string",
819
- "description": "JWT-токен для обновления JWT-токена для доступа к ресурсам",
820
- "nullable": true,
821
- "readOnly": true
822
- },
823
- "expires_in": {
824
- "type": "integer",
825
- "description": "Количество секунд, через которой токен будет просрочен",
826
- "format": "int32",
827
- "nullable": true,
828
- "readOnly": true
829
- },
830
- "jwtValidTill": {
831
- "type": "string",
832
- "description": "Метка времени в UTC, до которой действует JWT",
833
- "format": "date-time",
834
- "nullable": true
835
- }
836
- },
837
- "additionalProperties": false,
838
- "description": "Данные JWT"
839
- },
840
- "HubEx.Service.AUTHZ.Api.Results.ServiceTokens.PostResult": {
841
- "type": "object",
842
- "properties": {
843
- "token": {
844
- "type": "string",
845
- "description": "Токен",
846
- "nullable": true
847
- },
848
- "created": {
849
- "type": "string",
850
- "description": "Метка времени создания токена",
851
- "format": "date-time"
852
- },
853
- "validTill": {
854
- "type": "string",
855
- "description": "Срок действия токена",
856
- "format": "date-time"
857
- }
858
- },
859
- "additionalProperties": false,
860
- "description": "Результат генерации сервисного токена"
861
- },
862
- "SmartService.Common.Results.IdCodeNameResult`1[[System.Int16, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]": {
863
- "type": "object",
864
- "properties": {
865
- "id": {
866
- "type": "integer",
867
- "format": "int32"
868
- },
869
- "code": {
870
- "type": "string",
871
- "nullable": true
872
- },
873
- "name": {
874
- "type": "string",
875
- "nullable": true
876
- }
877
- },
878
- "additionalProperties": false
879
- },
880
- "SmartService.Common.Results.IdNameResult`1[[System.Byte, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]": {
881
- "type": "object",
882
- "properties": {
883
- "id": {
884
- "type": "integer",
885
- "format": "int32"
886
- },
887
- "name": {
888
- "type": "string",
889
- "nullable": true
890
- }
891
- },
892
- "additionalProperties": false
893
1351
  }
1352
+ },
1353
+ "securitySchemes": {
1354
+ "Bearer": {
1355
+ "type": "http",
1356
+ "description": "Введите токен для авторизации",
1357
+ "scheme": "Bearer",
1358
+ "bearerFormat": "JWT"
1359
+ }
1360
+ }
1361
+ },
1362
+ "tags": [
1363
+ {
1364
+ "name": "AccessTokens",
1365
+ "description": "Контроллер для управления токенами доступа"
1366
+ },
1367
+ {
1368
+ "name": "Accounts",
1369
+ "description": "Контроллер для аутентификации и авторизации учетных записей"
1370
+ },
1371
+ {
1372
+ "name": "RefreshTokens",
1373
+ "description": "Контроллер для управления токенами обновления токена доступа"
1374
+ },
1375
+ {
1376
+ "name": "ServiceTokens",
1377
+ "description": "Контроллер для управления сервисными токенами"
1378
+ },
1379
+ {
1380
+ "name": "Tokens",
1381
+ "description": "Контроллер для работы с JWT"
1382
+ },
1383
+ {
1384
+ "name": "AccessTokens",
1385
+ "description": "Контроллер для управления токенами доступа"
1386
+ },
1387
+ {
1388
+ "name": "Accounts",
1389
+ "description": "Контроллер для аутентификации и авторизации учетных записей"
1390
+ },
1391
+ {
1392
+ "name": "RefreshTokens",
1393
+ "description": "Контроллер для управления токенами обновления токена доступа"
1394
+ },
1395
+ {
1396
+ "name": "ServiceTokens",
1397
+ "description": "Контроллер для управления сервисными токенами"
1398
+ },
1399
+ {
1400
+ "name": "Tokens",
1401
+ "description": "Контроллер для работы с JWT"
894
1402
  }
895
- }
1403
+ ]
896
1404
  }