summaryrefslogtreecommitdiff
path: root/lib/api/internal
diff options
context:
space:
mode:
authorKrasimir Angelov <kangelov@gitlab.com>2019-09-06 16:06:25 +1200
committerKrasimir Angelov <kangelov@gitlab.com>2019-09-06 16:06:25 +1200
commit477ba2b3465736cdccfb6cb6a36f78447942e310 (patch)
treed1d29ae1a34d8a359fb93815d7df1345749a9341 /lib/api/internal
parent9d38778f4146fec734695be02f1e63c58f6d78db (diff)
downloadgitlab-ce-477ba2b3465736cdccfb6cb6a36f78447942e310.tar.gz
Add skeleton Pages internal API61927-skeleton-pages-internal-api
Basic `/internal/pages` endpoint that will be used for Pages virtual domains internal API. The endpoint is currently behind feature flag and provides authetication similar to how Workhorse is authenticating with the GitLab.
Diffstat (limited to 'lib/api/internal')
-rw-r--r--lib/api/internal/pages.rb27
1 files changed, 27 insertions, 0 deletions
diff --git a/lib/api/internal/pages.rb b/lib/api/internal/pages.rb
new file mode 100644
index 00000000000..6ea048bde03
--- /dev/null
+++ b/lib/api/internal/pages.rb
@@ -0,0 +1,27 @@
+# frozen_string_literal: true
+
+module API
+ # Pages Internal API
+ module Internal
+ class Pages < Grape::API
+ before do
+ not_found! unless Feature.enabled?(:pages_internal_api)
+ authenticate_gitlab_pages_request!
+ end
+
+ helpers do
+ def authenticate_gitlab_pages_request!
+ unauthorized! unless Gitlab::Pages.verify_api_request(headers)
+ end
+ end
+
+ namespace 'internal' do
+ namespace 'pages' do
+ get "/" do
+ status :ok
+ end
+ end
+ end
+ end
+ end
+end