Class: TxghServer::GitlabRequestAuth

Inherits:
Object
  • Object
show all
Defined in:
lib/txgh-server/gitlab_request_auth.rb

Constant Summary collapse

RACK_HEADER =
'HTTP_X_GITLAB_TOKEN'
GITLAB_HEADER =
'X-Gitlab-Token'

Class Method Summary collapse

Class Method Details

.authentic_request?(request, secret) ⇒ Boolean

Returns:

  • (Boolean)


7
8
9
10
# File 'lib/txgh-server/gitlab_request_auth.rb', line 7

def authentic_request?(request, secret)
  request_token = request.env[RACK_HEADER]
  request_token == secret
end