// Code generated by go-swagger; DO NOT EDIT. package server // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command import ( "encoding/json" ) var ( // SwaggerJSON embedded version of the swagger document used at generation time SwaggerJSON json.RawMessage // FlatSwaggerJSON embedded flattened version of the swagger document used at generation time FlatSwaggerJSON json.RawMessage ) func init() { SwaggerJSON = json.RawMessage([]byte(`{ "schemes": [ "https" ], "swagger": "2.0", "info": { "description": "DualInventive's common authentication API", "title": "Authentication API", "termsOfService": "http://swagger.io/terms/", "contact": { "name": "bartekbeza@dualinventive.com" }, "license": { "name": "Apache 2.0", "url": "http://www.apache.org/licenses/LICENSE-2.0.html" }, "version": "1.0.1" }, "host": "api.mtinfo3000.com", "basePath": "/auth/v1", "paths": { "/login": { "post": { "description": "Authenticate user and retrieve security token", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Authentication" ], "parameters": [ { "x-exportParamName": "Body", "description": "User's credentials", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/Credentials" } } ], "responses": { "200": { "description": "successful operation", "schema": { "$ref": "#/definitions/SecurityToken" } }, "401": { "description": "Authentication failed", "schema": { "$ref": "#/definitions/ErrResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/ErrResponse" } } } } }, "/logout": { "post": { "security": [ { "TokenAuth": [] } ], "description": "Logout user and remove security token", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Authentication" ], "operationId": "logout", "responses": { "204": { "description": "Logout successful" }, "401": { "description": "Authentication failed", "schema": { "$ref": "#/definitions/ErrResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/ErrResponse" } } } } }, "/me": { "get": { "security": [ { "TokenAuth": [] } ], "description": "Request user information based on a given token", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Authentication" ], "responses": { "200": { "description": "Success", "schema": { "$ref": "#/definitions/User" } }, "401": { "description": "Authentication failed", "schema": { "$ref": "#/definitions/ErrResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/ErrResponse" } } } } }, "/password-reset/redeem": { "post": { "description": "Redeem user-bound reset code, changes the users password", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Authentication" ], "parameters": [ { "x-exportParamName": "Body", "description": "New password", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/PasswordForgetRedeem" } } ], "responses": { "201": { "description": "successful operation" }, "400": { "description": "bad request", "schema": { "$ref": "#/definitions/ErrResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/ErrResponse" } } } } }, "/password-reset/request": { "post": { "description": "Create user-bound reset code", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Authentication" ], "parameters": [ { "x-exportParamName": "Body", "description": "Username", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/PasswordForget" } } ], "responses": { "201": { "description": "successful operation" }, "400": { "description": "bad request", "schema": { "$ref": "#/definitions/ErrResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/ErrResponse" } } } } }, "/tokens": { "get": { "security": [ { "TokenAuth": [] } ], "description": "Endpoint to retrieve an opaque overview of the active tokens for the logged in user, received id's can not be used as actual tokens.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Authentication" ], "summary": "Endpoint to retrieve an opaque overview of active tokens for the logged in user", "operationId": "ListTokens", "responses": { "200": { "description": "successful operation", "schema": { "$ref": "#/definitions/TokenList" } }, "401": { "description": "Authentication failed", "schema": { "$ref": "#/definitions/ErrResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/ErrResponse" } } } } }, "/tokens/{opaqueTokenId}": { "delete": { "security": [ { "TokenAuth": [] } ], "description": "Endpoint to remove a token by the given opaqueTokenId", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Authentication" ], "summary": "Endpoint to remove a token by the given opaqueTokenId", "operationId": "DeleteToken", "parameters": [ { "type": "string", "description": "Opaque Token Id", "name": "opaqueTokenId", "in": "path", "required": true } ], "responses": { "200": { "description": "successful operation" }, "401": { "description": "Authentication failed", "schema": { "$ref": "#/definitions/ErrResponse" } }, "500": { "description": "internal server error", "schema": { "$ref": "#/definitions/ErrResponse" } } } } }, "/verify": { "post": { "security": [ { "TokenAuth": [] } ], "description": "Verify the given token", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Authentication" ], "operationId": "Verify", "parameters": [ { "x-exportParamName": "Body", "description": "Rights", "name": "body", "in": "body", "schema": { "$ref": "#/definitions/Rights" } } ], "responses": { "200": { "description": "OK", "schema": { "type": "boolean" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/ErrResponse" } } } } } }, "definitions": { "Credentials": { "properties": { "companyCode": { "type": "string" }, "password": { "type": "string" }, "user": { "type": "string" } } }, "ErrResponse": { "properties": { "errMsg": { "type": "string" } } }, "OpaqueToken": { "properties": { "opaqueId": { "type": "string" }, "userAgent": { "type": "string" } } }, "PasswordForget": { "properties": { "user": { "type": "string" } } }, "PasswordForgetRedeem": { "properties": { "password": { "type": "string" }, "passwordVerify": { "type": "string" }, "resetCode": { "type": "string" }, "user": { "type": "string" } } }, "Rights": { "properties": { "rights": { "type": "array", "items": { "type": "string" } } } }, "SecurityToken": { "properties": { "token": { "type": "string" } } }, "TokenList": { "properties": { "tokens": { "type": "array", "items": { "$ref": "#/definitions/OpaqueToken" } } } }, "User": { "properties": { "company": { "type": "object", "properties": { "code": { "type": "string" }, "id": { "type": "integer" }, "name": { "type": "string" } } }, "roles": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string" }, "rights": { "type": "array", "items": { "type": "string" } } } } }, "userId": { "type": "integer" }, "userName": { "type": "string" } } }, "body": { "properties": { "token": { "type": "string" } } } }, "securityDefinitions": { "TokenAuth": { "type": "apiKey", "name": "Authorization", "in": "header" } } }`)) FlatSwaggerJSON = json.RawMessage([]byte(`{ "schemes": [ "https" ], "swagger": "2.0", "info": { "description": "DualInventive's common authentication API", "title": "Authentication API", "termsOfService": "http://swagger.io/terms/", "contact": { "name": "bartekbeza@dualinventive.com" }, "license": { "name": "Apache 2.0", "url": "http://www.apache.org/licenses/LICENSE-2.0.html" }, "version": "1.0.1" }, "host": "api.mtinfo3000.com", "basePath": "/auth/v1", "paths": { "/login": { "post": { "description": "Authenticate user and retrieve security token", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Authentication" ], "parameters": [ { "x-exportParamName": "Body", "description": "User's credentials", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/Credentials" } } ], "responses": { "200": { "description": "successful operation", "schema": { "$ref": "#/definitions/SecurityToken" } }, "401": { "description": "Authentication failed", "schema": { "$ref": "#/definitions/ErrResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/ErrResponse" } } } } }, "/logout": { "post": { "security": [ { "TokenAuth": [] } ], "description": "Logout user and remove security token", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Authentication" ], "operationId": "logout", "responses": { "204": { "description": "Logout successful" }, "401": { "description": "Authentication failed", "schema": { "$ref": "#/definitions/ErrResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/ErrResponse" } } } } }, "/me": { "get": { "security": [ { "TokenAuth": [] } ], "description": "Request user information based on a given token", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Authentication" ], "responses": { "200": { "description": "Success", "schema": { "$ref": "#/definitions/User" } }, "401": { "description": "Authentication failed", "schema": { "$ref": "#/definitions/ErrResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/ErrResponse" } } } } }, "/password-reset/redeem": { "post": { "description": "Redeem user-bound reset code, changes the users password", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Authentication" ], "parameters": [ { "x-exportParamName": "Body", "description": "New password", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/PasswordForgetRedeem" } } ], "responses": { "201": { "description": "successful operation" }, "400": { "description": "bad request", "schema": { "$ref": "#/definitions/ErrResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/ErrResponse" } } } } }, "/password-reset/request": { "post": { "description": "Create user-bound reset code", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Authentication" ], "parameters": [ { "x-exportParamName": "Body", "description": "Username", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/PasswordForget" } } ], "responses": { "201": { "description": "successful operation" }, "400": { "description": "bad request", "schema": { "$ref": "#/definitions/ErrResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/ErrResponse" } } } } }, "/tokens": { "get": { "security": [ { "TokenAuth": [] } ], "description": "Endpoint to retrieve an opaque overview of the active tokens for the logged in user, received id's can not be used as actual tokens.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Authentication" ], "summary": "Endpoint to retrieve an opaque overview of active tokens for the logged in user", "operationId": "ListTokens", "responses": { "200": { "description": "successful operation", "schema": { "$ref": "#/definitions/TokenList" } }, "401": { "description": "Authentication failed", "schema": { "$ref": "#/definitions/ErrResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/ErrResponse" } } } } }, "/tokens/{opaqueTokenId}": { "delete": { "security": [ { "TokenAuth": [] } ], "description": "Endpoint to remove a token by the given opaqueTokenId", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Authentication" ], "summary": "Endpoint to remove a token by the given opaqueTokenId", "operationId": "DeleteToken", "parameters": [ { "type": "string", "description": "Opaque Token Id", "name": "opaqueTokenId", "in": "path", "required": true } ], "responses": { "200": { "description": "successful operation" }, "401": { "description": "Authentication failed", "schema": { "$ref": "#/definitions/ErrResponse" } }, "500": { "description": "internal server error", "schema": { "$ref": "#/definitions/ErrResponse" } } } } }, "/verify": { "post": { "security": [ { "TokenAuth": [] } ], "description": "Verify the given token", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Authentication" ], "operationId": "Verify", "parameters": [ { "x-exportParamName": "Body", "description": "Rights", "name": "body", "in": "body", "schema": { "$ref": "#/definitions/Rights" } } ], "responses": { "200": { "description": "OK", "schema": { "type": "boolean" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/ErrResponse" } } } } } }, "definitions": { "Credentials": { "properties": { "companyCode": { "type": "string" }, "password": { "type": "string" }, "user": { "type": "string" } } }, "ErrResponse": { "properties": { "errMsg": { "type": "string" } } }, "OpaqueToken": { "properties": { "opaqueId": { "type": "string" }, "userAgent": { "type": "string" } } }, "PasswordForget": { "properties": { "user": { "type": "string" } } }, "PasswordForgetRedeem": { "properties": { "password": { "type": "string" }, "passwordVerify": { "type": "string" }, "resetCode": { "type": "string" }, "user": { "type": "string" } } }, "Rights": { "properties": { "rights": { "type": "array", "items": { "type": "string" } } } }, "SecurityToken": { "properties": { "token": { "type": "string" } } }, "TokenList": { "properties": { "tokens": { "type": "array", "items": { "$ref": "#/definitions/OpaqueToken" } } } }, "User": { "properties": { "company": { "type": "object", "properties": { "code": { "type": "string" }, "id": { "type": "integer" }, "name": { "type": "string" } } }, "roles": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string" }, "rights": { "type": "array", "items": { "type": "string" } } } } }, "userId": { "type": "integer" }, "userName": { "type": "string" } } }, "body": { "properties": { "token": { "type": "string" } } } }, "securityDefinitions": { "TokenAuth": { "type": "apiKey", "name": "Authorization", "in": "header" } } }`)) }