implement login with SUDIR auth code
This commit is contained in:
1 parent
6bac52cdea
commit
dfc78ddc71
12 files changed
+381
-38
No files matched your search
+79
-9
@@ -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": {
|
||||
|
||||
+50
-2
@@ -25,6 +25,8 @@ definitions:
|
||||
type: string
|
||||
phone:
|
||||
type: string
|
||||
sudirUserId:
|
||||
type: string
|
||||
updatedAt:
|
||||
type: string
|
||||
required:
|
||||
@@ -87,6 +89,13 @@ definitions:
|
||||
type: integer
|
||||
type: array
|
||||
type: object
|
||||
structure.SudirAuthRequest:
|
||||
properties:
|
||||
authCode:
|
||||
type: string
|
||||
required:
|
||||
- authCode
|
||||
type: object
|
||||
structure.UsersRequest:
|
||||
properties:
|
||||
email:
|
||||
@@ -138,6 +147,10 @@ paths:
|
||||
schema:
|
||||
$ref: '#/definitions/structure.Auth'
|
||||
"400":
|
||||
description: Bad Request
|
||||
schema:
|
||||
$ref: '#/definitions/structure.GrpcError'
|
||||
"401":
|
||||
description: Данные для авторизации не верны
|
||||
schema:
|
||||
$ref: '#/definitions/structure.GrpcError'
|
||||
@@ -149,7 +162,41 @@ paths:
|
||||
description: Internal Server Error
|
||||
schema:
|
||||
$ref: '#/definitions/structure.GrpcError'
|
||||
summary: Авторизация
|
||||
summary: Авторизация по логину и паролю
|
||||
tags:
|
||||
- auth
|
||||
/auth/login_with_sudir:
|
||||
post:
|
||||
consumes:
|
||||
- application/json
|
||||
description: Авторизация с получением токена администратора
|
||||
parameters:
|
||||
- description: Тело запроса
|
||||
in: body
|
||||
name: body
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/structure.SudirAuthRequest'
|
||||
produces:
|
||||
- application/json
|
||||
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'
|
||||
summary: Авторизация по авторизационному коду от СУДИР
|
||||
tags:
|
||||
- auth
|
||||
/auth/logout:
|
||||
@@ -166,7 +213,8 @@ paths:
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200": {}
|
||||
"200":
|
||||
description: ""
|
||||
"400":
|
||||
description: Невалидный токен
|
||||
schema:
|
||||
|
||||
Reference in new issue
Block a user