implement login with SUDIR auth code

This commit is contained in:
Мержанов Максим Владимирович committed 2021-07-06 11:15:57 +00:00
1 parent 6bac52cdea
commit dfc78ddc71
12 files changed
+381 -38

No files matched your search

+79 -9
View File
@@ -1,12 +1,8 @@
// GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
// This file was generated by swaggo/swag at
// 2021-02-10 16:44:23.355615962 +0300 MSK m=+107.224783060
// Package docs GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
// This file was generated by swaggo/swag
package docs
import (
"github.com/integration-system/isp-lib/v2/docs"
)
import "github.com/integration-system/isp-lib/v2/docs"
var doc = `{
"schemes": {{ marshal .Schemes }},
@@ -35,7 +31,7 @@ var doc = `{
"tags": [
"auth"
],
"summary": "Авторизация",
"summary": "Авторизация по логину и паролю",
"parameters": [
{
"description": "Тело запроса",
@@ -55,6 +51,12 @@ var doc = `{
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/structure.GrpcError"
}
},
"401": {
"description": "Данные для авторизации не верны",
"schema": {
"$ref": "#/definitions/structure.GrpcError"
@@ -75,6 +77,58 @@ var doc = `{
}
}
},
"/auth/login_with_sudir": {
"post": {
"description": "Авторизация с получением токена администратора",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"auth"
],
"summary": "Авторизация по авторизационному коду от СУДИР",
"parameters": [
{
"description": "Тело запроса",
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/structure.SudirAuthRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/structure.Auth"
}
},
"401": {
"description": "Некорректный код для авторизации",
"schema": {
"$ref": "#/definitions/structure.GrpcError"
}
},
"412": {
"description": "Авторизация СУДИР не настроена на сервере",
"schema": {
"$ref": "#/definitions/structure.GrpcError"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/structure.GrpcError"
}
}
}
}
},
"/auth/logout": {
"post": {
"description": "Выход из авторизованной сессии администрирования",
@@ -98,7 +152,9 @@ var doc = `{
}
],
"responses": {
"200": {},
"200": {
"description": ""
},
"400": {
"description": "Невалидный токен",
"schema": {
@@ -410,6 +466,9 @@ var doc = `{
"phone": {
"type": "string"
},
"sudirUserId": {
"type": "string"
},
"updatedAt": {
"type": "string"
}
@@ -503,6 +562,17 @@ var doc = `{
}
}
},
"structure.SudirAuthRequest": {
"type": "object",
"required": [
"authCode"
],
"properties": {
"authCode": {
"type": "string"
}
}
},
"structure.UsersRequest": {
"type": "object",
"properties": {