1539 lines
52 KiB
Go
Raw Normal View History

// Package docs GENERATED BY SWAG; DO NOT EDIT
// This file was generated by swaggo/swag
package docs
import "github.com/swaggo/swag"
const docTemplate = `{
"schemes": {{ marshal .Schemes }},
"swagger": "2.0",
"info": {
"description": "{{escape .Description}}",
"title": "{{.Title}}",
2021-04-26 22:00:50 +02:00
"contact": {
"name": "WireGuard Portal Project",
"url": "https://github.com/h44z/wg-portal"
},
"license": {
"name": "MIT",
"url": "https://github.com/h44z/wg-portal/blob/master/LICENSE.txt"
},
2021-04-26 22:00:50 +02:00
"version": "{{.Version}}"
},
"host": "{{.Host}}",
"basePath": "{{.BasePath}}",
"paths": {
"/backend/device": {
2021-04-26 22:00:50 +02:00
"get": {
"security": [
{
"ApiBasicAuth": []
}
],
"produces": [
"application/json"
],
"tags": [
"Interface"
],
"summary": "Get the given device",
"operationId": "GetDevice",
2021-04-26 22:00:50 +02:00
"parameters": [
{
"type": "string",
"description": "Device Name",
"name": "DeviceName",
"in": "query",
2021-04-26 22:00:50 +02:00
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/wireguard.Device"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/server.ApiError"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/server.ApiError"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/server.ApiError"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/server.ApiError"
}
}
}
},
"put": {
"security": [
{
"ApiBasicAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Interface"
],
"summary": "Updates the given device based on the given device model (UNIMPLEMENTED)",
"operationId": "PutDevice",
2021-04-26 22:00:50 +02:00
"parameters": [
{
"type": "string",
"description": "Device Name",
"name": "DeviceName",
"in": "query",
2021-04-26 22:00:50 +02:00
"required": true
},
{
"description": "Device Model",
"name": "Device",
2021-04-26 22:00:50 +02:00
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/wireguard.Device"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/wireguard.Device"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/server.ApiError"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/server.ApiError"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/server.ApiError"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/server.ApiError"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/server.ApiError"
}
}
}
},
"patch": {
"security": [
{
"ApiBasicAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Interface"
],
"summary": "Updates the given device based on the given partial device model (UNIMPLEMENTED)",
"operationId": "PatchDevice",
2021-04-26 22:00:50 +02:00
"parameters": [
{
"type": "string",
"description": "Device Name",
"name": "DeviceName",
"in": "query",
2021-04-26 22:00:50 +02:00
"required": true
},
{
"description": "Device Model",
"name": "Device",
2021-04-26 22:00:50 +02:00
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/wireguard.Device"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/wireguard.Device"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/server.ApiError"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/server.ApiError"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/server.ApiError"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/server.ApiError"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/server.ApiError"
}
}
}
}
},
"/backend/devices": {
"get": {
"security": [
{
"ApiBasicAuth": []
}
],
"produces": [
"application/json"
],
"tags": [
"Interface"
],
"summary": "Get all devices",
"operationId": "GetDevices",
2021-04-26 22:00:50 +02:00
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/wireguard.Device"
}
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/server.ApiError"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/server.ApiError"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/server.ApiError"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/server.ApiError"
}
}
}
}
},
"/backend/peer": {
2021-04-26 22:00:50 +02:00
"get": {
"security": [
{
"ApiBasicAuth": []
}
],
"produces": [
"application/json"
],
"tags": [
"Peers"
],
"summary": "Retrieves the peer for the given public key",
"operationId": "GetPeer",
2021-04-26 22:00:50 +02:00
"parameters": [
{
"type": "string",
"description": "Public Key (Base 64)",
"name": "PublicKey",
"in": "query",
2021-04-26 22:00:50 +02:00
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/wireguard.Peer"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/server.ApiError"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/server.ApiError"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/server.ApiError"
}
}
}
},
"put": {
"security": [
{
"ApiBasicAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Peers"
],
"summary": "Updates the given peer based on the given peer model",
"operationId": "PutPeer",
2021-04-26 22:00:50 +02:00
"parameters": [
{
"type": "string",
"description": "Public Key",
"name": "PublicKey",
"in": "query",
2021-04-26 22:00:50 +02:00
"required": true
},
{
"description": "Peer Model",
"name": "Peer",
2021-04-26 22:00:50 +02:00
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/wireguard.Peer"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/wireguard.Peer"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/server.ApiError"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/server.ApiError"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/server.ApiError"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/server.ApiError"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/server.ApiError"
}
}
}
},
"delete": {
"security": [
{
"ApiBasicAuth": []
}
],
"produces": [
"application/json"
],
"tags": [
"Peers"
],
"summary": "Updates the given peer based on the given partial peer model",
"operationId": "DeletePeer",
2021-04-26 22:00:50 +02:00
"parameters": [
{
"type": "string",
"description": "Public Key",
"name": "PublicKey",
"in": "query",
2021-04-26 22:00:50 +02:00
"required": true
}
],
"responses": {
"204": {
2021-04-26 22:00:50 +02:00
"description": "No Content"
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/server.ApiError"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/server.ApiError"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/server.ApiError"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/server.ApiError"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/server.ApiError"
}
}
}
},
"patch": {
"security": [
{
"ApiBasicAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Peers"
],
"summary": "Updates the given peer based on the given partial peer model",
"operationId": "PatchPeer",
2021-04-26 22:00:50 +02:00
"parameters": [
{
"type": "string",
"description": "Public Key",
"name": "PublicKey",
"in": "query",
2021-04-26 22:00:50 +02:00
"required": true
},
{
"description": "Peer Model",
"name": "Peer",
2021-04-26 22:00:50 +02:00
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/wireguard.Peer"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/wireguard.Peer"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/server.ApiError"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/server.ApiError"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/server.ApiError"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/server.ApiError"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/server.ApiError"
}
}
}
}
},
"/backend/peers": {
2021-04-26 22:00:50 +02:00
"get": {
"security": [
{
"ApiBasicAuth": []
}
],
"produces": [
"application/json"
],
"tags": [
"Peers"
],
"summary": "Retrieves all peers for the given interface",
"operationId": "GetPeers",
2021-04-26 22:00:50 +02:00
"parameters": [
{
"type": "string",
"description": "Device Name",
"name": "DeviceName",
"in": "query",
2021-04-26 22:00:50 +02:00
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/wireguard.Peer"
}
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/server.ApiError"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/server.ApiError"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/server.ApiError"
}
}
}
},
"post": {
"security": [
{
"ApiBasicAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Peers"
],
"summary": "Creates a new peer based on the given peer model",
"operationId": "PostPeer",
2021-04-26 22:00:50 +02:00
"parameters": [
{
"type": "string",
"description": "Device Name",
"name": "DeviceName",
"in": "query",
2021-04-26 22:00:50 +02:00
"required": true
},
{
"description": "Peer Model",
"name": "Peer",
2021-04-26 22:00:50 +02:00
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/wireguard.Peer"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/wireguard.Peer"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/server.ApiError"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/server.ApiError"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/server.ApiError"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/server.ApiError"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/server.ApiError"
}
}
}
}
},
"/backend/user": {
"get": {
"security": [
{
"ApiBasicAuth": []
}
],
"produces": [
"application/json"
],
2021-04-26 22:00:50 +02:00
"tags": [
"Users"
],
"summary": "Retrieves user based on given Email",
"operationId": "GetUser",
"parameters": [
{
"type": "string",
"description": "User Email",
"name": "Email",
"in": "query",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/users.User"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/server.ApiError"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/server.ApiError"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/server.ApiError"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/server.ApiError"
}
}
}
},
"put": {
"security": [
{
"ApiBasicAuth": []
}
],
2021-04-26 22:00:50 +02:00
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
2021-04-26 22:00:50 +02:00
"tags": [
"Users"
],
"summary": "Updates a user based on the given user model",
"operationId": "PutUser",
"parameters": [
{
"type": "string",
"description": "User Email",
"name": "Email",
"in": "query",
"required": true
2021-04-26 22:00:50 +02:00
},
{
"description": "User Model",
"name": "User",
2021-04-26 22:00:50 +02:00
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/users.User"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/users.User"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/server.ApiError"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/server.ApiError"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/server.ApiError"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/server.ApiError"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/server.ApiError"
}
}
}
},
"delete": {
"security": [
{
"ApiBasicAuth": []
}
],
"produces": [
"application/json"
],
2021-04-26 22:00:50 +02:00
"tags": [
"Users"
],
"summary": "Deletes the specified user",
"operationId": "DeleteUser",
"parameters": [
{
"type": "string",
"description": "User Email",
"name": "Email",
"in": "query",
"required": true
}
],
"responses": {
"204": {
"description": "No content"
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/server.ApiError"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/server.ApiError"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/server.ApiError"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/server.ApiError"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/server.ApiError"
}
}
}
},
"patch": {
"security": [
{
"ApiBasicAuth": []
}
],
2021-04-26 22:00:50 +02:00
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
2021-04-26 22:00:50 +02:00
"tags": [
"Users"
],
"summary": "Updates a user based on the given partial user model",
"operationId": "PatchUser",
"parameters": [
{
"type": "string",
"description": "User Email",
"name": "Email",
"in": "query",
"required": true
2021-04-26 22:00:50 +02:00
},
{
"description": "User Model",
"name": "User",
2021-04-26 22:00:50 +02:00
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/users.User"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/users.User"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/server.ApiError"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/server.ApiError"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/server.ApiError"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/server.ApiError"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/server.ApiError"
}
}
}
}
},
2021-04-26 22:00:50 +02:00
"/backend/users": {
"get": {
"security": [
{
"ApiBasicAuth": []
}
],
"produces": [
"application/json"
],
2021-04-26 22:00:50 +02:00
"tags": [
"Users"
],
"summary": "Retrieves all users",
"operationId": "GetUsers",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/users.User"
}
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/server.ApiError"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/server.ApiError"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/server.ApiError"
}
}
}
},
"post": {
"security": [
{
"ApiBasicAuth": []
}
],
2021-04-26 22:00:50 +02:00
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
2021-04-26 22:00:50 +02:00
"tags": [
"Users"
],
"summary": "Creates a new user based on the given user model",
"operationId": "PostUser",
2021-04-26 22:00:50 +02:00
"parameters": [
{
"description": "User Model",
"name": "User",
2021-04-26 22:00:50 +02:00
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/users.User"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/users.User"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/server.ApiError"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/server.ApiError"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/server.ApiError"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/server.ApiError"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/server.ApiError"
}
}
}
}
2021-04-26 22:00:50 +02:00
},
"/provisioning/peer": {
2021-04-29 11:23:32 +02:00
"get": {
"security": [
{
"GeneralBasicAuth": []
}
],
"produces": [
"text/plain"
],
"tags": [
"Provisioning"
],
"summary": "Retrieves the peer config for the given public key",
"operationId": "GetPeerDeploymentConfig",
2021-04-29 11:23:32 +02:00
"parameters": [
{
"type": "string",
"description": "Public Key (Base 64)",
"name": "PublicKey",
"in": "query",
2021-04-29 11:23:32 +02:00
"required": true
}
],
"responses": {
"200": {
"description": "The WireGuard configuration file",
"schema": {
"type": "string"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/server.ApiError"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/server.ApiError"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/server.ApiError"
}
}
}
}
},
"/provisioning/peers": {
"get": {
2021-04-26 22:00:50 +02:00
"security": [
{
"GeneralBasicAuth": []
}
],
"produces": [
"application/json"
2021-04-26 22:00:50 +02:00
],
"tags": [
"Provisioning"
],
"summary": "Retrieves all active peers for the given email address",
"operationId": "GetPeerDeploymentInformation",
2021-04-26 22:00:50 +02:00
"parameters": [
{
"type": "string",
"description": "Email Address",
"name": "Email",
"in": "query",
"required": true
2021-04-26 22:00:50 +02:00
}
],
"responses": {
"200": {
"description": "All active WireGuard peers",
2021-04-26 22:00:50 +02:00
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/server.PeerDeploymentInformation"
}
2021-04-26 22:00:50 +02:00
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/server.ApiError"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/server.ApiError"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/server.ApiError"
}
}
}
},
"post": {
2021-04-26 22:00:50 +02:00
"security": [
{
"GeneralBasicAuth": []
}
],
"consumes": [
2021-04-29 11:23:32 +02:00
"application/json"
2021-04-26 22:00:50 +02:00
],
"produces": [
"text/plain"
],
2021-04-26 22:00:50 +02:00
"tags": [
"Provisioning"
],
"summary": "Creates the requested peer config and returns the config file",
"operationId": "PostPeerDeploymentConfig",
2021-04-26 22:00:50 +02:00
"parameters": [
{
"description": "Provisioning Request Model",
"name": "ProvisioningRequest",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/server.ProvisioningRequest"
}
2021-04-26 22:00:50 +02:00
}
],
"responses": {
"200": {
"description": "The WireGuard configuration file",
2021-04-26 22:00:50 +02:00
"schema": {
"type": "string"
2021-04-26 22:00:50 +02:00
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/server.ApiError"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/server.ApiError"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/server.ApiError"
}
}
}
}
}
},
"definitions": {
"server.ApiError": {
"type": "object",
"properties": {
"Message": {
"type": "string"
}
}
},
2021-04-29 11:23:32 +02:00
"server.PeerDeploymentInformation": {
"type": "object",
"properties": {
"Device": {
2021-04-29 11:23:32 +02:00
"type": "string"
},
"DeviceIdentifier": {
2021-04-29 11:23:32 +02:00
"type": "string"
},
"Identifier": {
2021-04-29 11:23:32 +02:00
"type": "string"
},
"PublicKey": {
2021-04-29 11:23:32 +02:00
"type": "string"
}
}
},
2021-04-26 22:00:50 +02:00
"server.ProvisioningRequest": {
"type": "object",
"required": [
"Email",
"Identifier"
2021-04-26 22:00:50 +02:00
],
"properties": {
"AllowedIPsStr": {
2021-04-26 22:00:50 +02:00
"type": "string"
},
"DNSStr": {
2021-04-26 22:00:50 +02:00
"type": "string"
},
"DeviceName": {
"description": "DeviceName is optional, if not specified, the configured default device will be used.",
2021-04-26 22:00:50 +02:00
"type": "string"
},
"Email": {
2021-04-26 22:00:50 +02:00
"type": "string"
},
"Identifier": {
2021-04-26 22:00:50 +02:00
"type": "string"
},
"Mtu": {
"type": "integer",
"maximum": 1500,
"minimum": 0
2021-04-26 22:00:50 +02:00
},
"PersistentKeepalive": {
"type": "integer",
"minimum": 0
2021-04-26 22:00:50 +02:00
}
}
},
"users.User": {
"type": "object",
"required": [
"Email",
"Firstname",
"Lastname"
],
"properties": {
"CreatedAt": {
"description": "database internal fields",
"type": "string"
},
"DeletedAt": {
"type": "string"
},
"Email": {
"description": "required fields",
"type": "string"
},
"Firstname": {
"description": "optional fields",
"type": "string"
},
"IsAdmin": {
"type": "boolean"
},
"Lastname": {
"type": "string"
},
"Password": {
"description": "optional, integrated password authentication",
"type": "string"
},
"Phone": {
"type": "string"
},
"Source": {
"type": "string"
},
"UpdatedAt": {
"type": "string"
}
}
2021-04-26 22:00:50 +02:00
},
"wireguard.Device": {
"type": "object",
"required": [
"DeviceName",
"IPsStr",
"PrivateKey",
"PublicKey",
"Type"
2021-04-26 22:00:50 +02:00
],
"properties": {
"CreatedAt": {
"type": "string"
},
"DNSStr": {
"description": "comma separated list of the DNS servers of the client, wg-quick addition",
2021-04-26 22:00:50 +02:00
"type": "string"
},
"DefaultAllowedIPsStr": {
2021-04-26 22:00:50 +02:00
"description": "comma separated list of IPs that are used in the client config file",
"type": "string"
},
"DefaultEndpoint": {
2021-04-26 22:00:50 +02:00
"description": "Settings that are applied to all peer by default",
"type": "string"
},
"DefaultPersistentKeepalive": {
"type": "integer",
"minimum": 0
2021-04-26 22:00:50 +02:00
},
"DeviceName": {
2021-04-26 22:00:50 +02:00
"type": "string"
},
"DisplayName": {
"type": "string",
"maxLength": 200
2021-04-26 22:00:50 +02:00
},
"FirewallMark": {
"type": "integer",
"minimum": 0
2021-04-26 22:00:50 +02:00
},
"IPsStr": {
2021-04-26 22:00:50 +02:00
"description": "comma separated list of the IPs of the client, wg-quick addition",
"type": "string"
},
"ListenPort": {
2021-04-26 22:00:50 +02:00
"type": "integer"
},
"Mtu": {
2021-04-26 22:00:50 +02:00
"description": "the interface MTU, wg-quick addition",
"type": "integer",
"maximum": 1500,
"minimum": 0
2021-04-26 22:00:50 +02:00
},
"PostDown": {
2021-04-26 22:00:50 +02:00
"description": "post down script, wg-quick addition",
"type": "string"
},
"PostUp": {
2021-04-26 22:00:50 +02:00
"description": "post up script, wg-quick addition",
"type": "string"
},
"PreDown": {
2021-04-26 22:00:50 +02:00
"description": "pre down script, wg-quick addition",
"type": "string"
},
"PreUp": {
2021-04-26 22:00:50 +02:00
"description": "pre up script, wg-quick addition",
"type": "string"
},
"PrivateKey": {
2021-04-26 22:00:50 +02:00
"description": "Core WireGuard Settings (Interface section)",
"type": "string"
},
"PublicKey": {
2021-04-26 22:00:50 +02:00
"description": "Misc. WireGuard Settings",
"type": "string"
},
"RoutingTable": {
2021-04-26 22:00:50 +02:00
"description": "the routing table, wg-quick addition",
"type": "string"
},
"SaveConfig": {
2021-04-26 22:00:50 +02:00
"description": "if set to ` + "`" + `true', the configuration is saved from the current state of the interface upon shutdown, wg-quick addition",
"type": "boolean"
},
"Type": {
"type": "string",
"enum": [
"client",
"server"
]
2021-04-26 22:00:50 +02:00
},
"UpdatedAt": {
2021-04-26 22:00:50 +02:00
"type": "string"
}
}
},
"wireguard.Peer": {
"type": "object",
"required": [
"DeviceName",
"DeviceType",
"Email",
"Identifier",
"PublicKey",
"UID"
2021-04-26 22:00:50 +02:00
],
"properties": {
"AllowedIPsSrvStr": {
"description": "a comma separated list of IPs that are used in the server config file",
"type": "string"
},
"AllowedIPsStr": {
2021-04-26 22:00:50 +02:00
"description": "a comma separated list of IPs that are used in the client config file",
"type": "string"
},
"CreatedAt": {
2021-04-26 22:00:50 +02:00
"type": "string"
},
"CreatedBy": {
2021-04-26 22:00:50 +02:00
"type": "string"
},
"DNSStr": {
"description": "comma separated list of the DNS servers for the client",
2021-04-26 22:00:50 +02:00
"type": "string"
},
"DeactivatedAt": {
2021-04-26 22:00:50 +02:00
"type": "string"
},
"DeactivatedReason": {
"type": "string"
},
"DeviceName": {
"type": "string"
},
"DeviceType": {
"type": "string",
"enum": [
"client",
"server"
]
},
"Email": {
2021-04-26 22:00:50 +02:00
"type": "string"
},
"Endpoint": {
2021-04-26 22:00:50 +02:00
"type": "string"
},
"ExpiresAt": {
"type": "string"
},
"IPsStr": {
"description": "a comma separated list of IPs of the client",
2021-04-26 22:00:50 +02:00
"type": "string"
},
"Identifier": {
2021-04-26 22:00:50 +02:00
"description": "Identifier AND Email make a WireGuard peer unique",
"type": "string",
"maxLength": 64
2021-04-26 22:00:50 +02:00
},
"IgnoreGlobalSettings": {
2021-04-26 22:00:50 +02:00
"type": "boolean"
},
"Mtu": {
2021-04-26 22:00:50 +02:00
"description": "Global Device Settings (can be ignored, only make sense if device is in server mode)",
"type": "integer",
"maximum": 1500,
"minimum": 0
2021-04-26 22:00:50 +02:00
},
"PersistentKeepalive": {
"type": "integer",
"minimum": 0
2021-04-26 22:00:50 +02:00
},
"PresharedKey": {
2021-04-26 22:00:50 +02:00
"type": "string"
},
"PrivateKey": {
2021-04-26 22:00:50 +02:00
"description": "Misc. WireGuard Settings",
"type": "string"
},
"PublicKey": {
2021-04-26 22:00:50 +02:00
"description": "Core WireGuard Settings",
"type": "string"
},
"UID": {
"description": "uid for html identification",
"type": "string"
},
"UpdatedAt": {
2021-04-26 22:00:50 +02:00
"type": "string"
},
"UpdatedBy": {
2021-04-26 22:00:50 +02:00
"type": "string"
}
}
}
},
"securityDefinitions": {
"ApiBasicAuth": {
"type": "basic"
2021-04-26 22:00:50 +02:00
},
"GeneralBasicAuth": {
"type": "basic"
}
}
}`
// SwaggerInfo holds exported Swagger Info so clients can modify it
var SwaggerInfo = &swag.Spec{
Version: "1.0",
Host: "",
BasePath: "/api/v1",
Schemes: []string{},
Title: "WireGuard Portal API",
Description: "WireGuard Portal API for managing users and peers.",
InfoInstanceName: "swagger",
SwaggerTemplate: docTemplate,
}
func init() {
swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo)
}