feat: add swagger docs for rest of api endpoints

This commit is contained in:
Stavros
2026-07-04 14:56:20 +03:00
parent fb48f1eb2d
commit dcb503b3be
7 changed files with 2516 additions and 136 deletions
+851
View File
@@ -19,6 +19,554 @@ const docTemplate = `{
"host": "{{.Host}}",
"basePath": "{{.BasePath}}",
"paths": {
"/.well-known/jwks.json": {
"get": {
"description": "JWKS Endpoint",
"produces": [
"application/json"
],
"tags": [
"well-known"
],
"summary": "JWKS",
"responses": {
"200": {
"description": "OK"
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/controller.SimpleResponse"
}
}
}
}
},
"/.well-known/openid-configuration": {
"get": {
"description": "OpenID Connect Configuration Discovery Endpoint",
"produces": [
"application/json"
],
"tags": [
"well-known"
],
"summary": "OpenID Connect Configuration",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/controller.OpenIDConnectConfiguration"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/controller.SimpleResponse"
}
}
}
}
},
"/.well-known/webfinger": {
"get": {
"description": "WebFinger Endpoint",
"produces": [
"application/json"
],
"tags": [
"well-known"
],
"summary": "WebFinger",
"parameters": [
{
"type": "string",
"description": "Resource",
"name": "resource",
"in": "query",
"required": true
},
{
"type": "string",
"description": "Rel",
"name": "rel",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/controller.WebfingerResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/controller.SimpleResponse"
}
}
}
}
},
"/api/auth/caddy": {
"get": {
"description": "Forward-Auth Proxy Endpoint",
"produces": [
"application/json"
],
"tags": [
"forward-auth"
],
"summary": "Proxy",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/controller.SimpleResponse"
}
},
"302": {
"description": "Found"
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/controller.SimpleResponse"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/controller.SimpleResponse"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/controller.SimpleResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/controller.SimpleResponse"
}
}
}
}
},
"/api/auth/envoy": {
"get": {
"description": "Forward-Auth Proxy Endpoint",
"produces": [
"application/json"
],
"tags": [
"forward-auth"
],
"summary": "Proxy",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/controller.SimpleResponse"
}
},
"302": {
"description": "Found"
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/controller.SimpleResponse"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/controller.SimpleResponse"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/controller.SimpleResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/controller.SimpleResponse"
}
}
}
},
"put": {
"description": "Forward-Auth Proxy Endpoint",
"produces": [
"application/json"
],
"tags": [
"forward-auth"
],
"summary": "Proxy",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/controller.SimpleResponse"
}
},
"302": {
"description": "Found"
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/controller.SimpleResponse"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/controller.SimpleResponse"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/controller.SimpleResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/controller.SimpleResponse"
}
}
}
},
"post": {
"description": "Forward-Auth Proxy Endpoint",
"produces": [
"application/json"
],
"tags": [
"forward-auth"
],
"summary": "Proxy",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/controller.SimpleResponse"
}
},
"302": {
"description": "Found"
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/controller.SimpleResponse"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/controller.SimpleResponse"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/controller.SimpleResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/controller.SimpleResponse"
}
}
}
},
"delete": {
"description": "Forward-Auth Proxy Endpoint",
"produces": [
"application/json"
],
"tags": [
"forward-auth"
],
"summary": "Proxy",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/controller.SimpleResponse"
}
},
"302": {
"description": "Found"
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/controller.SimpleResponse"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/controller.SimpleResponse"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/controller.SimpleResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/controller.SimpleResponse"
}
}
}
},
"options": {
"description": "Forward-Auth Proxy Endpoint",
"produces": [
"application/json"
],
"tags": [
"forward-auth"
],
"summary": "Proxy",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/controller.SimpleResponse"
}
},
"302": {
"description": "Found"
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/controller.SimpleResponse"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/controller.SimpleResponse"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/controller.SimpleResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/controller.SimpleResponse"
}
}
}
},
"head": {
"description": "Forward-Auth Proxy Endpoint",
"produces": [
"application/json"
],
"tags": [
"forward-auth"
],
"summary": "Proxy",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/controller.SimpleResponse"
}
},
"302": {
"description": "Found"
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/controller.SimpleResponse"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/controller.SimpleResponse"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/controller.SimpleResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/controller.SimpleResponse"
}
}
}
},
"patch": {
"description": "Forward-Auth Proxy Endpoint",
"produces": [
"application/json"
],
"tags": [
"forward-auth"
],
"summary": "Proxy",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/controller.SimpleResponse"
}
},
"302": {
"description": "Found"
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/controller.SimpleResponse"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/controller.SimpleResponse"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/controller.SimpleResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/controller.SimpleResponse"
}
}
}
}
},
"/api/auth/nginx": {
"get": {
"description": "Forward-Auth Proxy Endpoint",
"produces": [
"application/json"
],
"tags": [
"forward-auth"
],
"summary": "Proxy",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/controller.SimpleResponse"
}
},
"302": {
"description": "Found"
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/controller.SimpleResponse"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/controller.SimpleResponse"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/controller.SimpleResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/controller.SimpleResponse"
}
}
}
}
},
"/api/auth/traefik": {
"get": {
"description": "Forward-Auth Proxy Endpoint",
"produces": [
"application/json"
],
"tags": [
"forward-auth"
],
"summary": "Proxy",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/controller.SimpleResponse"
}
},
"302": {
"description": "Found"
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/controller.SimpleResponse"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/controller.SimpleResponse"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/controller.SimpleResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/controller.SimpleResponse"
}
}
}
}
},
"/api/context/app": {
"get": {
"description": "Get the app context",
@@ -231,6 +779,161 @@ const docTemplate = `{
}
}
},
"/api/user/login": {
"post": {
"description": "Login Endpoint",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"accounts"
],
"summary": "Login",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/controller.TotpPendingResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/controller.SimpleResponse"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/controller.SimpleResponse"
}
},
"429": {
"description": "Too Many Requests",
"schema": {
"$ref": "#/definitions/controller.SimpleResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/controller.SimpleResponse"
}
}
}
}
},
"/api/user/logout": {
"post": {
"description": "Logout Endpoint",
"produces": [
"application/json"
],
"tags": [
"accounts"
],
"summary": "Logout",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/controller.SimpleResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/controller.SimpleResponse"
}
}
}
}
},
"/api/user/tailscale": {
"post": {
"description": "Tailscale Auth Endpoint (Experimental)",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"accounts"
],
"summary": "Tailscale",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/controller.SimpleResponse"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/controller.SimpleResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/controller.SimpleResponse"
}
}
}
}
},
"/api/user/totp": {
"post": {
"description": "TOTP Endpoint",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"accounts"
],
"summary": "TOTP",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/controller.SimpleResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/controller.SimpleResponse"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/controller.SimpleResponse"
}
},
"429": {
"description": "Too Many Requests",
"schema": {
"$ref": "#/definitions/controller.SimpleResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/controller.SimpleResponse"
}
}
}
}
},
"/authorize": {
"get": {
"description": "OpenID Connect Authorize Endpoint",
@@ -724,6 +1427,41 @@ const docTemplate = `{
}
}
}
},
"/resources/{resource}": {
"get": {
"description": "Get a resource by file name",
"tags": [
"resources"
],
"summary": "Resources Endpoint",
"parameters": [
{
"type": "string",
"description": "Resource Name",
"name": "resource",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK"
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/controller.SimpleResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/controller.SimpleResponse"
}
}
}
}
}
},
"definitions": {
@@ -836,6 +1574,80 @@ const docTemplate = `{
}
}
},
"controller.OpenIDConnectConfiguration": {
"type": "object",
"properties": {
"authorization_endpoint": {
"type": "string"
},
"claims_supported": {
"type": "array",
"items": {
"type": "string"
}
},
"grant_types_supported": {
"type": "array",
"items": {
"type": "string"
}
},
"id_token_signing_alg_values_supported": {
"type": "array",
"items": {
"type": "string"
}
},
"issuer": {
"type": "string"
},
"jwks_uri": {
"type": "string"
},
"request_object_signing_alg_values_supported": {
"type": "array",
"items": {
"type": "string"
}
},
"request_parameter_supported": {
"type": "boolean"
},
"response_types_supported": {
"type": "array",
"items": {
"type": "string"
}
},
"scopes_supported": {
"type": "array",
"items": {
"type": "string"
}
},
"service_documentation": {
"type": "string"
},
"subject_types_supported": {
"type": "array",
"items": {
"type": "string"
}
},
"token_endpoint": {
"type": "string"
},
"token_endpoint_auth_methods_supported": {
"type": "array",
"items": {
"type": "string"
}
},
"userinfo_endpoint": {
"type": "string"
}
}
},
"controller.SimpleResponse": {
"type": "object",
"properties": {
@@ -847,6 +1659,20 @@ const docTemplate = `{
}
}
},
"controller.TotpPendingResponse": {
"type": "object",
"properties": {
"message": {
"type": "string"
},
"status": {
"type": "integer"
},
"totpPending": {
"type": "boolean"
}
}
},
"controller.UCRAuth": {
"type": "object",
"properties": {
@@ -917,6 +1743,31 @@ const docTemplate = `{
}
}
},
"controller.WebfingerResponse": {
"type": "object",
"properties": {
"links": {
"type": "array",
"items": {
"$ref": "#/definitions/controller.WebfingerResponseLink"
}
},
"subject": {
"type": "string"
}
}
},
"controller.WebfingerResponseLink": {
"type": "object",
"properties": {
"href": {
"type": "string"
},
"rel": {
"type": "string"
}
}
},
"model.AddressClaim": {
"type": "object",
"properties": {