deployment api completed (#11)

This commit is contained in:
Christoph Haas
2021-04-29 11:23:32 +02:00
parent 9c8a1df01f
commit 7b1f59d86a
3 changed files with 141 additions and 12 deletions

View File

@@ -1039,7 +1039,58 @@ var doc = `{
}
}
},
"/provisioning/peer": {
"/provisioning/peer/{pkey}": {
"get": {
"security": [
{
"GeneralBasicAuth": []
}
],
"produces": [
"text/plain"
],
"tags": [
"Provisioning"
],
"summary": "Retrieves the peer config for the given public key",
"parameters": [
{
"type": "string",
"description": "Public Key (Base 64)",
"name": "pkey",
"in": "path",
"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": {
"post": {
"security": [
{
@@ -1095,7 +1146,7 @@ var doc = `{
}
}
},
"/provisioning/peer/{pkey}": {
"/provisioning/peers/{email}": {
"get": {
"security": [
{
@@ -1103,26 +1154,29 @@ var doc = `{
}
],
"produces": [
"text/plain"
"application/json"
],
"tags": [
"Provisioning"
],
"summary": "Retrieves the peer config for the given public key",
"summary": "Retrieves all active peers for the given email address",
"parameters": [
{
"type": "string",
"description": "Public Key (Base 64)",
"name": "pkey",
"description": "Email Address",
"name": "email",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "The WireGuard configuration file",
"description": "All active WireGuard peers",
"schema": {
"type": "string"
"type": "array",
"items": {
"$ref": "#/definitions/server.PeerDeploymentInformation"
}
}
},
"401": {
@@ -1168,6 +1222,23 @@ var doc = `{
}
}
},
"server.PeerDeploymentInformation": {
"type": "object",
"properties": {
"device": {
"type": "string"
},
"deviceIdentifier": {
"type": "string"
},
"identifier": {
"type": "string"
},
"publicKey": {
"type": "string"
}
}
},
"server.ProvisioningRequest": {
"type": "object",
"required": [