summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
author6543 <6543@obermui.de>2020-08-02 14:01:12 +0200
committerGitHub <noreply@github.com>2020-08-02 13:01:12 +0100
commit7b260acd7b3abf8c7b69cc50340c91ac5808a938 (patch)
tree9263ca271efe4ab7acfddee077df997ecf89a4b6
parent15300699c4529dd25051d4fd2225c46aeff095fe (diff)
downloadgitea-7b260acd7b3abf8c7b69cc50340c91ac5808a938.tar.gz
gitea-7b260acd7b3abf8c7b69cc50340c91ac5808a938.zip
Add TOTP header to Swagger Documentation (#12402)
-rw-r--r--routers/api/v1/api.go6
-rw-r--r--templates/swagger/v1_json.tmpl9
2 files changed, 15 insertions, 0 deletions
diff --git a/routers/api/v1/api.go b/routers/api/v1/api.go
index b03f547a6b..f67eebacc4 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 28a33fb3d3..c601809a75 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": []
}
]
}