debian-mirror-gitlab/lib/gitlab/pages.rb

23 lines
539 B
Ruby
Raw Normal View History

2018-12-13 13:39:08 +05:30
# frozen_string_literal: true
2018-03-17 18:26:18 +05:30
module Gitlab
2019-12-04 20:38:33 +05:30
class Pages
2018-03-17 18:26:18 +05:30
VERSION = File.read(Rails.root.join("GITLAB_PAGES_VERSION")).strip.freeze
2019-12-04 20:38:33 +05:30
INTERNAL_API_REQUEST_HEADER = 'Gitlab-Pages-Api-Request'.freeze
include JwtAuthenticatable
class << self
def verify_api_request(request_headers)
decode_jwt_for_issuer('gitlab-pages', request_headers[INTERNAL_API_REQUEST_HEADER])
rescue JWT::DecodeError
false
end
def secret_path
Gitlab.config.pages.secret_file
end
end
2018-03-17 18:26:18 +05:30
end
end