Module: Gitlab::Pages

Includes:
JwtAuthenticatable
Defined in:
lib/gitlab/pages.rb,
lib/gitlab/pages/settings.rb

Defined Under Namespace

Classes: Settings

Constant Summary collapse

VERSION =
File.read(Rails.root.join("GITLAB_PAGES_VERSION")).strip.freeze
INTERNAL_API_REQUEST_HEADER =
'Gitlab-Pages-Api-Request'
MAX_SIZE =
1.terabyte

Constants included from JwtAuthenticatable

JwtAuthenticatable::SECRET_LENGTH

Class Method Summary collapse

Methods included from JwtAuthenticatable

included

Class Method Details

.access_control_is_forced?Boolean

Returns:

  • (Boolean)

22
23
24
25
# File 'lib/gitlab/pages.rb', line 22

def access_control_is_forced?
  ::Gitlab.config.pages.access_control &&
    ::Gitlab::CurrentSettings.current_application_settings.force_pages_access_control
end

.secret_pathObject


18
19
20
# File 'lib/gitlab/pages.rb', line 18

def secret_path
  Gitlab.config.pages.secret_file
end

.verify_api_request(request_headers) ⇒ Object


12
13
14
15
16
# File 'lib/gitlab/pages.rb', line 12

def verify_api_request(request_headers)
  decode_jwt(request_headers[INTERNAL_API_REQUEST_HEADER], issuer: 'gitlab-pages')
rescue JWT::DecodeError
  false
end