From 753403b4c8feadfec1fbad0467e17dd5fbc51d5b Mon Sep 17 00:00:00 2001 From: takezoe Date: Sun, 30 Oct 2022 19:26:27 +0900 Subject: [PATCH] Implement /meta API endpoint --- .../gitbucket/core/controller/ApiController.scala | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/main/scala/gitbucket/core/controller/ApiController.scala b/src/main/scala/gitbucket/core/controller/ApiController.scala index 1a64da1ba..da86a0cae 100644 --- a/src/main/scala/gitbucket/core/controller/ApiController.scala +++ b/src/main/scala/gitbucket/core/controller/ApiController.scala @@ -100,4 +100,16 @@ trait ApiControllerBase extends ControllerBase { get("/api/v3/gitbucket/plugins") { PluginRegistry().getPlugins().map { ApiPlugin(_) } } + + /** + * https://docs.github.com/en/enterprise-server@2.21/rest/reference/meta#get-github-enterprise-server-meta-information + */ + get("/api/v3/meta") { + JsonFormat( + Map( + "https://api.github.com/meta" -> context.loginAccount.isDefined, + "installed_version" -> "2.21.0" + ) + ) + } }