From 3c584f16a6aa350a448a48bedb875d2ce8a3d06b Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Sat, 1 Aug 2020 18:14:34 +0200 Subject: [PATCH] add swagger docu of TOTP header --- routers/api/v1/api.go | 6 ++++++ templates/swagger/v1_json.tmpl | 9 +++++++++ 2 files changed, 15 insertions(+) diff --git a/routers/api/v1/api.go b/routers/api/v1/api.go index b03f547a6bc7d..f67eebacc41d0 100644 --- a/routers/api/v1/api.go +++ b/routers/api/v1/api.go @@ -27,6 +27,7 @@ // - AuthorizationHeaderToken : // - SudoParam : // - SudoHeader : +// - TOTPHeader : // // SecurityDefinitions: // BasicAuth: @@ -54,6 +55,11 @@ // name: Sudo // in: header // description: Sudo API request as the user provided as the key. Admin privileges are required. +// TOTPHeader: +// type: apiKey +// name: X-GITEA-OTP +// in: header +// description: Must be used in combination with BasicAuth if two-factor authentication is enabled. // // swagger:meta package v1 diff --git a/templates/swagger/v1_json.tmpl b/templates/swagger/v1_json.tmpl index 28a33fb3d3226..c601809a757bc 100644 --- a/templates/swagger/v1_json.tmpl +++ b/templates/swagger/v1_json.tmpl @@ -15551,6 +15551,12 @@ "name": "sudo", "in": "query" }, + "TOTPHeader": { + "description": "Must be used in combination with BasicAuth if two-factor authentication is enabled.", + "type": "apiKey", + "name": "X-GITEA-OTP", + "in": "header" + }, "Token": { "type": "apiKey", "name": "token", @@ -15575,6 +15581,9 @@ }, { "SudoHeader": [] + }, + { + "TOTPHeader": [] } ] }