2021-09-27 20:28:03 +02:00
|
|
|
// Package docs GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
|
2021-04-26 14:40:49 +02:00
|
|
|
// This file was generated by swaggo/swag
|
|
|
|
package docs
|
|
|
|
|
|
|
|
import (
|
|
|
|
"bytes"
|
|
|
|
"encoding/json"
|
|
|
|
"strings"
|
2021-09-27 20:28:03 +02:00
|
|
|
"text/template"
|
2021-04-26 14:40:49 +02:00
|
|
|
|
|
|
|
"github.com/swaggo/swag"
|
|
|
|
)
|
|
|
|
|
|
|
|
var doc = `{
|
|
|
|
"schemes": {{ marshal .Schemes }},
|
|
|
|
"swagger": "2.0",
|
|
|
|
"info": {
|
2021-09-27 20:28:03 +02:00
|
|
|
"description": "{{escape .Description}}",
|
2021-04-26 14:40:49 +02:00
|
|
|
"title": "{{.Title}}",
|
2021-04-26 22:00:50 +02:00
|
|
|
"contact": {
|
|
|
|
"name": "WireGuard Portal Project",
|
|
|
|
"url": "https://github.com/h44z/wg-portal"
|
|
|
|
},
|
2021-04-26 14:40:49 +02:00
|
|
|
"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": {
|
2021-05-03 11:40:06 +02:00
|
|
|
"/backend/device": {
|
2021-04-26 22:00:50 +02:00
|
|
|
"get": {
|
|
|
|
"security": [
|
|
|
|
{
|
|
|
|
"ApiBasicAuth": []
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"produces": [
|
|
|
|
"application/json"
|
|
|
|
],
|
|
|
|
"tags": [
|
|
|
|
"Interface"
|
|
|
|
],
|
|
|
|
"summary": "Get the given device",
|
2021-09-29 18:41:13 +02:00
|
|
|
"operationId": "GetDevice",
|
2021-04-26 22:00:50 +02:00
|
|
|
"parameters": [
|
|
|
|
{
|
|
|
|
"type": "string",
|
|
|
|
"description": "Device Name",
|
2021-09-29 18:41:13 +02:00
|
|
|
"name": "DeviceName",
|
2021-05-03 11:40:06 +02:00
|
|
|
"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)",
|
2021-09-29 18:41:13 +02:00
|
|
|
"operationId": "PutDevice",
|
2021-04-26 22:00:50 +02:00
|
|
|
"parameters": [
|
|
|
|
{
|
|
|
|
"type": "string",
|
|
|
|
"description": "Device Name",
|
2021-09-29 18:41:13 +02:00
|
|
|
"name": "DeviceName",
|
2021-05-03 11:40:06 +02:00
|
|
|
"in": "query",
|
2021-04-26 22:00:50 +02:00
|
|
|
"required": true
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"description": "Device Model",
|
2021-09-29 18:41:13 +02:00
|
|
|
"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)",
|
2021-09-29 18:41:13 +02:00
|
|
|
"operationId": "PatchDevice",
|
2021-04-26 22:00:50 +02:00
|
|
|
"parameters": [
|
|
|
|
{
|
|
|
|
"type": "string",
|
|
|
|
"description": "Device Name",
|
2021-09-29 18:41:13 +02:00
|
|
|
"name": "DeviceName",
|
2021-05-03 11:40:06 +02:00
|
|
|
"in": "query",
|
2021-04-26 22:00:50 +02:00
|
|
|
"required": true
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"description": "Device Model",
|
2021-09-29 18:41:13 +02:00
|
|
|
"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",
|
2021-09-29 18:41:13 +02:00
|
|
|
"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"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2021-05-03 10:41:22 +02:00
|
|
|
"/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",
|
2021-09-29 18:41:13 +02:00
|
|
|
"operationId": "GetPeer",
|
2021-04-26 22:00:50 +02:00
|
|
|
"parameters": [
|
|
|
|
{
|
|
|
|
"type": "string",
|
|
|
|
"description": "Public Key (Base 64)",
|
2021-09-29 18:41:13 +02:00
|
|
|
"name": "PublicKey",
|
2021-05-03 10:41:22 +02:00
|
|
|
"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",
|
2021-09-29 18:41:13 +02:00
|
|
|
"operationId": "PutPeer",
|
2021-04-26 22:00:50 +02:00
|
|
|
"parameters": [
|
|
|
|
{
|
|
|
|
"type": "string",
|
|
|
|
"description": "Public Key",
|
2021-09-29 18:41:13 +02:00
|
|
|
"name": "PublicKey",
|
2021-05-03 10:41:22 +02:00
|
|
|
"in": "query",
|
2021-04-26 22:00:50 +02:00
|
|
|
"required": true
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"description": "Peer Model",
|
2021-09-29 18:41:13 +02:00
|
|
|
"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",
|
2021-09-29 18:41:13 +02:00
|
|
|
"operationId": "DeletePeer",
|
2021-04-26 22:00:50 +02:00
|
|
|
"parameters": [
|
|
|
|
{
|
|
|
|
"type": "string",
|
|
|
|
"description": "Public Key",
|
2021-09-29 18:41:13 +02:00
|
|
|
"name": "PublicKey",
|
2021-05-03 10:41:22 +02:00
|
|
|
"in": "query",
|
2021-04-26 22:00:50 +02:00
|
|
|
"required": true
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"responses": {
|
|
|
|
"202": {
|
|
|
|
"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",
|
2021-09-29 18:41:13 +02:00
|
|
|
"operationId": "PatchPeer",
|
2021-04-26 22:00:50 +02:00
|
|
|
"parameters": [
|
|
|
|
{
|
|
|
|
"type": "string",
|
|
|
|
"description": "Public Key",
|
2021-09-29 18:41:13 +02:00
|
|
|
"name": "PublicKey",
|
2021-05-03 10:41:22 +02:00
|
|
|
"in": "query",
|
2021-04-26 22:00:50 +02:00
|
|
|
"required": true
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"description": "Peer Model",
|
2021-09-29 18:41:13 +02:00
|
|
|
"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"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2021-05-03 11:40:06 +02:00
|
|
|
"/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",
|
2021-09-29 18:41:13 +02:00
|
|
|
"operationId": "GetPeers",
|
2021-04-26 22:00:50 +02:00
|
|
|
"parameters": [
|
|
|
|
{
|
|
|
|
"type": "string",
|
|
|
|
"description": "Device Name",
|
2021-09-29 18:41:13 +02:00
|
|
|
"name": "DeviceName",
|
2021-05-03 11:40:06 +02:00
|
|
|
"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",
|
2021-09-29 18:41:13 +02:00
|
|
|
"operationId": "PostPeer",
|
2021-04-26 22:00:50 +02:00
|
|
|
"parameters": [
|
|
|
|
{
|
|
|
|
"type": "string",
|
|
|
|
"description": "Device Name",
|
2021-09-29 18:41:13 +02:00
|
|
|
"name": "DeviceName",
|
2021-05-03 11:40:06 +02:00
|
|
|
"in": "query",
|
2021-04-26 22:00:50 +02:00
|
|
|
"required": true
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"description": "Peer Model",
|
2021-09-29 18:41:13 +02:00
|
|
|
"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"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2021-05-03 11:40:06 +02:00
|
|
|
"/backend/user": {
|
2021-04-26 14:40:49 +02:00
|
|
|
"get": {
|
|
|
|
"security": [
|
|
|
|
{
|
|
|
|
"ApiBasicAuth": []
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"produces": [
|
|
|
|
"application/json"
|
|
|
|
],
|
2021-04-26 22:00:50 +02:00
|
|
|
"tags": [
|
|
|
|
"Users"
|
|
|
|
],
|
2021-04-26 14:40:49 +02:00
|
|
|
"summary": "Retrieves user based on given Email",
|
2021-09-29 18:41:13 +02:00
|
|
|
"operationId": "GetUser",
|
2021-04-26 14:40:49 +02:00
|
|
|
"parameters": [
|
|
|
|
{
|
|
|
|
"type": "string",
|
|
|
|
"description": "User Email",
|
2021-09-29 18:41:13 +02:00
|
|
|
"name": "Email",
|
2021-05-03 11:40:06 +02:00
|
|
|
"in": "query",
|
2021-04-26 14:40:49 +02:00
|
|
|
"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"
|
|
|
|
],
|
2021-04-26 14:40:49 +02:00
|
|
|
"produces": [
|
|
|
|
"application/json"
|
|
|
|
],
|
2021-04-26 22:00:50 +02:00
|
|
|
"tags": [
|
|
|
|
"Users"
|
|
|
|
],
|
2021-04-26 14:40:49 +02:00
|
|
|
"summary": "Updates a user based on the given user model",
|
2021-09-29 18:41:13 +02:00
|
|
|
"operationId": "PutUser",
|
2021-04-26 14:40:49 +02:00
|
|
|
"parameters": [
|
|
|
|
{
|
|
|
|
"type": "string",
|
|
|
|
"description": "User Email",
|
2021-09-29 18:41:13 +02:00
|
|
|
"name": "Email",
|
2021-05-03 11:40:06 +02:00
|
|
|
"in": "query",
|
2021-04-26 14:40:49 +02:00
|
|
|
"required": true
|
2021-04-26 22:00:50 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"description": "User Model",
|
2021-09-29 18:41:13 +02:00
|
|
|
"name": "User",
|
2021-04-26 22:00:50 +02:00
|
|
|
"in": "body",
|
|
|
|
"required": true,
|
|
|
|
"schema": {
|
|
|
|
"$ref": "#/definitions/users.User"
|
|
|
|
}
|
2021-04-26 14:40:49 +02:00
|
|
|
}
|
|
|
|
],
|
|
|
|
"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"
|
|
|
|
],
|
2021-04-26 14:40:49 +02:00
|
|
|
"summary": "Deletes the specified user",
|
2021-09-29 18:41:13 +02:00
|
|
|
"operationId": "DeleteUser",
|
2021-04-26 14:40:49 +02:00
|
|
|
"parameters": [
|
|
|
|
{
|
|
|
|
"type": "string",
|
|
|
|
"description": "User Email",
|
2021-09-29 18:41:13 +02:00
|
|
|
"name": "Email",
|
2021-05-03 11:40:06 +02:00
|
|
|
"in": "query",
|
2021-04-26 14:40:49 +02:00
|
|
|
"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"
|
|
|
|
],
|
2021-04-26 14:40:49 +02:00
|
|
|
"produces": [
|
|
|
|
"application/json"
|
|
|
|
],
|
2021-04-26 22:00:50 +02:00
|
|
|
"tags": [
|
|
|
|
"Users"
|
|
|
|
],
|
2021-04-26 14:40:49 +02:00
|
|
|
"summary": "Updates a user based on the given partial user model",
|
2021-09-29 18:41:13 +02:00
|
|
|
"operationId": "PatchUser",
|
2021-04-26 14:40:49 +02:00
|
|
|
"parameters": [
|
|
|
|
{
|
|
|
|
"type": "string",
|
|
|
|
"description": "User Email",
|
2021-09-29 18:41:13 +02:00
|
|
|
"name": "Email",
|
2021-05-03 11:40:06 +02:00
|
|
|
"in": "query",
|
2021-04-26 14:40:49 +02:00
|
|
|
"required": true
|
2021-04-26 22:00:50 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"description": "User Model",
|
2021-09-29 18:41:13 +02:00
|
|
|
"name": "User",
|
2021-04-26 22:00:50 +02:00
|
|
|
"in": "body",
|
|
|
|
"required": true,
|
|
|
|
"schema": {
|
|
|
|
"$ref": "#/definitions/users.User"
|
|
|
|
}
|
2021-04-26 14:40:49 +02:00
|
|
|
}
|
|
|
|
],
|
|
|
|
"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": {
|
2021-04-26 14:40:49 +02:00
|
|
|
"get": {
|
|
|
|
"security": [
|
|
|
|
{
|
|
|
|
"ApiBasicAuth": []
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"produces": [
|
|
|
|
"application/json"
|
|
|
|
],
|
2021-04-26 22:00:50 +02:00
|
|
|
"tags": [
|
|
|
|
"Users"
|
|
|
|
],
|
2021-04-26 14:40:49 +02:00
|
|
|
"summary": "Retrieves all users",
|
2021-09-29 18:41:13 +02:00
|
|
|
"operationId": "GetUsers",
|
2021-04-26 14:40:49 +02:00
|
|
|
"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"
|
|
|
|
],
|
2021-04-26 14:40:49 +02:00
|
|
|
"produces": [
|
|
|
|
"application/json"
|
|
|
|
],
|
2021-04-26 22:00:50 +02:00
|
|
|
"tags": [
|
|
|
|
"Users"
|
|
|
|
],
|
2021-04-26 14:40:49 +02:00
|
|
|
"summary": "Creates a new user based on the given user model",
|
2021-09-29 18:41:13 +02:00
|
|
|
"operationId": "PostUser",
|
2021-04-26 22:00:50 +02:00
|
|
|
"parameters": [
|
|
|
|
{
|
|
|
|
"description": "User Model",
|
2021-09-29 18:41:13 +02:00
|
|
|
"name": "User",
|
2021-04-26 22:00:50 +02:00
|
|
|
"in": "body",
|
|
|
|
"required": true,
|
|
|
|
"schema": {
|
|
|
|
"$ref": "#/definitions/users.User"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
2021-04-26 14:40:49 +02:00
|
|
|
"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
|
|
|
},
|
2021-05-03 10:41:22 +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",
|
2021-09-29 18:41:13 +02:00
|
|
|
"operationId": "GetPeerDeploymentConfig",
|
2021-04-29 11:23:32 +02:00
|
|
|
"parameters": [
|
|
|
|
{
|
|
|
|
"type": "string",
|
|
|
|
"description": "Public Key (Base 64)",
|
2021-09-29 18:41:13 +02:00
|
|
|
"name": "PublicKey",
|
2021-05-03 10:41:22 +02:00
|
|
|
"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": {
|
2021-05-03 11:40:06 +02:00
|
|
|
"get": {
|
2021-04-26 22:00:50 +02:00
|
|
|
"security": [
|
|
|
|
{
|
|
|
|
"GeneralBasicAuth": []
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"produces": [
|
2021-05-03 11:40:06 +02:00
|
|
|
"application/json"
|
2021-04-26 22:00:50 +02:00
|
|
|
],
|
|
|
|
"tags": [
|
|
|
|
"Provisioning"
|
|
|
|
],
|
2021-05-03 11:40:06 +02:00
|
|
|
"summary": "Retrieves all active peers for the given email address",
|
2021-09-29 18:41:13 +02:00
|
|
|
"operationId": "GetPeerDeploymentInformation",
|
2021-04-26 22:00:50 +02:00
|
|
|
"parameters": [
|
|
|
|
{
|
2021-05-03 11:40:06 +02:00
|
|
|
"type": "string",
|
|
|
|
"description": "Email Address",
|
2021-09-29 18:41:13 +02:00
|
|
|
"name": "Email",
|
2021-05-03 11:40:06 +02:00
|
|
|
"in": "query",
|
|
|
|
"required": true
|
2021-04-26 22:00:50 +02:00
|
|
|
}
|
|
|
|
],
|
|
|
|
"responses": {
|
|
|
|
"200": {
|
2021-05-03 11:40:06 +02:00
|
|
|
"description": "All active WireGuard peers",
|
2021-04-26 22:00:50 +02:00
|
|
|
"schema": {
|
2021-05-03 11:40:06 +02:00
|
|
|
"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"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2021-05-03 11:40:06 +02:00
|
|
|
},
|
|
|
|
"post": {
|
2021-04-26 22:00:50 +02:00
|
|
|
"security": [
|
|
|
|
{
|
|
|
|
"GeneralBasicAuth": []
|
|
|
|
}
|
|
|
|
],
|
2021-05-03 11:40:06 +02:00
|
|
|
"consumes": [
|
2021-04-29 11:23:32 +02:00
|
|
|
"application/json"
|
2021-04-26 22:00:50 +02:00
|
|
|
],
|
2021-05-03 11:40:06 +02:00
|
|
|
"produces": [
|
|
|
|
"text/plain"
|
|
|
|
],
|
2021-04-26 22:00:50 +02:00
|
|
|
"tags": [
|
|
|
|
"Provisioning"
|
|
|
|
],
|
2021-05-03 11:40:06 +02:00
|
|
|
"summary": "Creates the requested peer config and returns the config file",
|
2021-09-29 18:41:13 +02:00
|
|
|
"operationId": "PostPeerDeploymentConfig",
|
2021-04-26 22:00:50 +02:00
|
|
|
"parameters": [
|
|
|
|
{
|
2021-05-03 11:40:06 +02:00
|
|
|
"description": "Provisioning Request Model",
|
2021-09-29 18:41:13 +02:00
|
|
|
"name": "ProvisioningRequest",
|
2021-05-03 11:40:06 +02:00
|
|
|
"in": "body",
|
|
|
|
"required": true,
|
|
|
|
"schema": {
|
|
|
|
"$ref": "#/definitions/server.ProvisioningRequest"
|
|
|
|
}
|
2021-04-26 22:00:50 +02:00
|
|
|
}
|
|
|
|
],
|
|
|
|
"responses": {
|
|
|
|
"200": {
|
2021-05-03 11:40:06 +02:00
|
|
|
"description": "The WireGuard configuration file",
|
2021-04-26 22:00:50 +02:00
|
|
|
"schema": {
|
2021-05-03 11:40:06 +02:00
|
|
|
"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"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2021-04-26 14:40:49 +02:00
|
|
|
}
|
|
|
|
},
|
|
|
|
"definitions": {
|
|
|
|
"server.ApiError": {
|
|
|
|
"type": "object",
|
|
|
|
"properties": {
|
2021-09-27 20:28:03 +02:00
|
|
|
"Message": {
|
2021-04-26 14:40:49 +02:00
|
|
|
"type": "string"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2021-04-29 11:23:32 +02:00
|
|
|
"server.PeerDeploymentInformation": {
|
|
|
|
"type": "object",
|
|
|
|
"properties": {
|
2021-09-27 20:28:03 +02:00
|
|
|
"Device": {
|
2021-04-29 11:23:32 +02:00
|
|
|
"type": "string"
|
|
|
|
},
|
2021-09-27 20:28:03 +02:00
|
|
|
"DeviceIdentifier": {
|
2021-04-29 11:23:32 +02:00
|
|
|
"type": "string"
|
|
|
|
},
|
2021-09-27 20:28:03 +02:00
|
|
|
"Identifier": {
|
2021-04-29 11:23:32 +02:00
|
|
|
"type": "string"
|
|
|
|
},
|
2021-09-27 20:28:03 +02:00
|
|
|
"PublicKey": {
|
2021-04-29 11:23:32 +02:00
|
|
|
"type": "string"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2021-04-26 22:00:50 +02:00
|
|
|
"server.ProvisioningRequest": {
|
|
|
|
"type": "object",
|
|
|
|
"required": [
|
2021-09-27 20:28:03 +02:00
|
|
|
"Email",
|
|
|
|
"Identifier"
|
2021-04-26 22:00:50 +02:00
|
|
|
],
|
|
|
|
"properties": {
|
2021-09-27 20:28:03 +02:00
|
|
|
"AllowedIPsStr": {
|
2021-04-26 22:00:50 +02:00
|
|
|
"type": "string"
|
|
|
|
},
|
2021-09-27 20:28:03 +02:00
|
|
|
"DNSStr": {
|
2021-04-26 22:00:50 +02:00
|
|
|
"type": "string"
|
|
|
|
},
|
2021-09-27 20:28:03 +02:00
|
|
|
"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"
|
|
|
|
},
|
2021-09-27 20:28:03 +02:00
|
|
|
"Email": {
|
2021-04-26 22:00:50 +02:00
|
|
|
"type": "string"
|
|
|
|
},
|
2021-09-27 20:28:03 +02:00
|
|
|
"Identifier": {
|
2021-04-26 22:00:50 +02:00
|
|
|
"type": "string"
|
|
|
|
},
|
2021-09-27 20:28:03 +02:00
|
|
|
"Mtu": {
|
2021-04-26 22:00:50 +02:00
|
|
|
"type": "integer"
|
|
|
|
},
|
2021-09-27 20:28:03 +02:00
|
|
|
"PersistentKeepalive": {
|
2021-04-26 22:00:50 +02:00
|
|
|
"type": "integer"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2021-04-26 14:40:49 +02:00
|
|
|
"users.User": {
|
|
|
|
"type": "object",
|
|
|
|
"required": [
|
2021-09-27 20:28:03 +02:00
|
|
|
"Email",
|
|
|
|
"Firstname",
|
|
|
|
"Lastname"
|
2021-04-26 14:40:49 +02:00
|
|
|
],
|
|
|
|
"properties": {
|
2021-09-27 20:28:03 +02:00
|
|
|
"CreatedAt": {
|
2021-04-26 14:40:49 +02:00
|
|
|
"description": "database internal fields",
|
|
|
|
"type": "string"
|
|
|
|
},
|
2021-09-27 20:28:03 +02:00
|
|
|
"DeletedAt": {
|
2021-09-29 18:41:13 +02:00
|
|
|
"type": "string"
|
2021-04-26 14:40:49 +02:00
|
|
|
},
|
2021-09-27 20:28:03 +02:00
|
|
|
"Email": {
|
2021-04-26 14:40:49 +02:00
|
|
|
"description": "required fields",
|
|
|
|
"type": "string"
|
|
|
|
},
|
2021-09-27 20:28:03 +02:00
|
|
|
"Firstname": {
|
2021-04-26 14:40:49 +02:00
|
|
|
"description": "optional fields",
|
|
|
|
"type": "string"
|
|
|
|
},
|
2021-09-27 20:28:03 +02:00
|
|
|
"IsAdmin": {
|
2021-04-26 14:40:49 +02:00
|
|
|
"type": "boolean"
|
|
|
|
},
|
2021-09-27 20:28:03 +02:00
|
|
|
"Lastname": {
|
2021-04-26 14:40:49 +02:00
|
|
|
"type": "string"
|
|
|
|
},
|
2021-09-27 20:28:03 +02:00
|
|
|
"Password": {
|
2021-04-26 14:40:49 +02:00
|
|
|
"description": "optional, integrated password authentication",
|
|
|
|
"type": "string"
|
|
|
|
},
|
2021-09-27 20:28:03 +02:00
|
|
|
"Phone": {
|
2021-04-26 14:40:49 +02:00
|
|
|
"type": "string"
|
|
|
|
},
|
2021-09-27 20:28:03 +02:00
|
|
|
"Source": {
|
2021-04-26 14:40:49 +02:00
|
|
|
"type": "string"
|
|
|
|
},
|
2021-09-27 20:28:03 +02:00
|
|
|
"UpdatedAt": {
|
2021-04-26 14:40:49 +02:00
|
|
|
"type": "string"
|
|
|
|
}
|
|
|
|
}
|
2021-04-26 22:00:50 +02:00
|
|
|
},
|
|
|
|
"wireguard.Device": {
|
|
|
|
"type": "object",
|
|
|
|
"required": [
|
2021-09-27 20:28:03 +02:00
|
|
|
"DeviceName",
|
|
|
|
"IPsStr",
|
|
|
|
"PrivateKey",
|
|
|
|
"PublicKey",
|
|
|
|
"Type"
|
2021-04-26 22:00:50 +02:00
|
|
|
],
|
|
|
|
"properties": {
|
2021-09-27 20:28:03 +02:00
|
|
|
"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"
|
|
|
|
},
|
2021-09-27 20:28:03 +02:00
|
|
|
"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"
|
|
|
|
},
|
2021-09-27 20:28:03 +02:00
|
|
|
"DefaultEndpoint": {
|
2021-04-26 22:00:50 +02:00
|
|
|
"description": "Settings that are applied to all peer by default",
|
|
|
|
"type": "string"
|
|
|
|
},
|
2021-09-27 20:28:03 +02:00
|
|
|
"DefaultPersistentKeepalive": {
|
2021-04-26 22:00:50 +02:00
|
|
|
"type": "integer"
|
|
|
|
},
|
2021-09-27 20:28:03 +02:00
|
|
|
"DeviceName": {
|
2021-04-26 22:00:50 +02:00
|
|
|
"type": "string"
|
|
|
|
},
|
2021-09-27 20:28:03 +02:00
|
|
|
"DisplayName": {
|
2021-04-26 22:00:50 +02:00
|
|
|
"type": "string"
|
|
|
|
},
|
2021-09-27 20:28:03 +02:00
|
|
|
"FirewallMark": {
|
2021-04-26 22:00:50 +02:00
|
|
|
"type": "integer"
|
|
|
|
},
|
2021-09-27 20:28:03 +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"
|
|
|
|
},
|
2021-09-27 20:28:03 +02:00
|
|
|
"ListenPort": {
|
2021-04-26 22:00:50 +02:00
|
|
|
"type": "integer"
|
|
|
|
},
|
2021-09-27 20:28:03 +02:00
|
|
|
"Mtu": {
|
2021-04-26 22:00:50 +02:00
|
|
|
"description": "the interface MTU, wg-quick addition",
|
|
|
|
"type": "integer"
|
|
|
|
},
|
2021-09-27 20:28:03 +02:00
|
|
|
"PostDown": {
|
2021-04-26 22:00:50 +02:00
|
|
|
"description": "post down script, wg-quick addition",
|
|
|
|
"type": "string"
|
|
|
|
},
|
2021-09-27 20:28:03 +02:00
|
|
|
"PostUp": {
|
2021-04-26 22:00:50 +02:00
|
|
|
"description": "post up script, wg-quick addition",
|
|
|
|
"type": "string"
|
|
|
|
},
|
2021-09-27 20:28:03 +02:00
|
|
|
"PreDown": {
|
2021-04-26 22:00:50 +02:00
|
|
|
"description": "pre down script, wg-quick addition",
|
|
|
|
"type": "string"
|
|
|
|
},
|
2021-09-27 20:28:03 +02:00
|
|
|
"PreUp": {
|
2021-04-26 22:00:50 +02:00
|
|
|
"description": "pre up script, wg-quick addition",
|
|
|
|
"type": "string"
|
|
|
|
},
|
2021-09-27 20:28:03 +02:00
|
|
|
"PrivateKey": {
|
2021-04-26 22:00:50 +02:00
|
|
|
"description": "Core WireGuard Settings (Interface section)",
|
|
|
|
"type": "string"
|
|
|
|
},
|
2021-09-27 20:28:03 +02:00
|
|
|
"PublicKey": {
|
2021-04-26 22:00:50 +02:00
|
|
|
"description": "Misc. WireGuard Settings",
|
|
|
|
"type": "string"
|
|
|
|
},
|
2021-09-27 20:28:03 +02:00
|
|
|
"RoutingTable": {
|
2021-04-26 22:00:50 +02:00
|
|
|
"description": "the routing table, wg-quick addition",
|
|
|
|
"type": "string"
|
|
|
|
},
|
2021-09-27 20:28:03 +02:00
|
|
|
"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"
|
|
|
|
},
|
2021-09-27 20:28:03 +02:00
|
|
|
"Type": {
|
2021-04-26 22:00:50 +02:00
|
|
|
"type": "string"
|
|
|
|
},
|
2021-09-27 20:28:03 +02:00
|
|
|
"UpdatedAt": {
|
2021-04-26 22:00:50 +02:00
|
|
|
"type": "string"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"wireguard.Peer": {
|
|
|
|
"type": "object",
|
|
|
|
"required": [
|
2021-09-27 20:28:03 +02:00
|
|
|
"DeviceName",
|
2021-09-29 18:41:13 +02:00
|
|
|
"DeviceType",
|
2021-09-27 20:28:03 +02:00
|
|
|
"Email",
|
|
|
|
"Identifier",
|
2021-09-29 18:41:13 +02:00
|
|
|
"PublicKey",
|
|
|
|
"UID"
|
2021-04-26 22:00:50 +02:00
|
|
|
],
|
|
|
|
"properties": {
|
2021-09-27 20:28:03 +02:00
|
|
|
"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"
|
|
|
|
},
|
2021-09-27 20:28:03 +02:00
|
|
|
"CreatedAt": {
|
2021-04-26 22:00:50 +02:00
|
|
|
"type": "string"
|
|
|
|
},
|
2021-09-27 20:28:03 +02:00
|
|
|
"CreatedBy": {
|
2021-04-26 22:00:50 +02:00
|
|
|
"type": "string"
|
|
|
|
},
|
2021-09-27 20:28:03 +02:00
|
|
|
"DNSStr": {
|
|
|
|
"description": "comma separated list of the DNS servers for the client",
|
2021-04-26 22:00:50 +02:00
|
|
|
"type": "string"
|
|
|
|
},
|
2021-09-27 20:28:03 +02:00
|
|
|
"DeactivatedAt": {
|
2021-04-26 22:00:50 +02:00
|
|
|
"type": "string"
|
|
|
|
},
|
2021-09-27 20:28:03 +02:00
|
|
|
"DeviceName": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
2021-09-29 18:41:13 +02:00
|
|
|
"DeviceType": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
2021-09-27 20:28:03 +02:00
|
|
|
"Email": {
|
2021-04-26 22:00:50 +02:00
|
|
|
"type": "string"
|
|
|
|
},
|
2021-09-27 20:28:03 +02:00
|
|
|
"Endpoint": {
|
2021-04-26 22:00:50 +02:00
|
|
|
"type": "string"
|
|
|
|
},
|
2021-09-27 20:28:03 +02:00
|
|
|
"IPsStr": {
|
|
|
|
"description": "a comma separated list of IPs of the client",
|
2021-04-26 22:00:50 +02:00
|
|
|
"type": "string"
|
|
|
|
},
|
2021-09-27 20:28:03 +02:00
|
|
|
"Identifier": {
|
2021-04-26 22:00:50 +02:00
|
|
|
"description": "Identifier AND Email make a WireGuard peer unique",
|
|
|
|
"type": "string"
|
|
|
|
},
|
2021-09-27 20:28:03 +02:00
|
|
|
"IgnoreGlobalSettings": {
|
2021-04-26 22:00:50 +02:00
|
|
|
"type": "boolean"
|
|
|
|
},
|
2021-09-27 20:28:03 +02:00
|
|
|
"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"
|
|
|
|
},
|
2021-09-27 20:28:03 +02:00
|
|
|
"PersistentKeepalive": {
|
2021-04-26 22:00:50 +02:00
|
|
|
"type": "integer"
|
|
|
|
},
|
2021-09-27 20:28:03 +02:00
|
|
|
"PresharedKey": {
|
2021-04-26 22:00:50 +02:00
|
|
|
"type": "string"
|
|
|
|
},
|
2021-09-27 20:28:03 +02:00
|
|
|
"PrivateKey": {
|
2021-04-26 22:00:50 +02:00
|
|
|
"description": "Misc. WireGuard Settings",
|
|
|
|
"type": "string"
|
|
|
|
},
|
2021-09-27 20:28:03 +02:00
|
|
|
"PublicKey": {
|
2021-04-26 22:00:50 +02:00
|
|
|
"description": "Core WireGuard Settings",
|
|
|
|
"type": "string"
|
|
|
|
},
|
2021-09-29 18:41:13 +02:00
|
|
|
"UID": {
|
|
|
|
"description": "uid for html identification",
|
|
|
|
"type": "string"
|
|
|
|
},
|
2021-09-27 20:28:03 +02:00
|
|
|
"UpdatedAt": {
|
2021-04-26 22:00:50 +02:00
|
|
|
"type": "string"
|
|
|
|
},
|
2021-09-27 20:28:03 +02:00
|
|
|
"UpdatedBy": {
|
2021-04-26 22:00:50 +02:00
|
|
|
"type": "string"
|
|
|
|
}
|
|
|
|
}
|
2021-04-26 14:40:49 +02:00
|
|
|
}
|
|
|
|
},
|
|
|
|
"securityDefinitions": {
|
|
|
|
"ApiBasicAuth": {
|
|
|
|
"type": "basic"
|
2021-04-26 22:00:50 +02:00
|
|
|
},
|
|
|
|
"GeneralBasicAuth": {
|
|
|
|
"type": "basic"
|
2021-04-26 14:40:49 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}`
|
|
|
|
|
|
|
|
type swaggerInfo struct {
|
|
|
|
Version string
|
|
|
|
Host string
|
|
|
|
BasePath string
|
|
|
|
Schemes []string
|
|
|
|
Title string
|
|
|
|
Description string
|
|
|
|
}
|
|
|
|
|
|
|
|
// SwaggerInfo holds exported Swagger Info so clients can modify it
|
|
|
|
var SwaggerInfo = swaggerInfo{
|
|
|
|
Version: "1.0",
|
|
|
|
Host: "",
|
|
|
|
BasePath: "/api/v1",
|
|
|
|
Schemes: []string{},
|
|
|
|
Title: "WireGuard Portal API",
|
|
|
|
Description: "WireGuard Portal API for managing users and peers.",
|
|
|
|
}
|
|
|
|
|
|
|
|
type s struct{}
|
|
|
|
|
|
|
|
func (s *s) ReadDoc() string {
|
|
|
|
sInfo := SwaggerInfo
|
|
|
|
sInfo.Description = strings.Replace(sInfo.Description, "\n", "\\n", -1)
|
|
|
|
|
|
|
|
t, err := template.New("swagger_info").Funcs(template.FuncMap{
|
|
|
|
"marshal": func(v interface{}) string {
|
|
|
|
a, _ := json.Marshal(v)
|
|
|
|
return string(a)
|
|
|
|
},
|
2021-09-27 20:28:03 +02:00
|
|
|
"escape": func(v interface{}) string {
|
|
|
|
// escape tabs
|
|
|
|
str := strings.Replace(v.(string), "\t", "\\t", -1)
|
|
|
|
// replace " with \", and if that results in \\", replace that with \\\"
|
|
|
|
str = strings.Replace(str, "\"", "\\\"", -1)
|
|
|
|
return strings.Replace(str, "\\\\\"", "\\\\\\\"", -1)
|
|
|
|
},
|
2021-04-26 14:40:49 +02:00
|
|
|
}).Parse(doc)
|
|
|
|
if err != nil {
|
|
|
|
return doc
|
|
|
|
}
|
|
|
|
|
|
|
|
var tpl bytes.Buffer
|
|
|
|
if err := t.Execute(&tpl, sInfo); err != nil {
|
|
|
|
return doc
|
|
|
|
}
|
|
|
|
|
|
|
|
return tpl.String()
|
|
|
|
}
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
swag.Register(swag.Name, &s{})
|
|
|
|
}
|